summaryrefslogtreecommitdiffstats
path: root/cui
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2015-09-12 14:13:50 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2015-09-12 14:18:53 +0200
commit3342993a437df435f4640468fd650dfb45d43045 (patch)
tree502669baec196ef45c0c611cf7295e1017dfb37f /cui
parentFix regression from ea2c80bdcd862f91dd7429184aea29d9a77f9774 (diff)
downloadcore-3342993a437df435f4640468fd650dfb45d43045.tar.gz
core-3342993a437df435f4640468fd650dfb45d43045.zip
Avoid getTokenCount in favor of getToken
Order of token extraction is inverted, but since elements are inserted in a set their final order won't be affected. Change-Id: I7f22a518e3d6a9a53951aa89159a36b398af5f46
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/plfilter.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/cui/source/dialogs/plfilter.cxx b/cui/source/dialogs/plfilter.cxx
index 67e35e638d48..cdb606f0d67d 100644
--- a/cui/source/dialogs/plfilter.cxx
+++ b/cui/source/dialogs/plfilter.cxx
@@ -20,7 +20,6 @@
#include <set>
#include <map>
#include <comphelper/processfactory.hxx>
-#include <comphelper/string.hxx>
#include <vcl/stdtext.hxx>
@@ -64,16 +63,22 @@ void fillNetscapePluginFilters( Sequence< OUString >& rPluginNames, Sequence< OU
{
const PluginDescription & rDescr = pDescriptions[nPos];
+ // consistency check for the do {} while loop below
+ if (rDescr.Extension.isEmpty())
+ continue;
+
StrSet& rTypes = aMap[ rDescr.Description ];
OUString aExtension( rDescr.Extension );
- for ( sal_uInt16 nCnt = comphelper::string::getTokenCount(aExtension, ';'); nCnt--; )
+ sal_Int32 nIndex = 0;
+ do
{
// no default plugins anymore
- OUString aExt( aExtension.getToken( nCnt, ';' ) );
+ const OUString aExt( aExtension.getToken( 0, ';', nIndex ) );
if ( aExt != "*.*" )
rTypes.insert( aExt );
}
+ while ( nIndex >= 0 );
}
rPluginNames = Sequence< OUString >( aMap.size() );