diff options
author | Justin Luth <jluth@mail.com> | 2023-02-08 13:48:04 -0500 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2023-02-09 06:11:33 +0000 |
commit | cf1eeee2c44302d522fcf3fdd2180dfbb63e7591 (patch) | |
tree | b3987918a1ccc43eeebeb196bd46116bc189068e | |
parent | 708252dc7e68a014a5d7b730688d0cab4a85df61 (diff) |
tdf#153423 tdf#150197: use getToken in proper order
This fixes a LO 7.5 regression from my commit
727c5ed30f68abc28bb04531b25a1df30810760f
getToken steps along the string and consumes it,
so these needed to remain in the same order as
they had been originally. Dumb thing to overlook.
Change-Id: I483980eafb7deb0c224063ad41616bb21ddb2191
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146672
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
(cherry picked from commit 6bc6da1d03327450571b6811e192787ad90ecea2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146628
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r-- | sw/source/core/edit/autofmt.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 4be8c9711188..a4c6e02dbc30 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -1616,8 +1616,9 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) if( !nDigitLevel ) { SwNumFormat aFormat( aRule.Get( nLvl ) ); + const OUString sPrefix = aPrefix.getToken(0, u'\x0001', nPrefixIdx); aFormat.SetStart( o3tl::narrowing<sal_uInt16>(o3tl::toInt32(o3tl::getToken(aPrefix, 0, u'\x0001', nPrefixIdx )))); - aFormat.SetListFormat(aPrefix.getToken(0, u'\x0001', nPrefixIdx), aPostfix.getToken(0, u'\x0001'), nLvl); + aFormat.SetListFormat(sPrefix, aPostfix.getToken(0, u'\x0001'), nLvl); aFormat.SetIncludeUpperLevels( 0 ); if( !aFormat.GetCharFormat() ) @@ -1639,8 +1640,8 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) { SwNumFormat aFormat( aRule.Get( n ) ); - aFormat.SetStart( o3tl::narrowing<sal_uInt16>(o3tl::toInt32(o3tl::getToken(aPrefix, 0, u'\x0001', nPrefixIdx )) )); const OUString sPrefix = n ? "" : aPrefix.getToken(0, u'\x0001', nPrefixIdx); + aFormat.SetStart( o3tl::narrowing<sal_uInt16>(o3tl::toInt32(o3tl::getToken(aPrefix, 0, u'\x0001', nPrefixIdx )) )); aFormat.SetListFormat(sPrefix, aPostfix.getToken(0, u'\x0001', nPostfixIdx), n); aFormat.SetIncludeUpperLevels( MAXLEVEL ); if( n < aNumTypes.getLength() ) |