diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2019-02-01 07:53:12 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2019-02-04 23:06:03 +0100 |
commit | a225305b55e82ac217a25c47d59691d0f2842dd2 (patch) | |
tree | 9663ce1cf062c6f943db1b6e774c124fc020eccb | |
parent | 4b0517c57240d606a9011bf2a0b3fec4669777d2 (diff) |
Use indexed getToken()
Change-Id: I1786e75ff12f16450f62f5091981a26c89af2514
Reviewed-on: https://gerrit.libreoffice.org/67329
Tested-by: Jenkins
Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
-rw-r--r-- | sw/source/core/tox/tox.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx index 6a5cebb92bf0..3a3860fb2e53 100644 --- a/sw/source/core/tox/tox.cxx +++ b/sw/source/core/tox/tox.cxx @@ -840,8 +840,9 @@ lcl_BuildToken(const OUString & sPattern, sal_Int32 & nCurPatternPos) const OUString sAuthFieldEnum = sToken.copy( 2, 2 ); sToken = sToken.copy( nTokenLen, sToken.getLength() - nTokenLen - 1); - eRet.sCharStyleName = sToken.getToken( 0, ','); - OUString sTmp( sToken.getToken( 1, ',' )); + sal_Int32 nIdx{ 0 }; + eRet.sCharStyleName = sToken.getToken( 0, ',', nIdx ); + OUString sTmp( sToken.getToken( 0, ',', nIdx )); if( !sTmp.isEmpty() ) eRet.nPoolId = static_cast<sal_uInt16>(sTmp.toInt32()); @@ -851,10 +852,10 @@ lcl_BuildToken(const OUString & sPattern, sal_Int32 & nCurPatternPos) case TOKEN_CHAPTER_INFO: //i53420 case TOKEN_ENTRY_NO: - sTmp = sToken.getToken( 2, ',' ); + sTmp = sToken.getToken( 0, ',', nIdx ); // token 2 if( !sTmp.isEmpty() ) eRet.nChapterFormat = static_cast<sal_uInt16>(sTmp.toInt32()); - sTmp = sToken.getToken( 3, ',' ); + sTmp = sToken.getToken( 0, ',', nIdx ); // token 3 if( !sTmp.isEmpty() ) eRet.nOutlineLevel = static_cast<sal_uInt16>(sTmp.toInt32()); //the maximum outline level to examine break; @@ -876,19 +877,19 @@ lcl_BuildToken(const OUString & sPattern, sal_Int32 & nCurPatternPos) break; case TOKEN_TAB_STOP: - sTmp = sToken.getToken( 2, ',' ); + sTmp = sToken.getToken( 0, ',', nIdx ); // token 2 if( !sTmp.isEmpty() ) eRet.nTabStopPosition = sTmp.toInt32(); - sTmp = sToken.getToken( 3, ',' ); + sTmp = sToken.getToken( 0, ',', nIdx ); // token 3 if( !sTmp.isEmpty() ) eRet.eTabAlign = static_cast<SvxTabAdjust>(sTmp.toInt32()); - sTmp = sToken.getToken( 4, ',' ); + sTmp = sToken.getToken( 0, ',', nIdx ); // token 4 if( !sTmp.isEmpty() ) eRet.cTabFillChar = sTmp[0]; - sTmp = sToken.getToken( 5, ',' ); + sTmp = sToken.getToken( 0, ',', nIdx ); // token 5 if( !sTmp.isEmpty() ) eRet.bWithTab = 0 != sTmp.toInt32(); break; |