diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-04-29 22:24:45 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-04-29 22:50:54 +0200 |
commit | 5f07b58b0904f2d00ea4c1b49296ec0abfbe397c (patch) | |
tree | afb87896c43833c0d0c7b0bdfb3732a358584522 /sw | |
parent | e7747a338bb3951448a0be2cda1e9ae5eb6cc117 (diff) |
Avoid getTokenCount
Change-Id: Idf94fa126580623c879023b04a2d9cbe54679b21
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/envelp/labelcfg.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sw/source/uibase/envelp/labelcfg.cxx b/sw/source/uibase/envelp/labelcfg.cxx index 808b250a3470..6c6ec6127efc 100644 --- a/sw/source/uibase/envelp/labelcfg.cxx +++ b/sw/source/uibase/envelp/labelcfg.cxx @@ -23,7 +23,6 @@ #include <swtypes.hxx> #include <labelcfg.hxx> #include <labimp.hxx> -#include <comphelper/string.hxx> #include <rtl/bootstrap.hxx> #include <unotools/configpaths.hxx> #include <xmlreader/xmlreader.hxx> @@ -183,12 +182,13 @@ static std::unique_ptr<SwLabRec> lcl_CreateSwLabRec(const OUString& rType, const pNewRec->m_aType = rType; //all values are contained as colon-separated 1/100 mm values //except for the continuous flag ('C'/'S') and nCols, nRows (sal_Int32) - sal_uInt16 nTokenCount = comphelper::string::getTokenCount(rMeasure, ';'); - for(sal_uInt16 i = 0; i < nTokenCount; i++) + sal_Int32 nTok{0}; + sal_Int32 nIdx{rMeasure.isEmpty() ? -1 : 0}; + while (nIdx>=0) { - OUString sToken(rMeasure.getToken(i, ';' )); + const OUString sToken(rMeasure.getToken(0, ';', nIdx)); int nVal = sToken.toInt32(); - switch(i) + switch(nTok++) { case 0 : pNewRec->m_bCont = sToken[0] == 'C'; break; case 1 : pNewRec->m_nHDist = convertMm100ToTwip(nVal); break; |