[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - vcl/source

Muhammet Kara (via logerrit) logerrit at kemper.freedesktop.org
Wed Mar 27 20:47:29 UTC 2019


 vcl/source/image/ImplImageTree.cxx |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

New commits:
commit fb02d9f64198635e2c3c1593816ba8ec75782f9f
Author:     Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Wed Mar 27 20:45:24 2019 +0300
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Mar 27 21:47:03 2019 +0100

    Fix icon load error for uno commands with params
    
    Change-Id: I80be21b551cbd4eb029cb660fca98aef2727d584
    Reviewed-on: https://gerrit.libreoffice.org/69850
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/vcl/source/image/ImplImageTree.cxx b/vcl/source/image/ImplImageTree.cxx
index 30d9d9d38b7d..1a41d175a0b1 100644
--- a/vcl/source/image/ImplImageTree.cxx
+++ b/vcl/source/image/ImplImageTree.cxx
@@ -291,6 +291,21 @@ bool ImplImageTree::loadImage(OUString const & rName, OUString const & rStyle, B
 
         aCurrentStyle = fallbackStyle(aCurrentStyle);
     }
+
+    /* If the uno command has parameters, passed in from a toolbar,
+     * recover from failure by removing the parameters from the file name
+     */
+    if (rName.indexOf("%3f") > 0)
+    {
+        OUString sName(rName);
+        sal_Int32 nStart = sName.indexOf("%3f");
+        sal_Int32 nEnd = sName.lastIndexOf(".");
+
+        sName = sName.replaceAt(nStart, nEnd - nStart, "");
+
+        return loadImage(sName, rStyle, rBitmap, localized, eFlags, nScalePercentage);
+    }
+
     return false;
 }
 


More information about the Libreoffice-commits mailing list