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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jan 28 06:41:44 UTC 2019


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

New commits:
commit 2e732cbbd52e4bb1ea3e03efea33c97d4e528b0d
Author:     Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Mon Jan 28 02:06:45 2019 +0300
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jan 28 07:41:22 2019 +0100

    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>

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