summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2014-08-09 00:22:00 +0200
committerBjörn Michaelsen <bjoern.michaelsen@canonical.com>2014-09-24 16:13:22 +0000
commit9fd7ca788bc8fd88b048c544edb0dc6518010e11 (patch)
treeaa3794c1e4e9d05a583b550def6e385349437850
parentcde554a731596f1ca53a911656b6503c96dadcc7 (diff)
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>
-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 1283e4a69e20..9c3d5d598679 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!" );
+ }
}
}
}