summaryrefslogtreecommitdiff
path: root/sw/source/core/edit
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2023-02-08 13:48:04 -0500
committerJustin Luth <jluth@mail.com>2023-02-08 21:39:36 +0000
commit6bc6da1d03327450571b6811e192787ad90ecea2 (patch)
treea4acd028bf6ed7d223fd51778ad868169753be91 /sw/source/core/edit
parenta82c783a28b147963486c492184768be6be37da0 (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>
Diffstat (limited to 'sw/source/core/edit')
-rw-r--r--sw/source/core/edit/autofmt.cxx5
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() )