diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-01-02 10:55:27 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-01-05 09:18:19 +0000 |
commit | bacfd2dc4cea1a5d87658ed8592116acd931e000 (patch) | |
tree | d22172a33fdd13a440b6882a28c23ea2d639bbad /sc/source/ui/dbgui/asciiopt.cxx | |
parent | 6281eb0e0792da0194c07da18296e94dd944b8e5 (diff) |
add a comphelper::string::getTokenCount
suitable for conversion from [Byte]String::GetTokenCount
converted low-hanging variants to rtl::O[UString]::getToken loops
added unit test
Diffstat (limited to 'sc/source/ui/dbgui/asciiopt.cxx')
-rw-r--r-- | sc/source/ui/dbgui/asciiopt.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx index 3ad363828c72..60e0db4c185a 100644 --- a/sc/source/ui/dbgui/asciiopt.cxx +++ b/sc/source/ui/dbgui/asciiopt.cxx @@ -34,6 +34,7 @@ #include "impex.hxx" #include "asciiopt.hxx" #include "asciiopt.hrc" +#include <comphelper/string.hxx> #include <rtl/tencinfo.h> #include <unotools/transliterationwrapper.hxx> // ause @@ -198,7 +199,7 @@ sal_Bool ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const void ScAsciiOptions::ReadFromString( const String& rString ) { - xub_StrLen nCount = rString.GetTokenCount(','); + xub_StrLen nCount = comphelper::string::getTokenCount(rString, ','); String aToken; xub_StrLen nSub; xub_StrLen i; @@ -215,7 +216,7 @@ void ScAsciiOptions::ReadFromString( const String& rString ) aToken = rString.GetToken(0,','); if ( aToken.EqualsAscii(pStrFix) ) bFixedLen = sal_True; - nSub = aToken.GetTokenCount('/'); + nSub = comphelper::string::getTokenCount(aToken, '/'); for ( i=0; i<nSub; i++ ) { String aCode = aToken.GetToken( i, '/' ); @@ -271,7 +272,7 @@ void ScAsciiOptions::ReadFromString( const String& rString ) delete[] pColFormat; aToken = rString.GetToken(4,','); - nSub = aToken.GetTokenCount('/'); + nSub = comphelper::string::getTokenCount(aToken, '/'); nInfoCount = nSub / 2; if (nInfoCount) { |