diff options
Diffstat (limited to 'embeddedobj/source')
-rw-r--r-- | embeddedobj/source/commonembedding/embedobj.cxx | 4 | ||||
-rw-r--r-- | embeddedobj/source/commonembedding/specialobject.cxx | 5 | ||||
-rw-r--r-- | embeddedobj/source/msole/oleembed.cxx | 5 |
3 files changed, 13 insertions, 1 deletions
diff --git a/embeddedobj/source/commonembedding/embedobj.cxx b/embeddedobj/source/commonembedding/embedobj.cxx index 0b3843852e58..61e5d1f39ef4 100644 --- a/embeddedobj/source/commonembedding/embedobj.cxx +++ b/embeddedobj/source/commonembedding/embedobj.cxx @@ -40,6 +40,7 @@ #include <comphelper/multicontainer2.hxx> #include <comphelper/lok.hxx> #include <sal/log.hxx> +#include <officecfg/Office/Common.hxx> #include <vcl/svapp.hxx> @@ -475,6 +476,9 @@ uno::Sequence< sal_Int32 > const & OCommonEmbeddedObject::GetIntermediateStatesS void SAL_CALL OCommonEmbeddedObject::changeState( sal_Int32 nNewState ) { + if ( officecfg::Office::Common::Security::Scripting::DisableActiveContent::get() + && nNewState != embed::EmbedStates::LOADED ) + throw embed::UnreachableStateException(); ::osl::ResettableMutexGuard aGuard( m_aMutex ); if ( m_bDisposed ) throw lang::DisposedException(); // TODO diff --git a/embeddedobj/source/commonembedding/specialobject.cxx b/embeddedobj/source/commonembedding/specialobject.cxx index 3dc1eb7e47ef..a2f282ed1aae 100644 --- a/embeddedobj/source/commonembedding/specialobject.cxx +++ b/embeddedobj/source/commonembedding/specialobject.cxx @@ -29,6 +29,7 @@ #include <cppuhelper/queryinterface.hxx> #include <osl/diagnose.h> #include <cppuhelper/supportsservice.hxx> +#include <officecfg/Office/Common.hxx> #include <specialobject.hxx> @@ -137,6 +138,10 @@ sal_Int32 SAL_CALL OSpecialEmbeddedObject::getMapUnit( sal_Int64 nAspect ) void SAL_CALL OSpecialEmbeddedObject::changeState( sal_Int32 nNewState ) { + if ( officecfg::Office::Common::Security::Scripting::DisableActiveContent::get() + && nNewState != embed::EmbedStates::LOADED ) + throw embed::UnreachableStateException(); + if ( nNewState == embed::EmbedStates::UI_ACTIVE ) nNewState = embed::EmbedStates::INPLACE_ACTIVE; OCommonEmbeddedObject::changeState( nNewState ); diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx index 8379a78693f1..69b3ca8d239e 100644 --- a/embeddedobj/source/msole/oleembed.cxx +++ b/embeddedobj/source/msole/oleembed.cxx @@ -52,7 +52,7 @@ #include <comphelper/propertyvalue.hxx> #include <sal/log.hxx> #include <comphelper/diagnose_ex.hxx> - +#include <officecfg/Office/Common.hxx> #include <targetstatecontrol.hxx> @@ -438,6 +438,9 @@ bool OleEmbeddedObject::TryToConvertToOOo( const uno::Reference< io::XStream >& void SAL_CALL OleEmbeddedObject::changeState( sal_Int32 nNewState ) { + if ( officecfg::Office::Common::Security::Scripting::DisableActiveContent::get() + && nNewState != embed::EmbedStates::LOADED ) + throw embed::UnreachableStateException(); // begin wrapping related part ==================== uno::Reference< embed::XEmbeddedObject > xWrappedObject = m_xWrappedObject; if ( xWrappedObject.is() ) |