diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-09-02 15:38:50 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-09-09 21:07:56 +0200 |
commit | 41bcf6138c88ed413d557419b73d29a8526e5fb3 (patch) | |
tree | 538beb1583d55c940e14d3cc4efb7ecb959f8d64 /sc | |
parent | 559449ba62565966aa4a42a822a70b07e6c98079 (diff) |
Avoid getTokenCount()
Change-Id: I3d9a1c4a6c57fca1179a08494b6d298d4aeffb05
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/dbgui/csvgrid.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx index 32ac2515f7de..f5b63fd3a48f 100644 --- a/sc/source/ui/dbgui/csvgrid.cxx +++ b/sc/source/ui/dbgui/csvgrid.cxx @@ -22,7 +22,6 @@ #include <algorithm> #include <memory> -#include <comphelper/string.hxx> #include <svtools/colorcfg.hxx> #include <sal/macros.h> #include <tools/poly.hxx> @@ -1084,12 +1083,11 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, const OUString& rText ) /* #i60296# If string contains mixed script types, the space character U+0020 may be drawn with a wrong width (from non-fixed-width Asian or Complex font). Now we draw every non-space portion separately. */ - sal_Int32 nTokenCount = comphelper::string::getTokenCount(aPlainText, ' '); - sal_Int32 nCharIxInt = 0; - for( sal_Int32 nToken = 0; nToken < nTokenCount; ++nToken ) + sal_Int32 nCharIxInt {aPlainText.isEmpty() ? -1 : 0}; + while (nCharIxInt>=0) { sal_Int32 nBeginIx = nCharIxInt; - OUString aToken = aPlainText.getToken( 0, ' ', nCharIxInt ); + const OUString aToken = aPlainText.getToken( 0, ' ', nCharIxInt ); if( !aToken.isEmpty() ) { sal_Int32 nX = rPos.X() + GetCharWidth() * nBeginIx; |