diff options
author | Armin Le Grand <alg@apache.org> | 2012-06-21 14:25:25 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-15 10:12:59 +0100 |
commit | 1ba29be90f7141077f2d079d40dffc2efd4f1a2c (patch) | |
tree | fb14188199683ece6c3f95520ef9ee921dce74ae /comphelper/source | |
parent | 9c82c2734553690b38fa47afb7e026b6e38787c4 (diff) |
Resolves: #i119941# Avoid crash when chart is removed in Writer...
by keeping it's storage and graphic stream.
Patch by: Clarence Guo, zhaoshzh
Review by: alg
Found by: Shan Zhu
(cherry picked from commit 0b71c735dc10202b26972cf91779954b6a96af9a)
Conflicts:
comphelper/inc/comphelper/embeddedobjectcontainer.hxx
comphelper/source/container/embeddedobjectcontainer.cxx
Change-Id: I6ec172644806309d0f06f8522eb8a2adb45899ed
Diffstat (limited to 'comphelper/source')
-rw-r--r-- | comphelper/source/container/embeddedobjectcontainer.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx index 6acf6d800c94..99bccd07fea6 100644 --- a/comphelper/source/container/embeddedobjectcontainer.cxx +++ b/comphelper/source/container/embeddedobjectcontainer.cxx @@ -923,13 +923,15 @@ sal_Bool EmbeddedObjectContainer::MoveEmbeddedObject( EmbeddedObjectContainer& r return bRet; } -sal_Bool EmbeddedObjectContainer::RemoveEmbeddedObject( const OUString& rName, sal_Bool bClose ) +// #i119941, bKeepToTempStorage: use to specify whether store the removed object to temporary storage+ +sal_Bool EmbeddedObjectContainer::RemoveEmbeddedObject( const OUString& rName, sal_Bool bClose, sal_Bool bKeepToTempStorage ) { RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::RemoveEmbeddedObject( Name )" ); uno::Reference < embed::XEmbeddedObject > xObj = GetEmbeddedObject( rName ); if ( xObj.is() ) - return RemoveEmbeddedObject( xObj, bClose ); + //return RemoveEmbeddedObject( xObj, bClose ); + return RemoveEmbeddedObject( xObj, bClose, bKeepToTempStorage ); else return sal_False; } @@ -987,7 +989,9 @@ sal_Bool EmbeddedObjectContainer::MoveEmbeddedObject( const OUString& rName, Emb return sal_False; } -sal_Bool EmbeddedObjectContainer::RemoveEmbeddedObject( const uno::Reference < embed::XEmbeddedObject >& xObj, sal_Bool bClose ) +//sal_Bool EmbeddedObjectContainer::RemoveEmbeddedObject( const uno::Reference < embed::XEmbeddedObject >& xObj, sal_Bool bClose ) +// #i119941, bKeepToTempStorage: use to specify whether store the removed object to temporary storage+ +sal_Bool EmbeddedObjectContainer::RemoveEmbeddedObject( const uno::Reference < embed::XEmbeddedObject >& xObj, sal_Bool bClose, sal_Bool bKeepToTempStorage ) { RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::RemoveEmbeddedObject( Object )" ); @@ -1024,7 +1028,8 @@ sal_Bool EmbeddedObjectContainer::RemoveEmbeddedObject( const uno::Reference < e // somebody still needs the object, so we must assign a temporary persistence try { - if ( xPersist.is() ) + // if ( xPersist.is() ) + if ( xPersist.is() && bKeepToTempStorage ) // #i119941 { /* //TODO/LATER: needs storage handling! Why not letting the object do it?! @@ -1105,7 +1110,7 @@ sal_Bool EmbeddedObjectContainer::RemoveEmbeddedObject( const uno::Reference < e OSL_ENSURE( bFound, "Object not found for removal!" ); (void)bFound; - if ( xPersist.is() ) + if ( xPersist.is() && bKeepToTempStorage ) // #i119941# { // remove replacement image (if there is one) RemoveGraphicStream( aName ); |