framework/source/uiconfiguration/ImageArrayData.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+)
New commits: commit 951dddcb570b9706472c797e59bc38a74a7a5f7d Author: Muhammet Kara <[email protected]> AuthorDate: Mon Jan 28 02:06:45 2019 +0300 Commit: Muhammet Kara <[email protected]> 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 <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/74215 Reviewed-by: Muhammet Kara <[email protected]> Tested-by: Muhammet Kara <[email protected]> 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 << "'"); } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
