From 5b5b58186eb197aac3898580317581dbabd71bdd Mon Sep 17 00:00:00 2001 From: Matteo Casalin Date: Fri, 9 Nov 2018 19:23:16 +0100 Subject: Avoid getTokenCount() Change-Id: Ifc509b3c31f6dbfd4d620aa451fd85b82b0ddb90 --- dbaccess/source/ui/dlg/TextConnectionHelper.cxx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'dbaccess') 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=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; } } -- cgit