summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2018-11-09 20:29:42 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2018-11-10 22:04:09 +0100
commita8f78db2d8114f80b9a4b6614a7f466b66b62dd8 (patch)
tree2b06e53f6861d6b9a7b9f9fb6b01c27865fa3eae /dbaccess
parent3e10b9b8dfafdc80f1b77769a18dea8dbf1af0eb (diff)
Use indexed getToken
Change-Id: I336924c43b6680c3742ca8c83801cbff3f346968
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index e62fdceaa065..06e82ae4ec4e 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -2599,18 +2599,19 @@ void OSelectionBrowseBox::setFunctionCell(OTableFieldDescRef const & _pEntry)
// Aggregate functions in general only available with Core SQL
if ( lcl_SupportsCoreSQLGrammar(xConnection) )
{
+ sal_Int32 nIdx {0};
// if we have an asterisk, no other function than count is allowed
m_pFunctionCell->Clear();
- m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(0, ';'));
+ m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(0, ';', nIdx));
if ( isFieldNameAsterisk(_pEntry->GetField()) )
- m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(2, ';')); // 2 -> COUNT
+ 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 nIdx = 1; nIdx < nCount; nIdx++ )
- m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(nIdx, ';'));
+ for( sal_Int32 nTok = 1; nTok < nCount; ++nTok )
+ m_pFunctionCell->InsertEntry(m_aFunctionStrings.getToken(0, ';', nIdx));
}
if ( _pEntry->IsGroupBy() )