diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-10-19 08:44:43 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-10-19 11:36:39 +0200 |
commit | f5dbf927bf44c9a1ac80eae6f72887a4f3543201 (patch) | |
tree | 27133eaf0cffe5c1d3f502d790645b892dc58f84 /vcl | |
parent | 80b5d83f8ac858fddb32d2d72d1c2d4f3c64b32a (diff) |
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 <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/gtkinst.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
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)) |