vcl/unx/gtk4/convert3to4.cxx |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

New commits:
commit 803caf2882025e72d1834374d594dff0b4605e57
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Jun 8 15:09:17 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue Jun 8 20:27:38 2021 +0200

    gtk4: reverse the order of the pack-type=end widgets
    
    Change-Id: I912dfa86f1f3cdb03c523530d8c3df510241831c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116850
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/unx/gtk4/convert3to4.cxx b/vcl/unx/gtk4/convert3to4.cxx
index 78e2f0dd7314..8aef3470defa 100644
--- a/vcl/unx/gtk4/convert3to4.cxx
+++ b/vcl/unx/gtk4/convert3to4.cxx
@@ -1008,6 +1008,33 @@ ConvertResult Convert3To4(const 
css::uno::Reference<css::xml::dom::XNode>& xNode
                 else // GtkMessageDialog
                     xClass->setNodeValue("GtkBox");
             }
+            else if (sClass == "GtkBox")
+            {
+                // reverse the order of the pack-type=end widgets
+                std::vector<css::uno::Reference<css::xml::dom::XNode>> 
xPackEnds;
+                css::uno::Reference<css::xml::dom::XNode> xBoxChild = 
xChild->getFirstChild();
+                while (xBoxChild.is())
+                {
+                    auto xNextBoxChild = xBoxChild->getNextSibling();
+
+                    if (xBoxChild->getNodeName() == "child")
+                    {
+                        css::uno::Reference<css::xml::dom::XNamedNodeMap> 
xBoxChildMap
+                            = xBoxChild->getAttributes();
+                        css::uno::Reference<css::xml::dom::XNode> xType
+                            = xBoxChildMap->getNamedItem("type");
+                        if (xType && xType->getNodeValue() == "end")
+                            
xPackEnds.push_back(xChild->removeChild(xBoxChild));
+                    }
+
+                    xBoxChild = xNextBoxChild;
+                }
+
+                std::reverse(xPackEnds.begin(), xPackEnds.end());
+
+                for (auto& xPackEnd : xPackEnds)
+                    xChild->appendChild(xPackEnd);
+            }
             else if (sClass == "GtkRadioButton")
             {
                 xClass->setNodeValue("GtkCheckButton");
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to