diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-27 09:11:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-27 11:02:56 +0200 |
commit | cc1ed7fbce20f90650f96acc2846b6f232c8ab0f (patch) | |
tree | fcd441cdf9568861363894f63107967adf571f81 /embeddedobj/source/msole/oleembed.cxx | |
parent | b50f595b34585f2927adfd44b4eaaafb8f600972 (diff) |
loplugin:flatten in various
Change-Id: I42dca691ffadbddad38a7e8f978b1da9d5d9a7b0
Reviewed-on: https://gerrit.libreoffice.org/42842
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'embeddedobj/source/msole/oleembed.cxx')
-rw-r--r-- | embeddedobj/source/msole/oleembed.cxx | 104 |
1 files changed, 51 insertions, 53 deletions
diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx index b00cea109890..e8139480b39d 100644 --- a/embeddedobj/source/msole/oleembed.cxx +++ b/embeddedobj/source/msole/oleembed.cxx @@ -903,75 +903,73 @@ void SAL_CALL OleEmbeddedObject::doVerb( sal_Int32 nVerbID ) else #endif { - if ( nVerbID == -9 ) + if ( nVerbID != -9 ) { - // the workaround verb to show the object in case no server is available - // if it is possible, the object will be converted to OOo format - if ( !m_bTriedConversion ) + throw embed::UnreachableStateException(); + } + + // the workaround verb to show the object in case no server is available + + // if it is possible, the object will be converted to OOo format + if ( !m_bTriedConversion ) + { + m_bTriedConversion = true; + if ( TryToConvertToOOo( m_xObjectStream ) ) { - m_bTriedConversion = true; - if ( TryToConvertToOOo( m_xObjectStream ) ) - { - changeState( embed::EmbedStates::ACTIVE ); - return; - } + changeState( embed::EmbedStates::ACTIVE ); + return; } + } - if ( !m_xOwnView.is() && m_xObjectStream.is() && m_aFilterName != "Text" ) - { - try { - uno::Reference< io::XSeekable > xSeekable( m_xObjectStream, uno::UNO_QUERY ); - if ( xSeekable.is() ) - xSeekable->seek( 0 ); + if ( !m_xOwnView.is() && m_xObjectStream.is() && m_aFilterName != "Text" ) + { + try { + uno::Reference< io::XSeekable > xSeekable( m_xObjectStream, uno::UNO_QUERY ); + if ( xSeekable.is() ) + xSeekable->seek( 0 ); - m_xOwnView = new OwnView_Impl( m_xFactory, m_xObjectStream->getInputStream() ); - } - catch( uno::RuntimeException& ) - { - throw; - } - catch (uno::Exception const& e) - { - SAL_WARN("embeddedobj.ole", "OleEmbeddedObject::doVerb: " - "-9 fallback path: exception caught: " << e.Message); - } + m_xOwnView = new OwnView_Impl( m_xFactory, m_xObjectStream->getInputStream() ); } - - // it may be the OLE Storage, try to extract stream - if ( !m_xOwnView.is() && m_xObjectStream.is() && m_aFilterName == "Text" ) + catch( uno::RuntimeException& ) { - uno::Reference< io::XStream > xStream = lcl_ExtractObjectStream( m_xFactory, m_xObjectStream ); - - if ( TryToConvertToOOo( xStream ) ) - { - changeState( embed::EmbedStates::ACTIVE ); - return; - } + throw; } - - if (!m_xOwnView.is() || !m_xOwnView->Open()) + catch (uno::Exception const& e) { - //Make a RO copy and see if the OS can find something to at - //least display the content for us - if (m_aTempDumpURL.isEmpty()) - m_aTempDumpURL = lcl_ExtractObject(m_xFactory, m_xObjectStream); + SAL_WARN("embeddedobj.ole", "OleEmbeddedObject::doVerb: " + "-9 fallback path: exception caught: " << e.Message); + } + } - if (!m_aTempDumpURL.isEmpty()) - { - uno::Reference< css::system::XSystemShellExecute > xSystemShellExecute( - css::system::SystemShellExecute::create(comphelper::getComponentContext(m_xFactory)) ); - xSystemShellExecute->execute(m_aTempDumpURL, OUString(), css::system::SystemShellExecuteFlags::URIS_ONLY); - } - else - throw embed::UnreachableStateException(); + // it may be the OLE Storage, try to extract stream + if ( !m_xOwnView.is() && m_xObjectStream.is() && m_aFilterName == "Text" ) + { + uno::Reference< io::XStream > xStream = lcl_ExtractObjectStream( m_xFactory, m_xObjectStream ); + + if ( TryToConvertToOOo( xStream ) ) + { + changeState( embed::EmbedStates::ACTIVE ); + return; } } - else + + if (!m_xOwnView.is() || !m_xOwnView->Open()) { + //Make a RO copy and see if the OS can find something to at + //least display the content for us + if (m_aTempDumpURL.isEmpty()) + m_aTempDumpURL = lcl_ExtractObject(m_xFactory, m_xObjectStream); + + if (m_aTempDumpURL.isEmpty()) + throw embed::UnreachableStateException(); + + uno::Reference< css::system::XSystemShellExecute > xSystemShellExecute( + css::system::SystemShellExecute::create(comphelper::getComponentContext(m_xFactory)) ); + xSystemShellExecute->execute(m_aTempDumpURL, OUString(), css::system::SystemShellExecuteFlags::URIS_ONLY); - throw embed::UnreachableStateException(); } + } } |