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-09 14:13:08 +0100 |
commit | d005acae3aa315921f2c331612131626c470bd22 (patch) | |
tree | af56821361fa3207f147ddf393b90ad98945cc85 /comphelper | |
parent | jurt: Number parsing (diff) | |
download | core-d005acae3aa315921f2c331612131626c470bd22.tar.gz core-d005acae3aa315921f2c331612131626c470bd22.zip |
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
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/container/embeddedobjectcontainer.cxx | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx index d614c1a725e9..e3696f1e4403 100644 --- a/comphelper/source/container/embeddedobjectcontainer.cxx +++ b/comphelper/source/container/embeddedobjectcontainer.cxx @@ -62,7 +62,10 @@ struct EmbedImpl uno::WeakReference < uno::XInterface > m_xModel; //EmbeddedObjectContainerNameMap maTempObjectContainer; //uno::Reference < embed::XStorage > mxTempStorage; - bool bOwnsStorage; + + /// bitfield + bool mbOwnsStorage : 1; + bool mbUserAllowsLinkUpdate : 1; const uno::Reference < embed::XStorage >& GetReplacements(); }; @@ -93,7 +96,8 @@ EmbeddedObjectContainer::EmbeddedObjectContainer() { pImpl = new EmbedImpl; pImpl->mxStorage = ::comphelper::OStorageHelper::GetTemporaryStorage(); - pImpl->bOwnsStorage = true; + pImpl->mbOwnsStorage = true; + pImpl->mbUserAllowsLinkUpdate = true; pImpl->mpTempObjectContainer = 0; } @@ -101,7 +105,8 @@ EmbeddedObjectContainer::EmbeddedObjectContainer( const uno::Reference < embed:: { pImpl = new EmbedImpl; pImpl->mxStorage = rStor; - pImpl->bOwnsStorage = false; + pImpl->mbOwnsStorage = false; + pImpl->mbUserAllowsLinkUpdate = true; pImpl->mpTempObjectContainer = 0; } @@ -109,7 +114,8 @@ EmbeddedObjectContainer::EmbeddedObjectContainer( const uno::Reference < embed:: { pImpl = new EmbedImpl; pImpl->mxStorage = rStor; - pImpl->bOwnsStorage = false; + pImpl->mbOwnsStorage = false; + pImpl->mbUserAllowsLinkUpdate = true; pImpl->mpTempObjectContainer = 0; pImpl->m_xModel = xModel; } @@ -118,11 +124,11 @@ void EmbeddedObjectContainer::SwitchPersistence( const uno::Reference < embed::X { ReleaseImageSubStorage(); - if ( pImpl->bOwnsStorage ) + if ( pImpl->mbOwnsStorage ) pImpl->mxStorage->dispose(); pImpl->mxStorage = rStor; - pImpl->bOwnsStorage = false; + pImpl->mbOwnsStorage = false; } bool EmbeddedObjectContainer::CommitImageSubStorage() @@ -178,7 +184,7 @@ EmbeddedObjectContainer::~EmbeddedObjectContainer() { ReleaseImageSubStorage(); - if ( pImpl->bOwnsStorage ) + if ( pImpl->mbOwnsStorage ) pImpl->mxStorage->dispose(); delete pImpl->mpTempObjectContainer; @@ -1337,7 +1343,7 @@ bool EmbeddedObjectContainer::StoreAsChildren(bool _bOasisFormat,bool _bCreateEm xStream = GetGraphicStream( xObj, &aMediaType ); } - if ( !xStream.is() ) + if ( !xStream.is() && getUserAllowsLinkUpdate() ) { // the image must be regenerated // TODO/LATER: another aspect could be used @@ -1626,6 +1632,20 @@ bool EmbeddedObjectContainer::SetPersistentEntries(const uno::Reference< embed:: } return bError; } + +bool EmbeddedObjectContainer::getUserAllowsLinkUpdate() const +{ + return pImpl->mbUserAllowsLinkUpdate; +} + +void EmbeddedObjectContainer::setUserAllowsLinkUpdate(bool bNew) +{ + if(pImpl->mbUserAllowsLinkUpdate != bNew) + { + pImpl->mbUserAllowsLinkUpdate = bNew; + } +} + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |