diff options
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/sfxhelp.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 8fbdad1fc794..d6fac42bd6de 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -65,8 +65,11 @@ #include <osl/file.hxx> #include <unotools/bootstrap.hxx> #include <unotools/tempfile.hxx> +#include <unotools/localedatawrapper.hxx> +#include <unotools/securityoptions.hxx> #include <rtl/uri.hxx> #include <vcl/commandinfoprovider.hxx> +#include <vcl/keycod.hxx> #include <vcl/layout.hxx> #include <vcl/waitobj.hxx> #include <vcl/weld.hxx> @@ -680,6 +683,25 @@ OUString SfxHelp::GetHelpText(const OUString& aCommandURL, const weld::Widget* p return sHelpText; } +OUString SfxHelp::GetURLHelpText(const OUString& aURL) +{ + SvtSecurityOptions aSecOpt; + bool bCtrlClickHlink = aSecOpt.IsOptionSet(SvtSecurityOptions::EOption::CtrlClickHyperlink); + + // "ctrl-click to follow link:" for not MacOS + // "⌘-click to follow link:" for MacOs + vcl::KeyCode aCode(KEY_SPACE); + vcl::KeyCode aModifiedCode(KEY_SPACE, KEY_MOD1); + OUString aModStr(aModifiedCode.GetName()); + aModStr = aModStr.replaceFirst(aCode.GetName(), ""); + aModStr = aModStr.replaceAll("+", ""); + OUString aHelpStr + = bCtrlClickHlink ? SfxResId(STR_CTRLCLICKHYPERLINK) : SfxResId(STR_CLICKHYPERLINK); + aHelpStr = aHelpStr.replaceFirst("%{key}", aModStr); + aHelpStr = aHelpStr.replaceFirst("%{link}", aURL); + return aHelpStr; +} + void SfxHelp::SearchKeyword( const OUString& rKeyword ) { Start_Impl(OUString(), static_cast<vcl::Window*>(nullptr), rKeyword); |