summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-11-11 14:53:51 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2019-12-04 13:42:22 +0100
commitd1b840f2a5057377ac9a57a9b7c6d2a31dc1c780 (patch)
tree9a6981d0aacb2b57615807d8bee564f18dcf2bac
parentSwitch to read-only mode: do not force reload document if possible (diff)
downloadcore-d1b840f2a5057377ac9a57a9b7c6d2a31dc1c780.tar.gz
core-d1b840f2a5057377ac9a57a9b7c6d2a31dc1c780.zip
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>
-rw-r--r--basctl/source/basicide/baside2.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 4ee60fb48146..e9bdd7704613 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -60,6 +60,7 @@
#include <toolkit/helper/vclunohelper.hxx>
#include <cassert>
#include <osl/diagnose.h>
+#include <officecfg/Office/Common.hxx>
namespace basctl
{
@@ -302,7 +303,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,