diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-08-30 13:31:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-08-30 19:26:41 +0100 |
commit | 606232e450888b12e24da9c3e56c91333a1bb6d3 (patch) | |
tree | bc658d4d70f0469e366b95b30909f641c0096929 /sw/source/uibase/config | |
parent | 29730225f2e1dcc0a2e0a63f1eebbc442055fecb (diff) |
rework for coverity#1371269 Missing move assignment operator
Change-Id: I10f9ed448854b4ece61fd84b8aa49674d0828cac
Diffstat (limited to 'sw/source/uibase/config')
-rw-r--r-- | sw/source/uibase/config/uinums.cxx | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/sw/source/uibase/config/uinums.cxx b/sw/source/uibase/config/uinums.cxx index ede3be4d7a6e..a3943a968111 100644 --- a/sw/source/uibase/config/uinums.cxx +++ b/sw/source/uibase/config/uinums.cxx @@ -159,21 +159,19 @@ SwNumRulesWithName& SwNumRulesWithName::operator=(const SwNumRulesWithName &rCop return *this; } -void SwNumRulesWithName::MakeNumRule( SwWrtShell& rSh, SwNumRule& rChg ) const +SwNumRule SwNumRulesWithName::MakeNumRule(SwWrtShell& rSh) const { // #i89178# - rChg = SwNumRule( maName, numfunc::GetDefaultPositionAndSpaceMode() ); - rChg.SetAutoRule( false ); - for( sal_uInt16 n = 0; n < MAXLEVEL; ++n ) + SwNumRule aChg(maName, numfunc::GetDefaultPositionAndSpaceMode()); + aChg.SetAutoRule( false ); + for (sal_uInt16 n = 0; n < MAXLEVEL; ++n) { SwNumFormatGlobal* pFormat = aFormats[ n ]; - if( nullptr != pFormat) - { - SwNumFormat aNew; - pFormat->ChgNumFormat( rSh, aNew ); - rChg.Set( n, aNew ); - } + if (!pFormat) + continue; + aChg.Set(n, pFormat->MakeNumFormat(rSh)); } + return aChg; } void SwNumRulesWithName::GetNumFormat( @@ -236,8 +234,7 @@ SwNumRulesWithName::SwNumFormatGlobal::~SwNumFormatGlobal() { } -void SwNumRulesWithName::SwNumFormatGlobal::ChgNumFormat( SwWrtShell& rSh, - SwNumFormat& rNew ) const +SwNumFormat SwNumRulesWithName::SwNumFormatGlobal::MakeNumFormat(SwWrtShell& rSh) const { SwCharFormat* pFormat = nullptr; if( !sCharFormatName.isEmpty() ) @@ -272,10 +269,11 @@ void SwNumRulesWithName::SwNumFormatGlobal::ChgNumFormat( SwWrtShell& rSh, } } } - const_cast<SwNumFormat&>(aFormat).SetCharFormat( pFormat ); - rNew = aFormat; - if( pFormat ) - const_cast<SwNumFormat&>(aFormat).SetCharFormat( nullptr ); + const_cast<SwNumFormat&>(aFormat).SetCharFormat(pFormat); + SwNumFormat aNew = aFormat; + if (pFormat) + const_cast<SwNumFormat&>(aFormat).SetCharFormat(nullptr); + return aNew; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |