summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2018-09-08 23:26:40 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2018-09-09 21:07:57 +0200
commitda37548dab2eeaae6a105574549c6e504ba49674 (patch)
tree93838e6375b2edba5e616bd1c35444e921873530 /sc
parent67e2acb013ebe0f716ee096f12ec63debcd1d814 (diff)
Avoid getTokenCount()
Change-Id: I783dc5a6b31c3a2be65a1dc50f69f86a29cca0ae
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/app/inputhdl.cxx17
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)