diff options
-rw-r--r-- | embeddedobj/source/msole/oleembed.cxx | 31 | ||||
-rw-r--r-- | embeddedobj/source/msole/olepersist.cxx | 16 |
2 files changed, 22 insertions, 25 deletions
diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx index e8139480b39d..43dcfa865662 100644 --- a/embeddedobj/source/msole/oleembed.cxx +++ b/embeddedobj/source/msole/oleembed.cxx @@ -63,26 +63,23 @@ using namespace ::com::sun::star; void OleEmbeddedObject::SwitchComponentToRunningState_Impl() { - if ( m_pOleComponent ) + if ( !m_pOleComponent ) { - try - { - m_pOleComponent->RunObject(); - } - catch( const embed::UnreachableStateException& ) - { - GetRidOfComponent(); - throw; - } - catch( const embed::WrongStateException& ) - { - GetRidOfComponent(); - throw; - } + throw embed::UnreachableStateException(); } - else + try { - throw embed::UnreachableStateException(); + m_pOleComponent->RunObject(); + } + catch( const embed::UnreachableStateException& ) + { + GetRidOfComponent(); + throw; + } + catch( const embed::WrongStateException& ) + { + GetRidOfComponent(); + throw; } } diff --git a/embeddedobj/source/msole/olepersist.cxx b/embeddedobj/source/msole/olepersist.cxx index b8a42b373bc2..92a493ed59b2 100644 --- a/embeddedobj/source/msole/olepersist.cxx +++ b/embeddedobj/source/msole/olepersist.cxx @@ -1013,16 +1013,16 @@ void OleEmbeddedObject::StoreObjectToStream( uno::Reference< io::XOutputStream > // TODO: use bStoreVisReplace - if ( xTempInStream.is() ) + if ( !xTempInStream.is() ) { - // write all the contents to XOutStream - uno::Reference< io::XTruncate > xTrunc( xOutStream, uno::UNO_QUERY_THROW ); - xTrunc->truncate(); - - ::comphelper::OStorageHelper::CopyInputToOutput( xTempInStream, xOutStream ); - } - else throw io::IOException(); // TODO: + } + + // write all the contents to XOutStream + uno::Reference< io::XTruncate > xTrunc( xOutStream, uno::UNO_QUERY_THROW ); + xTrunc->truncate(); + + ::comphelper::OStorageHelper::CopyInputToOutput( xTempInStream, xOutStream ); // TODO: should the view replacement be in the stream ??? // probably it must be specified on storing |