diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-11-09 20:32:23 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-11-10 22:04:10 +0100 |
commit | 4ede22cf97879e71a6df0eeaea128752844835e0 (patch) | |
tree | f9b90459a81adbfe27da774b0deae745d18d3a3d /dbaccess | |
parent | a8f78db2d8114f80b9a4b6614a7f466b66b62dd8 (diff) |
Avoid getTokenCount
Change-Id: If4dcd0a3f316bd9812ffb12b8e64489d25ce89ca
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 06e82ae4ec4e..8d2fa256bbb1 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -2607,11 +2607,14 @@ void OSelectionBrowseBox::setFunctionCell(OTableFieldDescRef const & _pEntry) m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(1, ';', nIdx)); // 2nd token: COUNT else { - sal_Int32 nCount = comphelper::string::getTokenCount(m_aFunctionStrings, ';'); - if ( _pEntry->isNumeric() ) - --nCount; - for( sal_Int32 nTok = 1; nTok < nCount; ++nTok ) - m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(0, ';', nIdx)); + const bool bSkipLastToken {_pEntry->isNumeric()}; + while (nIdx>0) + { + const OUString sTok {m_aFunctionStrings.getToken(0, ';', nIdx)}; + if (bSkipLastToken && nIdx<0) + break; + m_pFunctionCell->InsertEntry(sTok); + } } if ( _pEntry->IsGroupBy() ) |