sw/source/core/edit/autofmt.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit cf1eeee2c44302d522fcf3fdd2180dfbb63e7591
Author:     Justin Luth <jl...@mail.com>
AuthorDate: Wed Feb 8 13:48:04 2023 -0500
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Thu Feb 9 06:11:33 2023 +0000

    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 <jl...@mail.com>
    (cherry picked from commit 6bc6da1d03327450571b6811e192787ad90ecea2)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146628
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

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() )

Reply via email to