diff options
author | Muhammet Kara <muhammet.kara@collabora.com> | 2019-01-28 02:06:45 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-28 07:41:22 +0100 |
commit | 2e732cbbd52e4bb1ea3e03efea33c97d4e528b0d (patch) | |
tree | f427f87a7d04f6db173ef9ea6a10b4d34648742e /framework/source | |
parent | 3c2cd4829229a312e79cfba3971b954bd605681c (diff) |
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@collabora.co.uk>
Diffstat (limited to 'framework/source')
-rw-r--r-- | framework/source/uiconfiguration/ImageArrayData.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
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 << "'"); } |