diff options
author | Mikhail Voitenko <mav@openoffice.org> | 2003-11-20 16:02:23 +0000 |
---|---|---|
committer | Mikhail Voitenko <mav@openoffice.org> | 2003-11-20 16:02:23 +0000 |
commit | 5626361cf9ece879472e25c67e34a799077567d1 (patch) | |
tree | 9a13857f6e8b476afe5a25963810ab428a4a0e66 /embeddedobj/source/commonembedding/miscobj.cxx | |
parent | 0c41b7e23e10e05ee7aa198f1181a75f158fb7e4 (diff) |
#112923# do not close stream untill it is needed
Diffstat (limited to 'embeddedobj/source/commonembedding/miscobj.cxx')
-rw-r--r-- | embeddedobj/source/commonembedding/miscobj.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx index ae6da5552d..b6812e8131 100644 --- a/embeddedobj/source/commonembedding/miscobj.cxx +++ b/embeddedobj/source/commonembedding/miscobj.cxx @@ -2,9 +2,9 @@ * * $RCSfile: miscobj.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: mav $ $Date: 2003-11-18 12:47:06 $ + * last change: $Author: mav $ $Date: 2003-11-20 17:02:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -467,6 +467,23 @@ void SAL_CALL OCommonEmbeddedObject::close( sal_Bool bDeliverOwnership ) m_pDocHolder = NULL; } + // TODO: for now the storage will be disposed by the object, but after the document + // will use the storage, the storage will be disposed by the document and recreated by the object + if ( m_xObjectStorage.is() ) + { + uno::Reference< lang::XComponent > xComp( m_xObjectStorage, uno::UNO_QUERY ); + OSL_ENSURE( xComp.is(), "Storage does not support XComponent!\n" ); + + if ( xComp.is() ) + { + try { + xComp->dispose(); + } catch ( uno::Exception& ) {} + } + + m_xObjectStorage = uno::Reference< embed::XStorage >(); + } + m_bClosed = sal_True; // the closing succeeded } |