From bfc73ffe42529f39ea33de23f7788732238f2eb1 Mon Sep 17 00:00:00 2001 From: Matteo Casalin Date: Sat, 19 Jan 2019 19:46:14 +0100 Subject: Optimize: getToken()+comparison+copy() ==> startsWith() Change-Id: Ic0e343f80ef91aad9baef8cc48648207b0365c68 Reviewed-on: https://gerrit.libreoffice.org/66642 Tested-by: Jenkins Reviewed-by: Matteo Casalin --- vcl/source/image/Image.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'vcl/source/image') 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 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(rFileUrl.copy(nIndex)); + mpImplData = std::make_shared(sImageName); } else { -- cgit