diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-09-13 12:29:16 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-09-14 22:40:28 +0200 |
commit | bbdbdbc31de0236708ee3f918c49aa7193323b65 (patch) | |
tree | 3b1ac400633c39880b4efc192e83f38b16e35e8c /cui/source | |
parent | 33cddeea1352688af9a42b53024e32a4536d5860 (diff) |
Avoid getTokenCount in Convert_Impl (optpath.cxx)
Change-Id: Icc434c714fead503c3fd292bd9609c3905023676
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/options/optpath.cxx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx index 002d16e0e310..289d29542475 100644 --- a/cui/source/options/optpath.cxx +++ b/cui/source/options/optpath.cxx @@ -143,17 +143,22 @@ static OUString getCfgName_Impl( sal_uInt16 _nHandle ) OUString Convert_Impl( const OUString& rValue ) { - char cDelim = MULTIPATH_DELIMITER; - sal_uInt16 nCount = comphelper::string::getTokenCount(rValue, cDelim); OUString aReturn; - for ( sal_uInt16 i=0; i<nCount ; ++i ) + if (rValue.isEmpty()) + return aReturn; + + const sal_Unicode cDelim = MULTIPATH_DELIMITER; + sal_Int32 nPos = 0; + + for (;;) { - OUString aValue = rValue.getToken( i, cDelim ); + OUString aValue = rValue.getToken( 0, cDelim, nPos ); INetURLObject aObj( aValue ); if ( aObj.GetProtocol() == INetProtocol::File ) aReturn += aObj.PathToFileName(); - if ( i+1 < nCount) - aReturn += OUStringLiteral1<MULTIPATH_DELIMITER>(); + if ( nPos < 0 ) + break; + aReturn += OUStringLiteral1<MULTIPATH_DELIMITER>(); } return aReturn; |