[Libreoffice-commits] core.git: vcl/unx
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Sat May 15 13:26:57 UTC 2021
vcl/unx/gtk3/gtkinst.cxx | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
New commits:
commit e920e6d600a4c4504cbc04b89d4078dd49e2df66
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri May 14 20:37:43 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat May 15 15:26:01 2021 +0200
gtk4: strip GtkSpinButton properties that don't exist anymore
presumably due to de-inheritance from GtkEntry
Change-Id: Ibbe7f4c05025123f2ebd594ed157bd346e3a237a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115636
Tested-by: Caolán McNamara <caolanm at redhat.com>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index aaaea626d3e7..2af11bbf477b 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -17567,6 +17567,15 @@ void SetPropertyOnTopLevel(const Reference<css::xml::dom::XNode>& xNode, const R
}
}
+OUString GetParentObjectType(const Reference<css::xml::dom::XNode>& xNode)
+{
+ auto xParent = xNode->getParentNode();
+ assert(xParent->getNodeName() == "object");
+ css::uno::Reference<css::xml::dom::XNamedNodeMap> xParentMap = xParent->getAttributes();
+ css::uno::Reference<css::xml::dom::XNode> xClass = xParentMap->getNamedItem("class");
+ return xClass->getNodeValue();
+}
+
bool ConvertTree(const Reference<css::xml::dom::XNode>& xNode)
{
css::uno::Reference<css::xml::dom::XNodeList> xNodeList = xNode->getChildNodes();
@@ -17626,6 +17635,30 @@ bool ConvertTree(const Reference<css::xml::dom::XNode>& xNode)
xCantFocus = xChild;
}
+ if (sName == "activates-default")
+ {
+ if (GetParentObjectType(xChild) == "GtkSpinButton")
+ xRemoveList.push_back(xChild);
+ }
+
+ if (sName == "truncate-multiline")
+ {
+ if (GetParentObjectType(xChild) == "GtkSpinButton")
+ xRemoveList.push_back(xChild);
+ }
+
+ if (sName == "shadow-type")
+ {
+ if (GetParentObjectType(xChild) == "GtkFrame")
+ xRemoveList.push_back(xChild);
+ }
+
+ if (sName == "draw-indicator")
+ {
+ assert(toBool(xChild->getFirstChild()->getNodeValue()));
+ xRemoveList.push_back(xChild);
+ }
+
if (sName == "type-hint" || sName == "skip-taskbar-hint" ||
sName == "can-default" || sName == "has-default" ||
sName == "border-width" || sName == "layout-style" ||
@@ -17755,6 +17788,11 @@ bool ConvertTree(const Reference<css::xml::dom::XNode>& xNode)
xRemoveList.push_back(xChild);
}
+ else if (xChild->getNodeName() == "accessibility")
+ {
+ // TODO <relation type="labelled-by" target="pagenumcb"/> -> <relation name="labelled-by">pagenumcb</relation>
+ xRemoveList.push_back(xChild);
+ }
auto xNextChild = xChild->getNextSibling();
@@ -17831,6 +17869,11 @@ bool ConvertTree(const Reference<css::xml::dom::XNode>& xNode)
else // if (!xId->getNodeValue().startsWith("messagedialog-action_area"))
xClass->setNodeValue("GtkBox");
}
+ else if (sClass == "GtkRadioButton")
+ {
+ xClass->setNodeValue("GtkCheckButton");
+ }
+
}
xChild = xNextChild;
More information about the Libreoffice-commits
mailing list