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

Muhammet Kara (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 17 20:52:21 UTC 2019


 framework/source/uiconfiguration/ImageArrayData.cxx |   12 ++++++++++++
 1 file changed, 12 insertions(+)

New commits:
commit 951dddcb570b9706472c797e59bc38a74a7a5f7d
Author:     Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Mon Jan 28 02:06:45 2019 +0300
Commit:     Muhammet Kara <muhammet.kara at collabora.com>
CommitDate: Mon Jun 17 22:51:36 2019 +0200

    Fix icon load error for uno commands with params
    
    Change-Id: I31e4c28322a3492a603bce5c7226e2dbcf131173
    Reviewed-on: https://gerrit.libreoffice.org/66980
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Reviewed-on: https://gerrit.libreoffice.org/74215
    Reviewed-by: Muhammet Kara <muhammet.kara at collabora.com>
    Tested-by: Muhammet Kara <muhammet.kara at collabora.com>

diff --git a/framework/source/uiconfiguration/ImageArrayData.cxx b/framework/source/uiconfiguration/ImageArrayData.cxx
index efe58dffa6e0..570d2846ff77 100644
--- a/framework/source/uiconfiguration/ImageArrayData.cxx
+++ b/framework/source/uiconfiguration/ImageArrayData.cxx
@@ -71,6 +71,18 @@ void ImageAryData::Load(const OUString &rPrefix)
 
     bool bSuccess = ImageTree::get().loadImage(aFileName, aIconTheme, maBitmapEx, true);
 
+    /* If the uno command has parameters, passed in from a toolbar,
+     * recover from failure by removing the parameters from the file name
+     */
+    if (!bSuccess && aFileName.indexOf("%3f") > 0)
+    {
+        sal_Int32 nStart = aFileName.indexOf("%3f");
+        sal_Int32 nEnd = aFileName.lastIndexOf(".");
+
+        aFileName = aFileName.replaceAt(nStart, nEnd - nStart, "");
+        bSuccess = ImageTree::get().loadImage(aFileName, aIconTheme, maBitmapEx, true);
+    }
+
     SAL_WARN_IF(!bSuccess, "fwk.uiconfiguration", "Failed to load image '" << aFileName
               << "' from icon theme '" << aIconTheme << "'");
 }


More information about the Libreoffice-commits mailing list