sw/source/core/doc/docfmt.cxx |   18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

New commits:
commit 9fd7ca788bc8fd88b048c544edb0dc6518010e11
Author: Jan-Marek Glogowski <[email protected]>
Date:   Sat Aug 9 00:22:00 2014 +0200

    fdo#78611 Don't create automatic rules on reset
    
    As we reset all styles, there shouldn't be any unknown automatic
    SwNumRules, because all should have been created by the style
    copying! And in this case we also have to overwrite the existing
    automatic SwNumRules to get a consistent copy.
    
    In case of unknown automatic SwNumRules we just warn and ignore
    any inconsistence.
    
    Change-Id: I26e25bccc9a8c7be74f3dceb2e1f91894eac1d0a
    Reviewed-on: https://gerrit.libreoffice.org/10988
    Reviewed-by: Björn Michaelsen <[email protected]>
    Tested-by: Björn Michaelsen <[email protected]>

diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 1283e4a..9c3d5d5 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1578,13 +1578,21 @@ void SwDoc::ReplaceStyles( const SwDoc& rSource, bool 
bIncludePageStyles )
         for( sal_uInt16 n = 0; n < nCnt; ++n )
         {
             const SwNumRule& rR = *rArr[ n ];
-            if( !rR.IsAutoRule() )
+            SwNumRule* pNew = FindNumRulePtr( rR.GetName());
+            if( pNew )
+                pNew->CopyNumRule( this, rR );
+            else
             {
-                SwNumRule* pNew = FindNumRulePtr( rR.GetName());
-                if( pNew )
-                    pNew->CopyNumRule( this, rR );
-                else
+                if( !rR.IsAutoRule() )
                     MakeNumRule( rR.GetName(), &rR );
+                else
+                {
+                    // as we reset all styles, there shouldn't be any unknown
+                    // automatic SwNumRules, because all should have been
+                    // created by the style copying!
+                    // So just warn and ignore.
+                    SAL_WARN( "sw.styles", "Found unknown auto SwNumRule 
during reset!" );
+                }
             }
         }
     }
_______________________________________________
Libreoffice-commits mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to