From 0615f3bc125d2d02d11d336e1d0b1c204c91f432 Mon Sep 17 00:00:00 2001 From: Christophe JAILLET Date: Tue, 20 Aug 2019 21:21:44 +0200 Subject: Improve the way %PRODUCTVERSION is expanded in 'tipoftheday' Expand %PRODUCTVERSION in a much cleaner way. Follow up to commit 0ed7f9dab2ec03e168f2013e57c21637f7700736 Change-Id: If3d03cba19f89849c930d6dc3f1e07a65115e4e0 Signed-off-by: Christophe JAILLET Reviewed-on: https://gerrit.libreoffice.org/77862 Tested-by: Jenkins Reviewed-by: Heiko Tietze Tested-by: Heiko Tietze --- cui/source/dialogs/tipofthedaydlg.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cui/source/dialogs/tipofthedaydlg.cxx b/cui/source/dialogs/tipofthedaydlg.cxx index 9d6630d7e5a7..8f82f6841293 100644 --- a/cui/source/dialogs/tipofthedaydlg.cxx +++ b/cui/source/dialogs/tipofthedaydlg.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include TipOfTheDayDialog::TipOfTheDayDialog(weld::Window* pParent) @@ -88,8 +89,8 @@ void TipOfTheDayDialog::UpdateTip() } else if (aLink.startsWith("http")) { - aText = CuiResId(aLink.toUtf8().getStr()); - + // Links may have some %PRODUCTVERSION which need to be expanded + aText = Translate::ExpandVariables(aLink); sal_Int32 aPos = aText.indexOf("%LANGUAGENAME"); if (aPos != -1) { @@ -98,8 +99,8 @@ void TipOfTheDayDialog::UpdateTip() aLang = LanguageTag(utl::ConfigManager::getUILocale()).getBcp47(); aText = aText.replaceAt(aPos, 13, aLang); } - m_pLink->set_uri(aText); + m_pLink->set_label(CuiResId(STR_MORE_LINK)); m_pLink->set_visible(true); m_pLink->connect_clicked(Link()); -- cgit