diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-09-13 13:04:46 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-09-14 22:40:29 +0200 |
commit | 261471afa11f670a1ac19edc61c17e37d505dac0 (patch) | |
tree | 553c992e7d111fc841df0aa45c64b6c0cd28f6bd /cui/source | |
parent | 02d1aaf12cd1c9a6b7c79d7fbb5f65dd12199ab0 (diff) |
Avoid getTokenCount in StandardHdl_Impl link (1)
Change-Id: I3a74980fec63085fe60f6f413c77b54dcd4df0ab
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/options/optpath.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx index 3cc1dcef7e37..835418596853 100644 --- a/cui/source/options/optpath.cxx +++ b/cui/source/options/optpath.cxx @@ -421,15 +421,19 @@ IMPL_LINK_NOARG_TYPED(SvxPathTabPage, StandardHdl_Impl, Button*, void) sal_uInt16 i; sal_uInt16 nOldCount = comphelper::string::getTokenCount(aOldPath, MULTIPATH_DELIMITER); - sal_uInt16 nIntCount = comphelper::string::getTokenCount(sInternal, MULTIPATH_DELIMITER); for ( i = 0; i < nOldCount; ++i ) { bool bFound = false; OUString sOnePath = aOldPath.getToken( i, MULTIPATH_DELIMITER ); - for ( sal_uInt16 j = 0; !bFound && j < nIntCount; ++j ) + if ( !sInternal.isEmpty() ) { - if ( sInternal.getToken( j, MULTIPATH_DELIMITER ) == sOnePath ) - bFound = true; + sal_Int32 nInternalPos = 0; + do + { + if ( sInternal.getToken( 0, MULTIPATH_DELIMITER, nInternalPos ) == sOnePath ) + bFound = true; + } + while ( !bFound && nInternalPos >= 0 ); } if ( !bFound ) { |