diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-09-09 10:48:28 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-09-09 21:07:59 +0200 |
commit | d1bda6b0b0f2d42a76df822757d21130c401922e (patch) | |
tree | 25a28550ce23657b8c18196061882527af38ecbc /dbaccess | |
parent | 4f90bd648de91cfb803e94148e8ffcbc9502299e (diff) |
Avoid getTokenCount()
Change-Id: I30b9a9122a1e20f50471d1864b8c08af985fc5d7
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 02096f44f68e..fde2fd045af3 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -185,7 +185,7 @@ void OSelectionBrowseBox::initialize() ,IParseContext::InternationalKeyCode::Intersection }; - OUString sGroup = m_aFunctionStrings.getToken(comphelper::string::getTokenCount(m_aFunctionStrings, ';') - 1, ';'); + OUString sGroup = m_aFunctionStrings.copy(m_aFunctionStrings.lastIndexOf(';')+1);; m_aFunctionStrings = m_aFunctionStrings.getToken(0, ';'); for (IParseContext::InternationalKeyCode eFunction : eFunctions) @@ -822,7 +822,7 @@ bool OSelectionBrowseBox::saveField(OUString& _sFieldName ,OTableFieldDescRef co aSelEntry->SetField(sParameters); if ( aSelEntry->IsGroupBy() ) { - sOldLocalizedFunctionName = m_aFunctionStrings.getToken(comphelper::string::getTokenCount(m_aFunctionStrings, ';')-1, ';'); + sOldLocalizedFunctionName = m_aFunctionStrings.copy(m_aFunctionStrings.lastIndexOf(';')+1); aSelEntry->SetGroupBy(false); } @@ -1040,7 +1040,7 @@ bool OSelectionBrowseBox::SaveModified() sal_Int32 nPos = m_pFunctionCell->GetSelectedEntryPos(); // these functions are only available in CORE OUString sFunctionName = m_pFunctionCell->GetEntry(nPos); - OUString sGroupFunctionName = m_aFunctionStrings.getToken(comphelper::string::getTokenCount(m_aFunctionStrings, ';')-1, ';'); + OUString sGroupFunctionName = m_aFunctionStrings.copy(m_aFunctionStrings.lastIndexOf(';')+1); bool bGroupBy = false; if ( sGroupFunctionName == sFunctionName ) // check if the function name is GROUP { @@ -2137,7 +2137,7 @@ OUString OSelectionBrowseBox::GetCellText(long nRow, sal_uInt16 nColId) const case BROW_FUNCTION_ROW: // we always show the group function at first if ( pEntry->IsGroupBy() ) - aText = m_aFunctionStrings.getToken(comphelper::string::getTokenCount(m_aFunctionStrings, ';')-1, ';'); + aText = m_aFunctionStrings.copy(m_aFunctionStrings.lastIndexOf(';')+1); else if ( pEntry->isNumericOrAggreateFunction() ) aText = pEntry->GetFunction(); break; @@ -2273,7 +2273,7 @@ void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, sal_uInt16 nColId, con break; case BROW_FUNCTION_ROW: { - OUString sGroupFunctionName = m_aFunctionStrings.getToken(comphelper::string::getTokenCount(m_aFunctionStrings, ';')-1, ';'); + OUString sGroupFunctionName = m_aFunctionStrings.copy(m_aFunctionStrings.lastIndexOf(';')+1); pEntry->SetFunction(strNewText); // first reset this two member sal_Int32 nFunctionType = pEntry->GetFunctionType(); |