diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-11-11 14:53:51 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-11-12 08:10:07 +0100 |
commit | 6a40737e1feb2e8d1992c46ee6c0e5cf30bab025 (patch) | |
tree | 7aa83c5d10e940341f6f390d897237267919f634 /basctl | |
parent | 11dcd3c742f72dc451aeb36f2c56607c48f477a9 (diff) |
Fix macro disabling in Basic IDE
After 8d69ca60f3c8f53699986f924291a2acda5694a1 macros were always disabled
as ScriptDocument::allowMacros always returned false when called from
non-document context.
Change-Id: Ibef4c7d561f4ee01cd44f5327e4ab948282bb07d
Reviewed-on: https://gerrit.libreoffice.org/82444
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/baside2.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index af35a3a3dc7b..5cb16f8f1f58 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -62,6 +62,7 @@ #include <toolkit/helper/vclunohelper.hxx> #include <cassert> #include <osl/diagnose.h> +#include <officecfg/Office/Common.hxx> namespace basctl { @@ -308,7 +309,8 @@ void ModulWindow::BasicExecute() { // #116444# check security settings before macro execution ScriptDocument aDocument( GetDocument() ); - if (!aDocument.allowMacros()) + bool bMacrosDisabled = officecfg::Office::Common::Security::Scripting::DisableMacrosExecution::get(); + if (bMacrosDisabled || (aDocument.isDocument() && !aDocument.allowMacros())) { std::unique_ptr<weld::MessageDialog> xBox( Application::CreateMessageDialog(GetFrameWeld(), VclMessageType::Warning, |