summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2018-06-30 09:02:43 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2018-06-30 23:00:17 +0200
commit6a53c4f5d984d03bee8a615c8adcd518a9952833 (patch)
tree479afb8b70bb10fe403150658163792c247ec339 /svx
parent3199a740ac543b1f8fd55146f5ae062a16a11b6b (diff)
Avoid getTokenCount() + not empty OUString has at least 1 token
Change-Id: Ib8771f9621e050c100f2a319e354106bf316b24c
Diffstat (limited to 'svx')
-rw-r--r--svx/source/gallery2/gallery1.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx
index e38da7bc9a98..05e2821656f2 100644
--- a/svx/source/gallery2/gallery1.cxx
+++ b/svx/source/gallery2/gallery1.cxx
@@ -29,7 +29,6 @@
#include <sal/config.h>
#include <comphelper/processfactory.hxx>
-#include <comphelper/string.hxx>
#include <osl/thread.h>
#include <tools/vcompat.hxx>
#include <vcl/lstbox.hxx>
@@ -273,10 +272,9 @@ Gallery* Gallery::GetGalleryInstance()
void Gallery::ImplLoad( const OUString& rMultiPath )
{
- const sal_Int32 nTokenCount = comphelper::string::getTokenCount(rMultiPath, ';');
bool bIsReadOnlyDir;
- bMultiPath = ( nTokenCount > 0 );
+ bMultiPath = !rMultiPath.isEmpty();
INetURLObject aCurURL(SvtPathOptions().GetConfigPath());
ImplLoadSubDirs( aCurURL, bIsReadOnlyDir );
@@ -287,9 +285,10 @@ void Gallery::ImplLoad( const OUString& rMultiPath )
if( bMultiPath )
{
bool bIsRelURL {true};
- for( sal_Int32 i = 0; i < nTokenCount; ++i )
+ sal_Int32 nIdx {0};
+ do
{
- aCurURL = INetURLObject(rMultiPath.getToken(i, ';'));
+ aCurURL = INetURLObject(rMultiPath.getToken(0, ';', nIdx));
if (bIsRelURL)
{
aRelURL = aCurURL;
@@ -301,6 +300,7 @@ void Gallery::ImplLoad( const OUString& rMultiPath )
if( !bIsReadOnlyDir )
aUserURL = aCurURL;
}
+ while (nIdx>0);
}
else
aRelURL = INetURLObject( rMultiPath );