diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-09-13 10:52:11 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-09-13 11:05:28 +0200 |
commit | 865c9fbbfd683dc212e94513ffe3e3b86d231828 (patch) | |
tree | 15dabcf3a8c1a9127115e1a399e2017650eccb2b | |
parent | a37535e3ff7be959d9a3aab3399ffbcc89688662 (diff) |
Avoid getTokenCount in ScRangeList::Parse
Change-Id: I2c9628e5064ea03c878d6e45118755596a060d5a
-rw-r--r-- | sc/source/core/tool/rangelst.cxx | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx index 9243a34efe0a..5a0882ebeab6 100644 --- a/sc/source/core/tool/rangelst.cxx +++ b/sc/source/core/tool/rangelst.cxx @@ -18,7 +18,6 @@ */ #include <stdlib.h> -#include <comphelper/string.hxx> #include <unotools/collatorwrapper.hxx> #include <osl/diagnose.h> @@ -170,18 +169,12 @@ sal_uInt16 ScRangeList::Parse( const OUString& rStr, ScDocument* pDoc, sal_uInt1 nMask |= SCA_VALID; // falls das jemand vergessen sollte sal_uInt16 nResult = (sal_uInt16)~0; // alle Bits setzen ScRange aRange; - OUString aOne; - SCTAB nTab = 0; - if ( pDoc ) - { - nTab = nDefaultTab; - } - else - nTab = 0; - sal_uInt16 nTCount = comphelper::string::getTokenCount(rStr, cDelimiter); - for ( sal_uInt16 i=0; i<nTCount; i++ ) + const SCTAB nTab = pDoc ? nDefaultTab : 0; + + sal_Int32 nPos = 0; + do { - aOne = rStr.getToken( i, cDelimiter ); + const OUString aOne = rStr.getToken( 0, cDelimiter, nPos ); aRange.aStart.SetTab( nTab ); // Default Tab wenn nicht angegeben sal_uInt16 nRes = aRange.ParseAny( aOne, pDoc, eConv ); sal_uInt16 nEndRangeBits = SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2; @@ -197,6 +190,8 @@ sal_uInt16 ScRangeList::Parse( const OUString& rStr, ScDocument* pDoc, sal_uInt1 Append( aRange ); nResult &= nRes; // alle gemeinsamen Bits bleiben erhalten } + while (nPos >= 0); + return nResult; // SCA_VALID gesetzt wenn alle ok } else |