diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-09-12 14:13:50 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-09-12 14:18:53 +0200 |
commit | 3342993a437df435f4640468fd650dfb45d43045 (patch) | |
tree | 502669baec196ef45c0c611cf7295e1017dfb37f /cui/source/dialogs | |
parent | d76b979dbdbeefc522f39ef39034cef72f27cfca (diff) |
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/source/dialogs')
-rw-r--r-- | cui/source/dialogs/plfilter.cxx | 11 |
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() ); |