summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-06-15 14:37:55 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-06-15 18:06:22 +0200
commit7ed44a440da563974b0ed6d1bf9ded5d69f9a276 (patch)
treef71e472e6b2473fa521dc2e4235584de145b3169
parentae2948516305415cf48ba43f2412e0d7a9b5d73e (diff)
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@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/unx/gtk4/convert3to4.cxx11
1 files changed, 6 insertions, 5 deletions
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;