diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-09-13 13:09:42 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-09-14 22:40:29 +0200 |
commit | 57c0ca2e575813626d0c2c994e0a4b52253f42b1 (patch) | |
tree | 98bb674f756a7647d6fbca7dab1437cc32fa98d4 /cui | |
parent | 261471afa11f670a1ac19edc61c17e37d505dac0 (diff) |
Avoid getTokenCount in StandardHdl_Impl link (2)
Change-Id: I0164f81e6308c5a5c1b4d93e8df55aa911ea8b4c
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optpath.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx index 835418596853..0a97795aab8e 100644 --- a/cui/source/options/optpath.cxx +++ b/cui/source/options/optpath.cxx @@ -419,12 +419,11 @@ IMPL_LINK_NOARG_TYPED(SvxPathTabPage, StandardHdl_Impl, Button*, void) bool bReadOnly = false; GetPathList( pPathImpl->nRealId, sInternal, sUser, sWritable, bReadOnly ); - sal_uInt16 i; - sal_uInt16 nOldCount = comphelper::string::getTokenCount(aOldPath, MULTIPATH_DELIMITER); - for ( i = 0; i < nOldCount; ++i ) + sal_Int32 nOldPos = 0; + do { bool bFound = false; - OUString sOnePath = aOldPath.getToken( i, MULTIPATH_DELIMITER ); + const OUString sOnePath = aOldPath.getToken( 0, MULTIPATH_DELIMITER, nOldPos ); if ( !sInternal.isEmpty() ) { sal_Int32 nInternalPos = 0; @@ -442,9 +441,11 @@ IMPL_LINK_NOARG_TYPED(SvxPathTabPage, StandardHdl_Impl, Button*, void) sTemp += sOnePath; } } + while ( nOldPos >= 0 ); OUString sUserPath, sWritablePath; - nOldCount = comphelper::string::getTokenCount(sTemp, MULTIPATH_DELIMITER); + sal_uInt16 nOldCount = comphelper::string::getTokenCount(sTemp, MULTIPATH_DELIMITER); + sal_uInt16 i; for ( i = 0; nOldCount > 0 && i < nOldCount - 1; ++i ) { if ( !sUserPath.isEmpty() ) |