summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2018-08-12 22:14:26 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2018-09-09 21:07:51 +0200
commitcfabcee0a7765534b419451ec812838ac6a2a50d (patch)
tree0b84c4dc1a9ff68083ff7648e43429153b8fc3fc /sc
parenta9bcbd3dad16c69f1e7ebb52a30611150a49f298 (diff)
Avoid getTokenCount
Change-Id: I261311443edcf943d6f2849acc3042089080dee6
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/html/htmlimp.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sc/source/filter/html/htmlimp.cxx b/sc/source/filter/html/htmlimp.cxx
index 4957b2d381ad..ba4fc94344b7 100644
--- a/sc/source/filter/html/htmlimp.cxx
+++ b/sc/source/filter/html/htmlimp.cxx
@@ -201,12 +201,14 @@ OUString ScHTMLImport::GetHTMLRangeNameList( const ScDocument* pDoc, const OUStr
{
OSL_ENSURE( pDoc, "ScHTMLImport::GetHTMLRangeNameList - missing document" );
+ if (rOrigName.isEmpty())
+ return OUString();
+
OUString aNewName;
ScRangeName* pRangeNames = pDoc->GetRangeName();
ScRangeList aRangeList;
- sal_Int32 nTokenCnt = comphelper::string::getTokenCount(rOrigName, ';');
sal_Int32 nStringIx = 0;
- for( sal_Int32 nToken = 0; nToken < nTokenCnt; nToken++ )
+ do
{
OUString aToken( rOrigName.getToken( 0, ';', nStringIx ) );
if( pRangeNames && ScfTools::IsHTMLTablesName( aToken ) )
@@ -233,6 +235,7 @@ OUString ScHTMLImport::GetHTMLRangeNameList( const ScDocument* pDoc, const OUStr
else
aNewName = ScGlobal::addToken(aNewName, aToken, ';');
}
+ while (nStringIx>0);
return aNewName;
}