diff --git a/extensions/Library_oleautobridge.mk b/extensions/Library_oleautobridge.mk index aa6c6d0cf2a6..38bd19eb8f06 100644 --- a/extensions/Library_oleautobridge.mk +++ b/extensions/Library_oleautobridge.mk @@ -11,6 +11,10 @@ $(eval $(call gb_Library_Library,oleautobridge)) +$(eval $(call gb_Library_use_custom_headers,oleautobridge,\ + officecfg/registry \ +)) + $(eval $(call gb_Library_set_componentfile,oleautobridge,extensions/source/ole/oleautobridge,services)) $(eval $(call gb_Library_use_api,oleautobridge,\ diff --git a/extensions/source/ole/servprov.cxx b/extensions/source/ole/servprov.cxx index f5a9323d361d..0c3920ccca11 100644 --- a/extensions/source/ole/servprov.cxx +++ b/extensions/source/ole/servprov.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -144,8 +145,12 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP OneInstanceOleWrapper::CreateInstance(IUnknown SAL_INFO("extensions.olebridge", "OneInstanceOleWrapper::CreateInstance(" << riid << ")"); - HRESULT ret = ResultFromScode(E_UNEXPECTED); + if (officecfg::Office::Common::Security::Scripting::DisableOLEAutomation::get()) + { + return ResultFromScode(E_NOINTERFACE); + } + HRESULT ret = ResultFromScode(E_UNEXPECTED); const Reference& xInst = m_xInstFunction(); if (xInst.is()) { diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index ecd6a05b927b..73de7af3a267 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -2524,6 +2524,13 @@ false + + + Specifies whether or not to disable OLE Automation interface. + + + false + Warn on load when a document binds an event to a macro