[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 15 16:22:14 UTC 2021


 vcl/unx/gtk4/convert3to4.cxx |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

New commits:
commit 93e2cc6d5d3408a4d480ac9a44e6adb0060965bf
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jun 15 16:26:31 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jun 15 18:21:28 2021 +0200

    gtk4: use GtkPicture for view, user interface
    
    Change-Id: I6677233dc0594d6b2e9ea4b8f901550dbff46361
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117261
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk4/convert3to4.cxx b/vcl/unx/gtk4/convert3to4.cxx
index f5e75a49b1ce..24b67f01e576 100644
--- a/vcl/unx/gtk4/convert3to4.cxx
+++ b/vcl/unx/gtk4/convert3to4.cxx
@@ -1207,7 +1207,22 @@ ConvertResult Convert3To4(const css::uno::Reference<css::xml::dom::XNode>& xNode
                     OUString sIconName(xChildPropertyIconName->getFirstChild()->getNodeValue());
                     bool bHasSymbolicIconName = IsAllowedBuiltInIcon(sIconName);
                     if (bHasSymbolicIconName)
-                        bKeepAsImage = true;
+                    {
+                        if (sIconName != "missing-image")
+                            bKeepAsImage = true;
+                        else
+                        {
+                            // If the symbolic icon-name is missing-image then decide to make
+                            // it a GtkPicture if it has a parent widget and keep it as GtkImage
+                            // if it has just the root "interface" as parent.
+                            // for e.g. view, user interface
+                            css::uno::Reference<css::xml::dom::XNode> xParent
+                                = xChild->getParentNode();
+                            bKeepAsImage = xParent->getNodeName() == "interface";
+                            if (!bKeepAsImage)
+                                xChild->removeChild(xChildPropertyIconName);
+                        }
+                    }
                     else
                     {
                         // private:graphicrepository/ would be turned by gio (?) into private:///graphicrepository/


More information about the Libreoffice-commits mailing list