summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2014-08-09 00:22:00 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2014-09-30 09:49:04 +0200
commitec3e220fe215b21df16294daf88426b23f3ab7b3 (patch)
tree845ccaa7d26b3c3d935f31ac1a72d3ecec88da4b
parentfdo#81782 MM: copy most document properties (diff)
downloadcore-ec3e220fe215b21df16294daf88426b23f3ab7b3.tar.gz
core-ec3e220fe215b21df16294daf88426b23f3ab7b3.zip
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 <bjoern.michaelsen@canonical.com> Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> (cherry picked from commit 9fd7ca788bc8fd88b048c544edb0dc6518010e11)
-rw-r--r--sw/source/core/doc/docfmt.cxx18
1 files changed, 13 insertions, 5 deletions
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index a918803b7b0c..5bf782693cc1 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -2270,13 +2270,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!" );
+ }
}
}
}