[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri May 14 09:50:55 UTC 2021


 vcl/unx/gtk3/gtkinst.cxx |   64 ++++++++++++++++++++++++++++++-----------------
 1 file changed, 42 insertions(+), 22 deletions(-)

New commits:
commit 43f81f1ed3e98202d440f17509b8d008fab51ce3
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri May 14 08:55:42 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri May 14 11:50:16 2021 +0200

    gtk4: vexpand internal dialog vbox child
    
    Change-Id: I9c08fa885ddfb22e154909a66e6a70d8293879d7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115583
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 960ad2bc0519..77b2bec9fc53 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -17584,7 +17584,23 @@ void ConvertTree(const Reference<css::xml::dom::XNode>& xNode)
         }
         else if (xChild->getNodeName() == "child")
         {
-            if (!sBorderWidth.isEmpty())
+            bool bContentArea = false;
+
+            css::uno::Reference<css::xml::dom::XNamedNodeMap> xMap = xChild->getAttributes();
+            css::uno::Reference<css::xml::dom::XNode> xName = xMap->getNamedItem("internal-child");
+            if (xName)
+            {
+                OUString sName(xName->getNodeValue());
+                if (sName == "vbox")
+                {
+                    xName->setNodeValue("content_area");
+                    bContentArea = true;
+                }
+                else if (sName == "accessible")
+                    xRemoveList.push_back(xChild); // Yikes!, what's the replacement for this going to be
+            }
+
+            if (bContentArea || !sBorderWidth.isEmpty())
             {
                 for (css::uno::Reference<css::xml::dom::XNode> xObjectCandidate = xChild->getFirstChild();
                      xObjectCandidate.is();
@@ -17593,33 +17609,37 @@ void ConvertTree(const Reference<css::xml::dom::XNode>& xNode)
                     if (xObjectCandidate->getNodeName() == "object")
                     {
                         auto xDoc = xChild->getOwnerDocument();
-                        auto xMarginEnd = CreateProperty(xDoc, "margin-end", sBorderWidth);
-
-                        auto xFirstChild = xObjectCandidate->getFirstChild();
-                        if (xFirstChild.is())
-                            xObjectCandidate->insertBefore(xMarginEnd, xFirstChild);
-                        else
-                            xObjectCandidate->appendChild(xMarginEnd);
 
-                        xObjectCandidate->insertBefore(CreateProperty(xDoc, "margin-top", sBorderWidth), xMarginEnd);
-                        xObjectCandidate->insertBefore(CreateProperty(xDoc, "margin-bottom", sBorderWidth), xMarginEnd);
-                        xObjectCandidate->insertBefore(CreateProperty(xDoc, "margin-start", sBorderWidth), xMarginEnd);
+                        if (bContentArea)
+                        {
+                            auto xVExpand = CreateProperty(xDoc, "vexpand", "True");
+
+                            auto xFirstChild = xObjectCandidate->getFirstChild();
+                            if (xFirstChild.is())
+                                xObjectCandidate->insertBefore(xVExpand, xFirstChild);
+                            else
+                                xObjectCandidate->appendChild(xVExpand);
+                        }
+
+                        if (!sBorderWidth.isEmpty())
+                        {
+                            auto xMarginEnd = CreateProperty(xDoc, "margin-end", sBorderWidth);
+
+                            auto xFirstChild = xObjectCandidate->getFirstChild();
+                            if (xFirstChild.is())
+                                xObjectCandidate->insertBefore(xMarginEnd, xFirstChild);
+                            else
+                                xObjectCandidate->appendChild(xMarginEnd);
+
+                            xObjectCandidate->insertBefore(CreateProperty(xDoc, "margin-top", sBorderWidth), xMarginEnd);
+                            xObjectCandidate->insertBefore(CreateProperty(xDoc, "margin-bottom", sBorderWidth), xMarginEnd);
+                            xObjectCandidate->insertBefore(CreateProperty(xDoc, "margin-start", sBorderWidth), xMarginEnd);
+                        }
                         break;
                     }
                 }
                 sBorderWidth.clear();
             }
-
-            css::uno::Reference<css::xml::dom::XNamedNodeMap> xMap = xChild->getAttributes();
-            css::uno::Reference<css::xml::dom::XNode> xName = xMap->getNamedItem("internal-child");
-            if (xName)
-            {
-                OUString sName(xName->getNodeValue());
-                if (sName == "vbox")
-                    xName->setNodeValue("content_area");
-                else if (sName == "accessible")
-                    xRemoveList.push_back(xChild); // Yikes!, what's the replacement for this going to be
-            }
         }
         else if (xChild->getNodeName() == "object")
         {


More information about the Libreoffice-commits mailing list