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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 2 18:37:39 UTC 2021


 vcl/unx/gtk3/gtkinst.cxx |   13 +++++++++++++
 1 file changed, 13 insertions(+)

New commits:
commit f9e87fa1330d15e83d730665e7a4f6701a969ae4
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Jun 2 16:43:51 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Jun 2 20:36:55 2021 +0200

    gtk4: supplement GtkEntry width-chars with additional max-width-chars
    
    Change-Id: I69b51be8d565636618ab8fb9fd254adb3b4def10
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116621
    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 20598dcc9abe..f581d712b57a 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -20989,6 +20989,19 @@ ConvertResult Convert3To4(const Reference<css::xml::dom::XNode>& xNode)
                     xRemoveList.push_back(xChild);
             }
 
+            if (sName == "width-chars")
+            {
+                if (GetParentObjectType(xChild) == "GtkEntry")
+                {
+                    // I don't quite get what the difference should be wrt width-chars and max-width-chars
+                    // but glade doesn't write max-width-chars and in gtk4 where we have width-chars, e.g
+                    // print dialog, then max-width-chars gives the effect we wanted with width-chars
+                    auto xDoc = xChild->getOwnerDocument();
+                    auto mMaxWidthChars = CreateProperty(xDoc, "max-width-chars", xChild->getFirstChild()->getNodeValue());
+                    xChild->getParentNode()->insertBefore(mMaxWidthChars, xChild);
+                }
+            }
+
             // remove 'Help' button label and replace with a help icon instead
             if (sName == "label" && GetParentObjectType(xChild) == "GtkButton")
             {


More information about the Libreoffice-commits mailing list