Kaydet (Commit) 9fd7ca78 authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski Kaydeden (comit) Björn Michaelsen

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/10988Reviewed-by: 's avatarBjörn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: 's avatarBjörn Michaelsen <bjoern.michaelsen@canonical.com>
üst cde554a7
......@@ -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!" );
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment