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

Use getTokenCount and indexed getToken

Change-Id: Id57a1771c897c69b05d02a359f22e5fb2b1f5a31
Reviewed-on: https://gerrit.libreoffice.org/69239
Tested-by: Jenkins
Reviewed-by: 's avatarMatteo Casalin <matteo.casalin@yahoo.com>
üst 86015855
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <comphelper/basicio.hxx> #include <comphelper/basicio.hxx>
#include <comphelper/property.hxx> #include <comphelper/property.hxx>
#include <comphelper/sequence.hxx> #include <comphelper/sequence.hxx>
#include <comphelper/string.hxx>
#include <comphelper/types.hxx> #include <comphelper/types.hxx>
#include <connectivity/dbtools.hxx> #include <connectivity/dbtools.hxx>
#include <connectivity/formattedcolumnvalue.hxx> #include <connectivity/formattedcolumnvalue.hxx>
...@@ -637,19 +638,12 @@ namespace frm ...@@ -637,19 +638,12 @@ namespace frm
OUString sListSource; OUString sListSource;
_rxInStream >> sListSource; _rxInStream >> sListSource;
sal_Int32 nTokens = 1; const sal_Int32 nTokens{ comphelper::string::getTokenCount(sListSource, ';') };
const sal_Unicode* pStr = sListSource.getStr();
while ( *pStr )
{
if ( *pStr == ';' )
nTokens++;
pStr++;
}
aListSourceSeq.realloc( nTokens ); aListSourceSeq.realloc( nTokens );
sal_Int32 nIdx{ 0 };
for (sal_Int32 i=0; i<nTokens; ++i) for (sal_Int32 i=0; i<nTokens; ++i)
{ {
sal_Int32 nTmp = 0; aListSourceSeq.getArray()[i] = sListSource.getToken(0, ';', nIdx);
aListSourceSeq.getArray()[i] = sListSource.getToken(i,';',nTmp);
} }
} }
else else
......
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