diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-06-08 15:09:17 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-06-08 20:27:38 +0200 |
commit | 803caf2882025e72d1834374d594dff0b4605e57 (patch) | |
tree | 56d250de06b28a493aabe5ca33943d1ca1675ae5 /vcl/unx/gtk4/convert3to4.cxx | |
parent | 7782f9fd753845a02fef90e89b50323c561f9118 (diff) |
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 <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx/gtk4/convert3to4.cxx')
-rw-r--r-- | vcl/unx/gtk4/convert3to4.cxx | 27 |
1 files changed, 27 insertions, 0 deletions
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"); |