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

New commits:
commit f5dbf927bf44c9a1ac80eae6f72887a4f3543201
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Oct 19 08:44:43 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue Oct 19 11:36:39 2021 +0200

    Resolves: tdf#136498 %PRODUCTNAME shown in tool tips
    
    Change-Id: Id9640f9b5f85a98a510307bc7debf51448c716e7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123796
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index bd84f41b2d1e..b76bd0dac1f0 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -22042,9 +22042,18 @@ private:
                 gtk_widget_hide(pWidget);
         }
 
-#if !GTK_CHECK_VERSION(4, 0, 0)
         if (m_pStringReplace)
         {
+            // tdf#136498 %PRODUCTNAME shown in tool tips
+            const char* pTooltip = gtk_widget_get_tooltip_text(pWidget);
+            if (pTooltip && pTooltip[0])
+            {
+                OUString aTooltip(pTooltip, strlen(pTooltip), 
RTL_TEXTENCODING_UTF8);
+                aTooltip = (*m_pStringReplace)(aTooltip);
+                gtk_widget_set_tooltip_text(pWidget, 
OUStringToOString(aTooltip, RTL_TEXTENCODING_UTF8).getStr());
+            }
+
+#if !GTK_CHECK_VERSION(4, 0, 0)
             // tdf#142704 %PRODUCTNAME shown in extended tips
             AtkObject* pAtkObject = gtk_widget_get_accessible(pWidget);
             const char* pDesc = pAtkObject ? 
atk_object_get_description(pAtkObject) : nullptr;
@@ -22054,8 +22063,8 @@ private:
                 aDesc = (*m_pStringReplace)(aDesc);
                 atk_object_set_description(pAtkObject, 
OUStringToOString(aDesc, RTL_TEXTENCODING_UTF8).getStr());
             }
-        }
 #endif
+        }
 
         // expand placeholder and collect potentially missing mnemonics
         if (GTK_IS_BUTTON(pWidget))

Reply via email to