diff options
author | Oliver Bolte <obo@openoffice.org> | 2005-04-18 13:40:00 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2005-04-18 13:40:00 +0000 |
commit | 0b01c97a42bcfdd6b46757f7b3009a83b4178755 (patch) | |
tree | 80341e63d9bca353bddc69703cbde6e9cf822270 /svx/source/svdraw | |
parent | 852fd44d6c42b647d81f40d7dd65026e674b77b4 (diff) |
INTEGRATION: CWS olefix (1.57.22); FILE MERGED
2005/04/07 11:23:30 mba 1.57.22.2: #i46712#: remove assertion because it is not always possible to avoid it
2005/04/06 17:01:25 mba 1.57.22.1: #i46812#: object must be moved in SetModel, not copied
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r-- | svx/source/svdraw/svdoole2.cxx | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index 5c126fcf8981..fa2e7f878400 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdoole2.cxx,v $ * - * $Revision: 1.58 $ + * $Revision: 1.59 $ * - * last change: $Author: obo $ $Date: 2005-04-18 11:19:29 $ + * last change: $Author: obo $ $Date: 2005-04-18 14:40:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -475,7 +475,9 @@ void SdrOle2Obj::Connect() if( mpImpl->mbConnected ) { - DBG_ERROR("Connect() called on connected object!"); + // mba: currently there are situations where it seems to be unavoidable to have multiple connects + // changing this would need a larger code rewrite, so for now I remove the assertion + // DBG_ERROR("Connect() called on connected object!"); return; } @@ -882,8 +884,17 @@ void SdrOle2Obj::SetModel(SdrModel* pNewModel) if ( xObjRef.is() ) { - // if the object already assigned to the helper the new one must be assigned + // if the object is already assigned to the helper + uno::Reference < embed::XEmbeddedObject > xOldObj = xObjRef.GetObject(); + + // remove lock to enable closing the file without assigning to a temporary container + xObjRef.Lock(FALSE); + + // remove all listeners xObjRef.Clear(); + + // remove object from container (because it is no assigned to another model/container) + rContainer.RemoveEmbeddedObject( xOldObj ); } mpImpl->aPersistName = aTmp; @@ -1313,17 +1324,15 @@ void SdrOle2Obj::operator=(const SdrObject& rObj) { // setting of VisArea not necessary for objects that don't cache it in loaded state } - catch( embed::NoVisualAreaSizeException& ) - { - // objects my not have visual areas - } - catch( uno::Exception& e ) - { - (void)e; - DBG_ERROR( "SdrOle2Obj::operator=(), unexcpected exception caught!" ); - } - - Disconnect(); + catch( embed::NoVisualAreaSizeException& ) + { + // objects my not have visual areas + } + catch( uno::Exception& e ) + { + (void)e; + DBG_ERROR( "SdrOle2Obj::operator=(), unexcpected exception caught!" ); + } } } } |