diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-09-30 22:43:59 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-09-30 23:33:56 +0200 |
commit | d2978f03bd57e5fe530eb55accc8c5f39b602ff2 (patch) | |
tree | 0d914a6e0ebdbf91f61252dc36e98b3dcab1e615 /embeddedobj/source | |
parent | c3819630e0205a372899ef67d689619657bbbf33 (diff) |
loplugin:flatten (clang-cl, embeddedobj)
Change-Id: I842ab53693f87fc9b5151ce9b8b385a9dbd53e11
Reviewed-on: https://gerrit.libreoffice.org/42977
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'embeddedobj/source')
-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 |