summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/number.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-07-30 10:34:02 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-08-01 09:20:08 +0200
commitda64ad86e9f2dd66fbcecb46dcc22626e9f5a6a6 (patch)
tree6d566510d16fbf0d9525bde5ac435cf23c39fe48 /sw/source/core/doc/number.cxx
parent5dccc6130242a67b6c471245d289cd4a0419602a (diff)
loplugin:flatten in sw/core/doc
Change-Id: If7738d47ec0273f24eee99b7336380cfa78c1243 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99896 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/doc/number.cxx')
-rw-r--r--sw/source/core/doc/number.cxx126
1 files changed, 63 insertions, 63 deletions
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 1d2ae4f970d4..2dd071433192 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -102,21 +102,21 @@ const SwNumFormat* SwNumRule::GetNumFormat( sal_uInt16 i ) const
void SwNumRule::SetName( const OUString & rName,
IDocumentListsAccess& rDocListAccess)
{
- if ( msName != rName )
+ if ( msName == rName )
+ return;
+
+ if (mpNumRuleMap)
{
- if (mpNumRuleMap)
- {
- mpNumRuleMap->erase(msName);
- (*mpNumRuleMap)[rName] = this;
+ mpNumRuleMap->erase(msName);
+ (*mpNumRuleMap)[rName] = this;
- if ( !GetDefaultListId().isEmpty() )
- {
- rDocListAccess.trackChangeOfListStyleName( msName, rName );
- }
+ if ( !GetDefaultListId().isEmpty() )
+ {
+ rDocListAccess.trackChangeOfListStyleName( msName, rName );
}
-
- msName = rName;
}
+
+ msName = rName;
}
void SwNumRule::GetTextNodeList( SwNumRule::tTextNodeList& rTextNodeList ) const
@@ -1237,50 +1237,50 @@ namespace numfunc
const uno::Any* pValues = aValues.getConstArray();
OSL_ENSURE( aValues.getLength() == aPropNames.getLength(),
"<SwDefBulletConfig::SwDefBulletConfig()> - GetProperties failed");
- if ( aValues.getLength() == aPropNames.getLength() )
+ if ( aValues.getLength() != aPropNames.getLength() )
+ return;
+
+ for ( int nProp = 0; nProp < aPropNames.getLength(); ++nProp )
{
- for ( int nProp = 0; nProp < aPropNames.getLength(); ++nProp )
+ if ( pValues[nProp].hasValue() )
{
- if ( pValues[nProp].hasValue() )
+ switch ( nProp )
{
- switch ( nProp )
+ case 0:
{
- case 0:
- {
- OUString aStr;
- pValues[nProp] >>= aStr;
- msFontname = aStr;
- mbUserDefinedFontname = true;
- }
- break;
- case 1:
- case 2:
- {
- sal_Int16 nTmp = 0;
- pValues[nProp] >>= nTmp;
- if ( nProp == 1 )
- meFontWeight = static_cast<FontWeight>(nTmp);
- else if ( nProp == 2 )
- meFontItalic = static_cast<FontItalic>(nTmp);
- }
- break;
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- case 10:
- case 11:
- case 12:
- {
- sal_Unicode cChar = sal_Unicode();
- pValues[nProp] >>= cChar;
- mnLevelChars[nProp-3] = cChar;
- }
- break;
+ OUString aStr;
+ pValues[nProp] >>= aStr;
+ msFontname = aStr;
+ mbUserDefinedFontname = true;
+ }
+ break;
+ case 1:
+ case 2:
+ {
+ sal_Int16 nTmp = 0;
+ pValues[nProp] >>= nTmp;
+ if ( nProp == 1 )
+ meFontWeight = static_cast<FontWeight>(nTmp);
+ else if ( nProp == 2 )
+ meFontItalic = static_cast<FontItalic>(nTmp);
+ }
+ break;
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ {
+ sal_Unicode cChar = sal_Unicode();
+ pValues[nProp] >>= cChar;
+ mnLevelChars[nProp-3] = cChar;
}
+ break;
}
}
}
@@ -1404,23 +1404,23 @@ namespace numfunc
const css::uno::Any* pValues = aValues.getConstArray();
OSL_ENSURE( aValues.getLength() == aPropNames.getLength(),
"<SwNumberingUIBehaviorConfig::LoadConfig()> - GetProperties failed");
- if ( aValues.getLength() == aPropNames.getLength() )
+ if ( aValues.getLength() != aPropNames.getLength() )
+ return;
+
+ for ( int nProp = 0; nProp < aPropNames.getLength(); ++nProp )
{
- for ( int nProp = 0; nProp < aPropNames.getLength(); ++nProp )
+ if ( pValues[nProp].hasValue() )
{
- if ( pValues[nProp].hasValue() )
+ switch ( nProp )
{
- switch ( nProp )
+ case 0:
{
- case 0:
- {
- pValues[nProp] >>= mbChangeIndentOnTabAtFirstPosOfFirstListItem;
- }
- break;
- default:
- {
- OSL_FAIL( "<SwNumberingUIBehaviorConfig::LoadConfig()> - unknown configuration property");
- }
+ pValues[nProp] >>= mbChangeIndentOnTabAtFirstPosOfFirstListItem;
+ }
+ break;
+ default:
+ {
+ OSL_FAIL( "<SwNumberingUIBehaviorConfig::LoadConfig()> - unknown configuration property");
}
}
}