diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-11-09 19:23:16 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-11-10 22:04:07 +0100 |
commit | 5b5b58186eb197aac3898580317581dbabd71bdd (patch) | |
tree | eb58a58ebd1bf1b48bddc30e8ed4526741520796 /dbaccess | |
parent | 71ef91f00d621b5ddc76d6611eb91bb8b0c26c97 (diff) |
Avoid getTokenCount()
Change-Id: Ifc509b3c31f6dbfd4d620aa451fd85b82b0ddb90
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/dlg/TextConnectionHelper.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx index f57b34d352b6..55c8e227eebb 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx @@ -389,18 +389,14 @@ namespace dbaui void OTextConnectionHelper::SetSeparator( weld::ComboBox& rBox, const OUString& rList, const OUString& rVal ) { - char nTok = '\t'; - sal_Int32 nCnt = comphelper::string::getTokenCount(rList, nTok); - sal_Int32 i; - - for( i=0 ; i<nCnt ; i+=2 ) + for(sal_Int32 nIdx {0}; nIdx>=0;) { - OUString sTVal( - static_cast< sal_Unicode >( rList.getToken( (i+1), nTok ).toInt32() )); + sal_Int32 nPrevIdx {nIdx}; + OUString sTVal {static_cast< sal_Unicode >( rList.getToken(1, '\t', nIdx).toInt32() )}; if( sTVal == rVal ) { - rBox.set_entry_text(rList.getToken(i, nTok)); + rBox.set_entry_text(rList.getToken(0, '\t', nPrevIdx)); return; } } |