summaryrefslogtreecommitdiff
path: root/vcl/source/image
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2019-01-19 19:46:14 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2019-01-27 16:16:21 +0100
commitbfc73ffe42529f39ea33de23f7788732238f2eb1 (patch)
tree064c163d339438a3e944a03da17caf549525b7a1 /vcl/source/image
parentd423829d662ddf1974ce6aca07dfa9d551333406 (diff)
Optimize: getToken()+comparison+copy() ==> startsWith()
Change-Id: Ic0e343f80ef91aad9baef8cc48648207b0365c68 Reviewed-on: https://gerrit.libreoffice.org/66642 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
Diffstat (limited to 'vcl/source/image')
-rw-r--r--vcl/source/image/Image.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/source/image/Image.cxx b/vcl/source/image/Image.cxx
index af0b0eae0176..99e3aeae9431 100644
--- a/vcl/source/image/Image.cxx
+++ b/vcl/source/image/Image.cxx
@@ -57,10 +57,10 @@ Image::Image(uno::Reference<graphic::XGraphic> const & rxGraphic)
Image::Image(const OUString & rFileUrl)
{
- sal_Int32 nIndex = 0;
- if (rFileUrl.getToken( 0, '/', nIndex ) == "private:graphicrepository")
+ OUString sImageName;
+ if (rFileUrl.startsWith("private:graphicrepository/", &sImageName))
{
- mpImplData = std::make_shared<ImplImage>(rFileUrl.copy(nIndex));
+ mpImplData = std::make_shared<ImplImage>(sImageName);
}
else
{