diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-09-08 23:26:40 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-09-09 21:07:57 +0200 |
commit | da37548dab2eeaae6a105574549c6e504ba49674 (patch) | |
tree | 93838e6375b2edba5e616bd1c35444e921873530 /sc | |
parent | 67e2acb013ebe0f716ee096f12ec63debcd1d814 (diff) |
Avoid getTokenCount()
Change-Id: I783dc5a6b31c3a2be65a1dc50f69f86a29cca0ae
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 9351055540bb..2d56ce5f075a 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -52,7 +52,6 @@ #include <vcl/cursor.hxx> #include <vcl/settings.hxx> #include <tools/urlobj.hxx> -#include <comphelper/string.hxx> #include <formula/formulahelper.hxx> #include <formula/funcvarargs.h> #include <LibreOfficeKit/LibreOfficeKitEnums.h> @@ -875,6 +874,16 @@ void ScInputHandler::HideTipBelow() aManualTip.clear(); } +namespace +{ + +bool lcl_hasSingleToken(const OUString& s, sal_Unicode c) +{ + return !s.isEmpty() && s.indexOf(c)<0; +} + +} + void ScInputHandler::ShowArgumentsTip( OUString& rSelText ) { ScDocShell* pDocSh = pActiveViewSh->GetViewData().GetDocShell(); @@ -917,12 +926,10 @@ void ScInputHandler::ShowArgumentsTip( OUString& rSelText ) } if( bFlag ) { - sal_Int32 nCountSemicolon = comphelper::string::getTokenCount(aNew, cSep) - 1; - sal_Int32 nCountDot = comphelper::string::getTokenCount(aNew, cSheetSep) - 1; sal_Int32 nStartPosition = 0; sal_Int32 nEndPosition = 0; - if( !nCountSemicolon ) + if( lcl_hasSingleToken(aNew, cSep) ) { for (sal_Int32 i = 0; i < aNew.getLength(); ++i) { @@ -933,7 +940,7 @@ void ScInputHandler::ShowArgumentsTip( OUString& rSelText ) } } } - else if( !nCountDot ) + else if( lcl_hasSingleToken(aNew, cSheetSep) ) { sal_uInt16 nCount = 0; for (sal_Int32 i = 0; i < aNew.getLength(); ++i) |