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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 16 13:00:57 UTC 2021


 vcl/unx/gtk4/convert3to4.cxx |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 3b8fb0ba187ad8b0a5eb6102dcfd982aee6db9f5
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Jun 16 08:48:35 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Jun 16 15:00:16 2021 +0200

    gtk 4.3.2 will have a fix for this
    
    Change-Id: Idae818c0d7220d0fbe08462eff1654c22d24310c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117284
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk4/convert3to4.cxx b/vcl/unx/gtk4/convert3to4.cxx
index ce9af84251d5..0e8c697ee753 100644
--- a/vcl/unx/gtk4/convert3to4.cxx
+++ b/vcl/unx/gtk4/convert3to4.cxx
@@ -1341,13 +1341,16 @@ ConvertResult Convert3To4(const css::uno::Reference<css::xml::dom::XNode>& xNode
         xNode->removeChild(xRemove);
 
     // https://gitlab.gnome.org/GNOME/gtk/-/issues/4041 double encode ampersands if use-underline is used
-    if (xPropertyLabel && bUseUnderline)
+    if (gtk_check_version(4, 3, 2) != nullptr)
     {
-        OString sText = xPropertyLabel->getFirstChild()->getNodeValue().toUtf8();
-        gchar* pText = g_markup_escape_text(sText.getStr(), sText.getLength());
-        xPropertyLabel->getFirstChild()->setNodeValue(
-            OUString(pText, strlen(pText), RTL_TEXTENCODING_UTF8));
-        g_free(pText);
+        if (xPropertyLabel && bUseUnderline)
+        {
+            OString sText = xPropertyLabel->getFirstChild()->getNodeValue().toUtf8();
+            gchar* pText = g_markup_escape_text(sText.getStr(), sText.getLength());
+            xPropertyLabel->getFirstChild()->setNodeValue(
+                OUString(pText, strlen(pText), RTL_TEXTENCODING_UTF8));
+            g_free(pText);
+        }
     }
 
     return ConvertResult(bChildCanFocus, bHasVisible, bHasIconSize, bAlwaysShowImage, bUseUnderline,


More information about the Libreoffice-commits mailing list