Kaydet (Commit) 5f07b58b authored tarafından Matteo Casalin's avatar Matteo Casalin

Avoid getTokenCount

Change-Id: Idf94fa126580623c879023b04a2d9cbe54679b21
üst e7747a33
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <swtypes.hxx> #include <swtypes.hxx>
#include <labelcfg.hxx> #include <labelcfg.hxx>
#include <labimp.hxx> #include <labimp.hxx>
#include <comphelper/string.hxx>
#include <rtl/bootstrap.hxx> #include <rtl/bootstrap.hxx>
#include <unotools/configpaths.hxx> #include <unotools/configpaths.hxx>
#include <xmlreader/xmlreader.hxx> #include <xmlreader/xmlreader.hxx>
...@@ -183,12 +182,13 @@ static std::unique_ptr<SwLabRec> lcl_CreateSwLabRec(const OUString& rType, const ...@@ -183,12 +182,13 @@ static std::unique_ptr<SwLabRec> lcl_CreateSwLabRec(const OUString& rType, const
pNewRec->m_aType = rType; pNewRec->m_aType = rType;
//all values are contained as colon-separated 1/100 mm values //all values are contained as colon-separated 1/100 mm values
//except for the continuous flag ('C'/'S') and nCols, nRows (sal_Int32) //except for the continuous flag ('C'/'S') and nCols, nRows (sal_Int32)
sal_uInt16 nTokenCount = comphelper::string::getTokenCount(rMeasure, ';'); sal_Int32 nTok{0};
for(sal_uInt16 i = 0; i < nTokenCount; i++) 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(); int nVal = sToken.toInt32();
switch(i) switch(nTok++)
{ {
case 0 : pNewRec->m_bCont = sToken[0] == 'C'; break; case 0 : pNewRec->m_bCont = sToken[0] == 'C'; break;
case 1 : pNewRec->m_nHDist = convertMm100ToTwip(nVal); break; case 1 : pNewRec->m_nHDist = convertMm100ToTwip(nVal); break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment