diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-11-28 00:39:06 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-11-29 10:36:45 +0100 |
commit | 0c39edebc76b81d5277089e23c5a9ae9e522b4e3 (patch) | |
tree | e98464decbd9fce056d2096144d9cfe1116081f3 /sw/source/core | |
parent | c022f8f2cbe95a7fc5f8ea0b3e0dce42e87db947 (diff) |
clean up and reduce indent levels
Change-Id: I85fe89e9ef9a6afe79e7e31a3d3d9be85936394d
Diffstat (limited to 'sw/source/core')
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 81697c27b66a..f92e9c00e22b 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -427,29 +427,25 @@ sal_Int32 lcl_GetCountOrName2<SFX_STYLE_FAMILY_PAGE>(const SwDoc &rDoc, OUString } template<> -sal_Int32 lcl_GetCountOrName2<SFX_STYLE_FAMILY_PSEUDO>(const SwDoc &rDoc, OUString *pString, sal_Int32 nIndex) +sal_Int32 lcl_GetCountOrName2<SFX_STYLE_FAMILY_PSEUDO>(const SwDoc &rDoc, OUString* pString, sal_Int32 nIndex) { + constexpr sal_Int32 nBaseCount = RES_POOLNUMRULE_END - RES_POOLNUMRULE_BEGIN; + nIndex -= nBaseCount; sal_Int32 nCount = 0; - const sal_Int32 nBaseCount = RES_POOLNUMRULE_END - RES_POOLNUMRULE_BEGIN; - nIndex = nIndex - nBaseCount; - const SwNumRuleTable& rNumTable = rDoc.GetNumRuleTable(); - for(size_t i = 0; i < rNumTable.size(); ++i) + for(const auto pRule : rDoc.GetNumRuleTable()) { - const SwNumRule& rRule = *rNumTable[ i ]; - if( rRule.IsAutoRule() ) + if(pRule->IsAutoRule()) continue; - if ( IsPoolUserFormat ( rRule.GetPoolFormatId() ) ) + if(!IsPoolUserFormat(pRule->GetPoolFormatId())) + continue; + if(nIndex == nCount) { - if ( nIndex == nCount ) - { - *pString = rRule.GetName(); - break; - } - nCount++; + *pString = pRule->GetName(); + break; } + ++nCount; } - nCount += nBaseCount; - return nCount; + return nCount + nBaseCount; } static sal_Int32 lcl_GetCountOrName(const SwDoc &rDoc, |