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

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


 vcl/unx/gtk4/convert3to4.cxx |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 7ed44a440da563974b0ed6d1bf9ded5d69f9a276
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jun 15 14:37:55 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jun 15 18:06:22 2021 +0200

    gtk4: don't convert generated button image-child
    
    its already convert, so don't double convert to remove e.g.
    already converted icon-size in calc paste special
    
    Change-Id: Id87ca7a6dfecdca102e1a12a37eed90b0e40e48c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117250
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk4/convert3to4.cxx b/vcl/unx/gtk4/convert3to4.cxx
index 436fa1728868..2f9f9c44f22e 100644
--- a/vcl/unx/gtk4/convert3to4.cxx
+++ b/vcl/unx/gtk4/convert3to4.cxx
@@ -359,6 +359,8 @@ ConvertResult Convert3To4(const css::uno::Reference<css::xml::dom::XNode>& xNode
     css::uno::Reference<css::xml::dom::XNode> xPropertyIconName;
     css::uno::Reference<css::xml::dom::XNode> xCantFocus;
 
+    css::uno::Reference<css::xml::dom::XElement> xGeneratedImageChild;
+
     css::uno::Reference<css::xml::dom::XNode> xChild = xNode->getFirstChild();
     while (xChild.is())
     {
@@ -684,11 +686,10 @@ ConvertResult Convert3To4(const css::uno::Reference<css::xml::dom::XNode>& xNode
                             || GetParentObjectType(xChild) == "GtkToggleButton")
                         {
                             // relocate it to be a child of this GtkButton
-                            css::uno::Reference<css::xml::dom::XElement> xImageChild
-                                = xDoc->createElement("child");
-                            xImageChild->appendChild(
+                            xGeneratedImageChild = xDoc->createElement("child");
+                            xGeneratedImageChild->appendChild(
                                 xImageNode->getParentNode()->removeChild(xImageNode));
-                            xObjectCandidate->appendChild(xImageChild);
+                            xObjectCandidate->appendChild(xGeneratedImageChild);
                         }
                         else if (GetParentObjectType(xChild) == "GtkMenuButton")
                         {
@@ -925,7 +926,7 @@ ConvertResult Convert3To4(const css::uno::Reference<css::xml::dom::XNode>& xNode
         bool bChildVertOrientation = false;
         css::uno::Reference<css::xml::dom::XNode> xChildPropertyLabel;
         css::uno::Reference<css::xml::dom::XNode> xChildPropertyIconName;
-        if (xChild->hasChildNodes())
+        if (xChild->hasChildNodes() && xChild != xGeneratedImageChild)
         {
             auto aChildRes = Convert3To4(xChild);
             bChildCanFocus |= aChildRes.m_bChildCanFocus;


More information about the Libreoffice-commits mailing list