diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-06-06 21:28:40 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-06-07 21:33:14 +0200 |
commit | f9b721bb6fb243465029273265b757288cf391c9 (patch) | |
tree | bc00f4398b70a95df745c106f2b56eea61e9d973 /vcl | |
parent | 7f49c4eea51c6c84ee7adacd5ba45e1e0fc4c1f7 (diff) |
gtk4: convert pack-type to child type
Change-Id: Id72572b1b97917b9cf3816b1abaa1e412ed028a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116766
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/gtkinst.cxx | 1 | ||||
-rw-r--r-- | vcl/unx/gtk4/convert3to4.cxx | 31 |
2 files changed, 27 insertions, 5 deletions
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 533e2628cf6f..470ada586aa2 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -22059,6 +22059,7 @@ weld::Builder* GtkInstance::CreateBuilder(weld::Widget* pParent, const OUString& rUIFile != "sfx/ui/printeroptionsdialog.ui" && rUIFile != "sfx/ui/securityinfopage.ui" && rUIFile != "sfx/ui/singletabdialog.ui" && + rUIFile != "sfx/ui/templatecategorydlg.ui" && rUIFile != "sfx/ui/templatedlg.ui" && rUIFile != "svt/ui/addresstemplatedialog.ui" && rUIFile != "svt/ui/datewindow.ui" && diff --git a/vcl/unx/gtk4/convert3to4.cxx b/vcl/unx/gtk4/convert3to4.cxx index 51649c981503..78e2f0dd7314 100644 --- a/vcl/unx/gtk4/convert3to4.cxx +++ b/vcl/unx/gtk4/convert3to4.cxx @@ -631,8 +631,6 @@ ConvertResult Convert3To4(const css::uno::Reference<css::xml::dom::XNode>& xNode if (sPropName == "icon-name") { OUString sIconName(xProp->getFirstChild()->getNodeValue()); - fprintf(stderr, "icon name is %s\n", - sIconName.toUtf8().getStr()); auto xIconName = CreateProperty(xDoc, "icon-name", sIconName); xObjectCandidate->insertBefore(xIconName, xChild); @@ -678,8 +676,10 @@ ConvertResult Convert3To4(const css::uno::Reference<css::xml::dom::XNode>& xNode bContentArea = true; } else if (sName == "accessible") - xRemoveList.push_back( - xChild); // Yikes!, what's the replacement for this going to be + { + // TODO what's the replacement for this going to be? + xRemoveList.push_back(xChild); + } } if (bContentArea) @@ -759,6 +759,26 @@ ConvertResult Convert3To4(const css::uno::Reference<css::xml::dom::XNode>& xNode xParent, css::uno::UNO_QUERY_THROW); xElem->setAttributeNode(xTypeStart); } + else if (sName == "pack-type") + { + // turn parent tag of <child> into <child type="start"> + auto xParent = xChild->getParentNode(); + + css::uno::Reference<css::xml::dom::XNamedNodeMap> xParentMap + = xParent->getAttributes(); + css::uno::Reference<css::xml::dom::XNode> xParentType + = xParentMap->getNamedItem("type"); + assert(!xParentType || xParentType->getNodeValue() == "titlebar"); + if (!xParentType) + { + css::uno::Reference<css::xml::dom::XAttr> xTypeStart + = xDoc->createAttribute("type"); + xTypeStart->setValue(xCurrent->getFirstChild()->getNodeValue()); + css::uno::Reference<css::xml::dom::XElement> xElem( + xParent, css::uno::UNO_QUERY_THROW); + xElem->setAttributeNode(xTypeStart); + } + } } xNew->appendChild(xChild->removeChild(xCurrent)); } @@ -1036,7 +1056,8 @@ ConvertResult Convert3To4(const css::uno::Reference<css::xml::dom::XNode>& xNode xChild->appendChild(CreateProperty(xDoc, "visible", "False")); } - if (bChildAlwaysShowImage) + // only create the child box for GtkButton/GtkToggleButton + if (bChildAlwaysShowImage && sClass != "GtkMenuButton") { auto xImageCandidateNode = xChild->getLastChild(); if (xImageCandidateNode && xImageCandidateNode->getNodeName() != "child") |