summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/unx/gtk3/gtkinst.cxx22
1 files changed, 9 insertions, 13 deletions
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index f5f1498443dc..8db5257711c5 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -21926,7 +21926,15 @@ namespace {
const char* pDesc = pAtkObject ? atk_object_get_description(pAtkObject) : nullptr;
if (pDesc && pDesc[0])
{
- gtk_tooltip_set_text(tooltip, pDesc);
+ if (ResHookProc pStringReplace = Translate::GetReadStringHook())
+ {
+ // tdf#142704 %PRODUCTNAME shown in extended tips
+ OUString aDesc(pDesc, strlen(pDesc), RTL_TEXTENCODING_UTF8);
+ aDesc = (*pStringReplace)(aDesc);
+ gtk_tooltip_set_text(tooltip, OUStringToOString(aDesc, RTL_TEXTENCODING_UTF8).getStr());
+ }
+ else
+ gtk_tooltip_set_text(tooltip, pDesc);
return true;
}
#endif
@@ -22484,18 +22492,6 @@ private:
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;
- if (pDesc && pDesc[0])
- {
- OUString aDesc(pDesc, strlen(pDesc), RTL_TEXTENCODING_UTF8);
- aDesc = (*m_pStringReplace)(aDesc);
- atk_object_set_description(pAtkObject, OUStringToOString(aDesc, RTL_TEXTENCODING_UTF8).getStr());
- }
-#endif
}
// expand placeholder and collect potentially missing mnemonics