summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir.extern@allotropia.de>2023-12-18 17:28:20 +0300
committerSarper Akdemir <sarper.akdemir.extern@allotropia.de>2023-12-21 07:49:16 +0100
commit09b13f3f85b3ef6ffe4d46e2ca5170ad81045ff4 (patch)
tree29f6b674275a576d5bc96fd3f26e5c44c63f4d51 /sc
parenta2a9850217b3f711440283131fdfc58a9a254919 (diff)
tdf#158375: adapt UI when DDE is disabled via DisableActiveContent
When DisableActiveContent is set, provide now non-functional areas meaningful error messages / popup dialogs. Change-Id: I34bffee10fb0ba5c0194193f3d3d81b93d7dbd26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160923 Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de> Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/strings.hrc1
-rw-r--r--sc/source/ui/docshell/docsh4.cxx7
-rw-r--r--sc/source/ui/view/tabvwshb.cxx10
3 files changed, 18 insertions, 0 deletions
diff --git a/sc/inc/strings.hrc b/sc/inc/strings.hrc
index d58777176e52..266cb4cc6c5b 100644
--- a/sc/inc/strings.hrc
+++ b/sc/inc/strings.hrc
@@ -371,6 +371,7 @@
#define STR_ENABLE_CONTENT NC_("STR_ENABLE_CONTENT", "Allow updating")
/*tooltip for the "Allow updating" infobar button*/
#define STR_ENABLE_CONTENT_TOOLTIP NC_("STR_ENABLE_CONTENT_TOOLTIP", "Only allow updating if you trust this document.")
+#define STR_ENABLE_CONTENT_TOOLTIP_DISABLED NC_("STR_ENABLE_CONTENT_TOOLTIP_DISABLED", "Active content is disabled in the security settings. It is not possible to allow updating.")
/*Insert image dialog*/
#define STR_ANCHOR_TO_CELL NC_("STR_ANCHOR_TO_CELL", "To cell")
#define STR_ANCHOR_TO_CELL_RESIZE NC_("STR_ANCHOR_TO_CELL_RESIZE", "To cell (resize with cell)")
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 964515743c27..4de5b1950183 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -566,6 +566,13 @@ void ScDocShell::Execute( SfxRequest& rReq )
rBtn.set_label(ScResId(STR_ENABLE_CONTENT));
rBtn.set_tooltip_text(ScResId(STR_ENABLE_CONTENT_TOOLTIP));
rBtn.connect_clicked(LINK(this, ScDocShell, ReloadAllLinksHdl));
+
+ // when active content is disabled the "Allow updating" button has no functionality.
+ if (officecfg::Office::Common::Security::Scripting::DisableActiveContent::get())
+ {
+ rBtn.set_tooltip_text(ScResId(STR_ENABLE_CONTENT_TOOLTIP_DISABLED));
+ rBtn.set_sensitive(false);
+ }
}
}
rReq.Done();
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index f0415d03d9aa..ad0e757ce0aa 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -64,6 +64,7 @@
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <svx/svdpagv.hxx>
#include <o3tl/temporary.hxx>
+#include <officecfg/Office/Common.hxx>
#include <comphelper/lok.hxx>
@@ -485,6 +486,15 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
case SID_LINKS:
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ if (officecfg::Office::Common::Security::Scripting::DisableActiveContent::get())
+ {
+ std::unique_ptr<weld::MessageDialog> xError(Application::CreateMessageDialog(
+ nullptr, VclMessageType::Warning, VclButtonsType::Ok,
+ SvtResId(STR_WARNING_EXTERNAL_LINK_EDIT_DISABLED)));
+ xError->run();
+ break;
+ }
+
ScopedVclPtr<SfxAbstractLinksDialog> pDlg(pFact->CreateLinksDialog(pWin->GetFrameWeld(), rDoc.GetLinkManager()));
pDlg->Execute();
rBindings.Invalidate( nSlot );