diff options
Diffstat (limited to 'svtools/source/misc/embedhlp.cxx')
-rw-r--r-- | svtools/source/misc/embedhlp.cxx | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx index b37209e891de..1ef6cd579b0e 100644 --- a/svtools/source/misc/embedhlp.cxx +++ b/svtools/source/misc/embedhlp.cxx @@ -137,9 +137,16 @@ void SAL_CALL EmbedEventListener_Impl::stateChanged( const lang::EventObject&, uno::Reference < util::XModifiable > xMod( pObject->GetObject()->getComponent(), uno::UNO_QUERY ); if ( nNewState == embed::EmbedStates::RUNNING ) { + bool bProtected = false; + if (pObject->GetIsProtectedHdl().IsSet()) + { + bProtected = pObject->GetIsProtectedHdl().Call(nullptr); + } + // TODO/LATER: container must be set before! // When is this event created? Who sets the new container when it changed? - if( ( pObject->GetViewAspect() != embed::Aspects::MSOLE_ICON ) && nOldState != embed::EmbedStates::LOADED && !pObject->IsChart() ) + if ((pObject->GetViewAspect() != embed::Aspects::MSOLE_ICON) + && nOldState != embed::EmbedStates::LOADED && !pObject->IsChart() && !bProtected) // get new replacement after deactivation pObject->UpdateReplacement(); @@ -241,6 +248,8 @@ struct EmbeddedObjectRef_Impl sal_uInt32 mnGraphicVersion; awt::Size aDefaultSizeForChart_In_100TH_MM;//#i103460# charts do not necessarily have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this member + Link<LinkParamNone*, bool> m_aIsProtectedHdl; + EmbeddedObjectRef_Impl() : pContainer(nullptr), nViewAspect(embed::Aspects::MSOLE_CONTENT), @@ -396,6 +405,16 @@ bool EmbeddedObjectRef::IsLocked() const return mpImpl->bIsLocked; } +void EmbeddedObjectRef::SetIsProtectedHdl(const Link<LinkParamNone*, bool>& rProtectedHdl) +{ + mpImpl->m_aIsProtectedHdl = rProtectedHdl; +} + +Link<LinkParamNone*, bool> EmbeddedObjectRef::GetIsProtectedHdl() const +{ + return mpImpl->m_aIsProtectedHdl; +} + void EmbeddedObjectRef::GetReplacement( bool bUpdate ) { Graphic aOldGraphic; |