diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-09-09 20:01:03 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-09-09 21:08:02 +0200 |
commit | a6589756916ae0e5f85c8320f602fa07b7291e73 (patch) | |
tree | ba76cbc897fb6caa5eba8dcf90203f39fcd3dd6c | |
parent | a928e673c4b7cd40d6c903013517325249938a6e (diff) |
Avoid getTokenCount()
Change-Id: I82fa0cca6cd14f92c11678fa7d416fcf629195b8
-rw-r--r-- | sc/source/ui/dbgui/scuiasciiopt.cxx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx index 57a888543cf2..fe4ae899fc47 100644 --- a/sc/source/ui/dbgui/scuiasciiopt.cxx +++ b/sc/source/ui/dbgui/scuiasciiopt.cxx @@ -34,7 +34,6 @@ #include <strings.hrc> #include <strings.hxx> #include <csvtablebox.hxx> -#include <comphelper/string.hxx> #include <osl/thread.h> #include <rtl/tencinfo.h> #include <unotools/transliterationwrapper.hxx> @@ -122,13 +121,19 @@ static sal_Unicode lcl_CharFromCombo( const ComboBox& rCombo, const OUString& rL { sal_Unicode c = 0; OUString aStr = rCombo.GetText(); - if ( !aStr.isEmpty() ) + if ( !aStr.isEmpty() && !rList.isEmpty() ) { - sal_Int32 nCount = comphelper::string::getTokenCount(rList, '\t'); - for ( sal_Int32 i=0; i<nCount; i+=2 ) + sal_Int32 nIdx {0}; + OUString sToken {rList.getToken(0, '\t', nIdx)}; + while (nIdx>0) { - if ( ScGlobal::GetpTransliteration()->isEqual( aStr, rList.getToken(i,'\t') ) ) - c = static_cast<sal_Unicode>(rList.getToken(i+1,'\t').toInt32()); + if ( ScGlobal::GetpTransliteration()->isEqual( aStr, sToken ) ) + { + sal_Int32 nTmpIdx {nIdx}; + c = static_cast<sal_Unicode>(rList.getToken(0, '\t', nTmpIdx).toInt32()); + } + // Skip to next token at even position + sToken = rList.getToken(1, '\t', nIdx); } if (!c) { |