Kaydet (Commit) 6e1bd43a authored tarafından Matteo Casalin's avatar Matteo Casalin

Use indexed getToken()

Change-Id: I1fa06283b3c1857c81ec320b98db857a42e91bca
Reviewed-on: https://gerrit.libreoffice.org/67333
Tested-by: Jenkins
Reviewed-by: 's avatarMatteo Casalin <matteo.casalin@yahoo.com>
üst 15b0bc23
...@@ -1619,12 +1619,13 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) ...@@ -1619,12 +1619,13 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
{ {
SwCharFormat* pCFormat = m_pDoc->getIDocumentStylePoolAccess().GetCharFormatFromPool( SwCharFormat* pCFormat = m_pDoc->getIDocumentStylePoolAccess().GetCharFormatFromPool(
RES_POOLCHR_NUM_LEVEL ); RES_POOLCHR_NUM_LEVEL );
sal_Int32 nPrefixIdx{ 0 };
if( !nDigitLevel ) if( !nDigitLevel )
{ {
SwNumFormat aFormat( aRule.Get( nLvl ) ); SwNumFormat aFormat( aRule.Get( nLvl ) );
aFormat.SetStart( static_cast<sal_uInt16>(aPrefix.getToken( 1, aFormat.SetPrefix( aPrefix.getToken( 0, u'\x0001', nPrefixIdx ));
u'\x0001' ).toInt32())); aFormat.SetStart( static_cast<sal_uInt16>(aPrefix.getToken( 0, u'\x0001', nPrefixIdx ).toInt32()));
aFormat.SetPrefix( aPrefix.getToken( 0, u'\x0001' ));
aFormat.SetSuffix( aPostfix.getToken( 0, u'\x0001' )); aFormat.SetSuffix( aPostfix.getToken( 0, u'\x0001' ));
aFormat.SetIncludeUpperLevels( 0 ); aFormat.SetIncludeUpperLevels( 0 );
...@@ -1642,15 +1643,15 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) ...@@ -1642,15 +1643,15 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
{ {
auto const nSpaceSteps = nLvl ? nLeftTextPos / nLvl : 0; auto const nSpaceSteps = nLvl ? nLeftTextPos / nLvl : 0;
sal_uInt16 n; sal_uInt16 n;
sal_Int32 nPostfixIdx{ 0 };
for( n = 0; n <= nLvl; ++n ) for( n = 0; n <= nLvl; ++n )
{ {
SwNumFormat aFormat( aRule.Get( n ) ); SwNumFormat aFormat( aRule.Get( n ) );
aFormat.SetStart( static_cast<sal_uInt16>(aPrefix.getToken( n+1,
u'\x0001' ).toInt32() ));
if( !n ) if( !n )
aFormat.SetPrefix( aPrefix.getToken( n, u'\x0001' )); aFormat.SetPrefix( aPrefix.getToken( 0, u'\x0001', nPrefixIdx )); // token 0, read only on first loop
aFormat.SetSuffix( aPostfix.getToken( n, u'\x0001' )); aFormat.SetStart( static_cast<sal_uInt16>(aPrefix.getToken( 0, u'\x0001', nPrefixIdx ).toInt32() ));
aFormat.SetSuffix( aPostfix.getToken( 0, u'\x0001', nPostfixIdx ));
aFormat.SetIncludeUpperLevels( MAXLEVEL ); aFormat.SetIncludeUpperLevels( MAXLEVEL );
if( n < aNumTypes.getLength() ) if( n < aNumTypes.getLength() )
aFormat.SetNumberingType(static_cast<SvxNumType>(aNumTypes[ n ] - '0')); aFormat.SetNumberingType(static_cast<SvxNumType>(aNumTypes[ n ] - '0'));
......
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