Kaydet (Commit) 071148be authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

clean up and reduce indent levels

Change-Id: I291d5500b2bda1a9986a72cba8513a2897233689
üst 452ae1ad
...@@ -324,36 +324,31 @@ template<enum SfxStyleFamily> ...@@ -324,36 +324,31 @@ template<enum SfxStyleFamily>
static sal_Int32 lcl_GetCountOrName2(const SwDoc &rDoc, OUString *pString, sal_Int32 nIndex); static sal_Int32 lcl_GetCountOrName2(const SwDoc &rDoc, OUString *pString, sal_Int32 nIndex);
template<> template<>
sal_Int32 lcl_GetCountOrName2<SFX_STYLE_FAMILY_CHAR>(const SwDoc &rDoc, OUString *pString, sal_Int32 nIndex) sal_Int32 lcl_GetCountOrName2<SFX_STYLE_FAMILY_CHAR>(const SwDoc &rDoc, OUString* pString, sal_Int32 nIndex)
{ {
constexpr sal_Int32 nBaseCount =
RES_POOLCHR_HTML_END - RES_POOLCHR_HTML_BEGIN +
RES_POOLCHR_NORMAL_END - RES_POOLCHR_NORMAL_BEGIN;
nIndex -= nBaseCount;
sal_Int32 nCount = 0; sal_Int32 nCount = 0;
const sal_Int32 nBaseCount = for(auto pFormat : *rDoc.GetCharFormats())
RES_POOLCHR_HTML_END - RES_POOLCHR_HTML_BEGIN +
RES_POOLCHR_NORMAL_END - RES_POOLCHR_NORMAL_BEGIN;
nIndex = nIndex - nBaseCount;
const size_t nArrLen = rDoc.GetCharFormats()->size();
for( size_t i = 0; i < nArrLen; ++i )
{ {
SwCharFormat* pFormat = (*rDoc.GetCharFormats())[ i ]; if(pFormat->IsDefault() && pFormat != rDoc.GetDfltCharFormat())
if( pFormat->IsDefault() && pFormat != rDoc.GetDfltCharFormat() )
continue; continue;
if ( IsPoolUserFormat ( pFormat->GetPoolFormatId() ) ) if(!IsPoolUserFormat(pFormat->GetPoolFormatId()))
continue;
if(nIndex == nCount)
{ {
if ( nIndex == nCount ) // the default character format needs to be set to "Default!"
{ if(rDoc.GetDfltCharFormat() == pFormat)
// the default character format needs to be set to "Default!" SwStyleNameMapper::FillUIName(RES_POOLCOLL_STANDARD, *pString);
if(rDoc.GetDfltCharFormat() == pFormat) else
SwStyleNameMapper::FillUIName( *pString = pFormat->GetName();
RES_POOLCOLL_STANDARD, *pString ); break;
else
*pString = pFormat->GetName();
break;
}
nCount++;
} }
++nCount;
} }
nCount += nBaseCount; return nCount + nBaseCount;
return nCount;
} }
template<> template<>
......
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