diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-04-04 12:30:40 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-04-04 15:54:24 +0200 |
commit | 321dac0b80c875247ae064e023d107d3ac1caef3 (patch) | |
tree | 630ccb825667dcf544c5e5bc263d63edf780a16e /sc/source/ui/docshell | |
parent | 1d25d32b4dcfbc750b8344cd79279aad0d621edf (diff) |
clarify that the link warning is a security relevant one
add a tooltip to the "allow button" about trust and add a help button
that links to documentation on the risk
Change-Id: I3390c1316d65e1a50c564e11101551a4ed9d6b51
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132508
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui/docshell')
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 3d69269d5a36..15ba7c8abba4 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -40,6 +40,7 @@ using namespace ::com::sun::star; #include <svx/ofaitem.hxx> #include <svl/stritem.hxx> #include <svl/whiter.hxx> +#include <vcl/stdtext.hxx> #include <vcl/svapp.hxx> #include <vcl/weld.hxx> #include <svx/dataaccessdescriptor.hxx> @@ -206,6 +207,21 @@ IMPL_LINK_NOARG( ScDocShell, ReloadAllLinksHdl, weld::Button&, void ) SAL_WARN_IF(!pViewFrame, "sc", "expected there to be a ViewFrame"); } +namespace +{ + class LinkHelp + { + public: + DECL_STATIC_LINK(LinkHelp, DispatchHelpLinksHdl, weld::Button&, void); + }; +} + +IMPL_STATIC_LINK(LinkHelp, DispatchHelpLinksHdl, weld::Button&, rBtn, void) +{ + if (Help* pHelp = Application::GetHelp()) + pHelp->Start(HID_UPDATE_LINK_WARNING, &rBtn); +} + void ScDocShell::Execute( SfxRequest& rReq ) { const SfxItemSet* pReqArgs = rReq.GetArgs(); @@ -525,8 +541,12 @@ void ScDocShell::Execute( SfxRequest& rReq ) auto pInfoBar = pViewFrame->AppendInfoBar("enablecontent", "", ScResId(STR_RELOAD_TABLES), InfobarType::WARNING); if (pInfoBar) { + weld::Button& rHelpBtn = pInfoBar->addButton(); + rHelpBtn.set_label(GetStandardText(StandardButtonType::Help).replaceFirst("~", "")); + rHelpBtn.connect_clicked(LINK(nullptr, LinkHelp, DispatchHelpLinksHdl)); weld::Button& rBtn = pInfoBar->addButton(); rBtn.set_label(ScResId(STR_ENABLE_CONTENT)); + rBtn.set_tooltip_text(ScResId(STR_ENABLE_CONTENT_TOOLTIP)); rBtn.connect_clicked(LINK(this, ScDocShell, ReloadAllLinksHdl)); } } |