diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index dd75a88b06fc..4d805f65113a 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -318,7 +319,7 @@ void ModulWindow::BasicExecute() { // #116444# check security settings before macro execution ScriptDocument aDocument( GetDocument() ); - bool bMacrosDisabled = officecfg::Office::Common::Security::Scripting::DisableMacrosExecution::get(); + bool bMacrosDisabled = SvtSecurityOptions::IsMacroDisabled(); if (bMacrosDisabled || (aDocument.isDocument() && !aDocument.allowMacros())) { std::unique_ptr xBox( diff --git a/framework/source/uielement/macrosmenucontroller.cxx b/framework/source/uielement/macrosmenucontroller.cxx index 9899b9fa6ac2..1e78355d7738 100644 --- a/framework/source/uielement/macrosmenucontroller.cxx +++ b/framework/source/uielement/macrosmenucontroller.cxx @@ -28,6 +28,7 @@ #include #include #include +#include using namespace com::sun::star::uno; using namespace com::sun::star::lang; @@ -67,8 +68,7 @@ MacrosMenuController::~MacrosMenuController() // private function void MacrosMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > const & rPopupMenu ) { - bool bMacrosDisabled = officecfg::Office::Common::Security::Scripting::DisableMacrosExecution::get(); - if (bMacrosDisabled) + if (SvtSecurityOptions::IsMacroDisabled()) return; SolarMutexGuard aSolarMutexGuard; diff --git a/scripting/Library_protocolhandler.mk b/scripting/Library_protocolhandler.mk index 31599c3d865b..d0fb4169625a 100644 --- a/scripting/Library_protocolhandler.mk +++ b/scripting/Library_protocolhandler.mk @@ -32,6 +32,7 @@ $(eval $(call gb_Library_use_libraries,protocolhandler,\ sal \ sfx \ tl \ + utl \ vcl \ )) diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx index bcf53854ebf6..5e87f1623e7d 100644 --- a/scripting/source/protocolhandler/scripthandler.cxx +++ b/scripting/source/protocolhandler/scripthandler.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -117,7 +118,7 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification( const URL& aURL, const Sequence < PropertyValue >& lArgs, const Reference< XDispatchResultListener >& xListener ) { - if (officecfg::Office::Common::Security::Scripting::DisableMacrosExecution::get()) + if (SvtSecurityOptions::IsMacroDisabled()) return; sal_Int16 aState = css::frame::DispatchResultState::FAILURE; diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index fdc4a8e0b3ee..ad24a1ec6092 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -72,6 +72,7 @@ #include #include +#include #include #include @@ -2057,9 +2058,7 @@ void SfxApplication::OfaState_Impl(SfxItemSet &rSet) if ( comphelper::LibreOfficeKit::isActive() ) rSet.DisableItem( SID_AUTO_CORRECT_DLG ); - bool bMacrosDisabled - = officecfg::Office::Common::Security::Scripting::DisableMacrosExecution::get(); - if (bMacrosDisabled) + if (SvtSecurityOptions::IsMacroDisabled()) { rSet.DisableItem(SID_RUNMACRO); rSet.DisableItem(SID_MACROORGANIZER); diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index da03b23e6cf9..2d150615bf2a 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -3401,8 +3401,7 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet) case SID_RECORDMACRO : { const OUString& sName{GetObjectShell()->GetFactory().GetFactoryName()}; - bool bMacrosDisabled = officecfg::Office::Common::Security::Scripting::DisableMacrosExecution::get(); - if (bMacrosDisabled || + if (SvtSecurityOptions::IsMacroDisabled() || !officecfg::Office::Common::Misc::MacroRecorderMode::get() || ( sName!="swriter" && sName!="scalc" ) ) {