summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@collabora.com>2019-03-27 20:45:24 +0300
committerAndras Timar <andras.timar@collabora.com>2019-03-27 21:47:03 +0100
commitfb02d9f64198635e2c3c1593816ba8ec75782f9f (patch)
tree239d8328f7677174d008000d3297986fda814398 /vcl
parent8f35c6ad6735c32dc9b3afcf82a613092645cbc5 (diff)
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@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/image/ImplImageTree.cxx15
1 files changed, 15 insertions, 0 deletions
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;
}