summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2018-09-09 11:29:29 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2018-09-09 21:08:00 +0200
commit0da6e8800b8188caae60707ed2c609d9a17c1dd8 (patch)
tree281d710e39d037f6a1dc23f6df3a11c0d9e9fbd9
parentd1bda6b0b0f2d42a76df822757d21130c401922e (diff)
Avoid getTokenCount()
Change-Id: Ib84104ea0c523729c3a7fe6019ed2e788ff7b189
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index fde2fd045af3..c99cfd24b64d 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -2199,18 +2199,17 @@ bool OSelectionBrowseBox::GetFunctionName(sal_uInt32 _nFunctionTokenId, OUString
break;
default:
{
- sal_Int32 nCount = comphelper::string::getTokenCount(m_aFunctionStrings, ';');
- sal_Int32 i;
- for( i = 0; i < nCount-1; i++ ) // grouping is not counted
+ const sal_Int32 nStopIdx = m_aFunctionStrings.lastIndexOf(';'); // grouping is not counted
+ for (sal_Int32 nIdx {0}; nIdx<nStopIdx;)
{
- if(rFkt.equalsIgnoreAsciiCase(m_aFunctionStrings.getToken(i, ';')))
+ const OUString sFunc {m_aFunctionStrings.getToken(0, ';', nIdx)};
+ if (rFkt.equalsIgnoreAsciiCase(sFunc))
{
- rFkt = m_aFunctionStrings.getToken(i, ';');
- break;
+ rFkt = sFunc;
+ return true;
}
}
- if(i == nCount-1)
- bErg = false;
+ bErg = false;
}
}