vcl/source/image/Image.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
New commits: commit bfc73ffe42529f39ea33de23f7788732238f2eb1 Author: Matteo Casalin <matteo.casa...@yahoo.com> AuthorDate: Sat Jan 19 19:46:14 2019 +0100 Commit: Matteo Casalin <matteo.casa...@yahoo.com> CommitDate: Sun Jan 27 16:16:21 2019 +0100 Optimize: getToken()+comparison+copy() ==> startsWith() Change-Id: Ic0e343f80ef91aad9baef8cc48648207b0365c68 Reviewed-on: https://gerrit.libreoffice.org/66642 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casa...@yahoo.com> 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 { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits