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>
static sal_Int32 lcl_GetCountOrName2(const SwDoc &rDoc, OUString *pString, sal_Int32 nIndex);
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;
const sal_Int32 nBaseCount =
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 )
for(auto pFormat : *rDoc.GetCharFormats())
{
SwCharFormat* pFormat = (*rDoc.GetCharFormats())[ i ];
if( pFormat->IsDefault() && pFormat != rDoc.GetDfltCharFormat() )
if(pFormat->IsDefault() && pFormat != rDoc.GetDfltCharFormat())
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)
SwStyleNameMapper::FillUIName(
RES_POOLCOLL_STANDARD, *pString );
else
*pString = pFormat->GetName();
break;
}
nCount++;
// the default character format needs to be set to "Default!"
if(rDoc.GetDfltCharFormat() == pFormat)
SwStyleNameMapper::FillUIName(RES_POOLCOLL_STANDARD, *pString);
else
*pString = pFormat->GetName();
break;
}
++nCount;
}
nCount += nBaseCount;
return nCount;
return nCount + nBaseCount;
}
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