summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2018-09-09 01:44:31 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2018-09-09 21:07:58 +0200
commit82974d069bc35c0eaaae0dd1cbfe2a46bc237552 (patch)
treee83388e0cb3aca4f209a8101afe37acfc8806c62 /editeng
parent3ca649430c832be555b556fd045fa5d490e4da9e (diff)
Avoid getTokenCount()
Change-Id: I6b90d09d37ed47f965110fb93138155a1271c7dc
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/outliner/outliner.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 186a1c17daca..0c97d71bd60a 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -428,12 +428,12 @@ void Outliner::SetText( const OUString& rText, Paragraph* pPara )
if (aText.endsWith("\x0A"))
aText = aText.copy(0, aText.getLength()-1); // Delete the last break
- sal_Int32 nCount = comphelper::string::getTokenCount(aText, '\x0A');
sal_Int32 nPos = 0;
sal_Int32 nInsPos = nPara+1;
- while( nCount > nPos )
+ sal_Int32 nIdx {aText.isEmpty() ? -1 : 0};
+ while( nIdx>=0 )
{
- OUString aStr = aText.getToken( nPos, '\x0A' );
+ OUString aStr = aText.getToken( 0, '\x0A', nIdx );
sal_Int16 nCurDepth;
if( nPos )