diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-04-25 18:44:03 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-04-29 22:50:48 +0200 |
commit | 777634169d1b3f264ccb0f01d9d4d9ecdd560d70 (patch) | |
tree | 040fab1f69cc8b6f4af112590c8ea50f9f0b7327 | |
parent | 2f6b3fb0f30cd03e5ac60805a922711bdcab77f9 (diff) |
Avoid comphelper::string::getTokenCount()
Change-Id: Iff326aec62554cd0719e7fe8f2b5871ed5e10bfd
-rw-r--r-- | cui/source/tabpages/numpages.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index ddad7426c78e..3c31e11d4a4b 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -76,7 +76,6 @@ #include <unotools/ucbstreamhelper.hxx> #include <com/sun/star/ucb/SimpleFileAccess.hpp> #include <rtl/ustring.h> -#include <comphelper/string.hxx> #include <vcl/cvtgrf.hxx> #include <vcl/graphicfilter.hxx> #include <svx/SvxNumOptionsTabPageHelper.hxx> @@ -993,8 +992,12 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, ClickAddBrowseHdl_Impl, Button*, void) OUString aUserImageURL = aFileDialog.GetPath(); - sal_Int32 nSub = comphelper::string::getTokenCount( aUserImageURL, '/'); - OUString aFileName = aUserImageURL.getToken( nSub-1 , SEARCHFILENAME_DELIMITER ); + OUString aFileName; + const sal_Int32 nPos {aUserImageURL.lastIndexOf(SEARCHFILENAME_DELIMITER)+1}; + if (nPos<=0) + aFileName = aUserImageURL; + else if (nPos<aUserImageURL.getLength()) + aFileName = aUserImageURL.copy(nPos); OUString aUserGalleryURL = aPathToken + "/" + aFileName; INetURLObject aURL( aUserImageURL ); |