[Libreoffice-commits] core.git: vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Jan 27 15:16:42 UTC 2019


 vcl/source/image/Image.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit bfc73ffe42529f39ea33de23f7788732238f2eb1
Author:     Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Sat Jan 19 19:46:14 2019 +0100
Commit:     Matteo Casalin <matteo.casalin at 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.casalin at 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
     {


More information about the Libreoffice-commits mailing list