diff options
author | Armin Le Grand <alg@apache.org> | 2014-08-07 09:59:26 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-08-12 09:06:55 +0100 |
commit | b6b84b972fc9b997a586ca2e5496eb0617544a1a (patch) | |
tree | 474c986412fe1ea365933c09b3f76d15011db5c0 /svtools | |
parent | 03d44c7670413b730b1445eeab5210cff8245786 (diff) |
Resolves: #i125386# secured user request and changed some bools to bitfield
(cherry picked from commit 5e3cbe056c19bea5018dbf1fd4b2bc8f8b030ff3)
Conflicts:
comphelper/inc/comphelper/embeddedobjectcontainer.hxx
comphelper/source/container/embeddedobjectcontainer.cxx
sfx2/source/appl/linkmgr2.cxx
svtools/source/misc/embedhlp.cxx
Change-Id: I7e9b20a87ca6afe8cb91c577860a6c6b72368ee9
(cherry picked from commit d005acae3aa315921f2c331612131626c470bd22)
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/misc/embedhlp.cxx | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx index 9c1c51db66c9..faa3131f1b53 100644 --- a/svtools/source/misc/embedhlp.cxx +++ b/svtools/source/misc/embedhlp.cxx @@ -606,19 +606,30 @@ SvStream* EmbeddedObjectRef::GetGraphicStream( bool bUpdate ) const if ( !xStream.is() ) { SAL_INFO( "svtools.misc", "getting stream from object" ); - // update wanted or no stream in container storage available - xStream = GetGraphicReplacementStream(mpImpl->nViewAspect, mpImpl->mxObj, &mpImpl->aMediaType); + bool bUserAllowsLinkUpdate(true); + const comphelper::EmbeddedObjectContainer* pContainer = GetContainer(); - if ( xStream.is() ) + if(pContainer) { - if ( mpImpl->pContainer ) - mpImpl->pContainer->InsertGraphicStream( xStream, mpImpl->aPersistName, mpImpl->aMediaType ); + bUserAllowsLinkUpdate = pContainer->getUserAllowsLinkUpdate(); + } - SvStream* pResult = ::utl::UcbStreamHelper::CreateStream( xStream ); - if ( pResult && bUpdate ) - mpImpl->bNeedUpdate = false; + if(bUserAllowsLinkUpdate) + { + // update wanted or no stream in container storage available + xStream = GetGraphicReplacementStream(mpImpl->nViewAspect, mpImpl->mxObj, &mpImpl->aMediaType); - return pResult; + if(xStream.is()) + { + if (mpImpl->pContainer) + mpImpl->pContainer->InsertGraphicStream(xStream,mpImpl->aPersistName,mpImpl->aMediaType); + + SvStream* pResult = ::utl::UcbStreamHelper::CreateStream( xStream ); + if (pResult && bUpdate) + mpImpl->bNeedUpdate = false; + + return pResult; + } } } |