diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-08-25 11:30:42 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-08-25 14:15:56 +0200 |
commit | 87db52ab1e9c39ad8319aaf9c0c59d4435b6ffb5 (patch) | |
tree | 64795c67bc154c4d5bcf4287139d1db7e11c9a6c /embedserv | |
parent | 139cffc531277b57bae8e272fef13af00ace5366 (diff) |
Revert "use more Reference::query instead of UNO_QUERY_THROW"
This reverts commit 7fc6063914432d58d86cfcbd728d967e7c86ebfd.
sberg noticed that there is a difference now:
there's a subtle difference now, in that if y was null originally, it would have thrown a (caught) exception, whereas now it will crash in the y.query<X>() call.
Change-Id: Idbb5a08d635d15b5ca63f4822eddf05fb0a5afa0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156002
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'embedserv')
-rw-r--r-- | embedserv/source/embed/docholder.cxx | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/embedserv/source/embed/docholder.cxx b/embedserv/source/embed/docholder.cxx index a70483e0de80..12300b856517 100644 --- a/embedserv/source/embed/docholder.cxx +++ b/embedserv/source/embed/docholder.cxx @@ -603,14 +603,31 @@ void DocumentHolder::FreeOffice() void DocumentHolder::DisconnectFrameDocument( bool bComplete ) { - if (auto xModifiable = m_xDocument.query<util::XModifyBroadcaster>() ) + try + { + uno::Reference< util::XModifyBroadcaster > xModifiable( m_xDocument, uno::UNO_QUERY_THROW ); xModifiable->removeModifyListener( static_cast<util::XModifyListener*>(this) ); + } + catch( const uno::Exception& ) + {} - if (auto xBroadcaster = m_xDocument.query<util::XCloseBroadcaster>() ) + try + { + uno::Reference< util::XCloseBroadcaster > xBroadcaster( + m_xDocument, uno::UNO_QUERY_THROW ); xBroadcaster->removeCloseListener( static_cast<util::XCloseListener*>(this) ); + } + catch( const uno::Exception& ) + {} - if (auto xBroadcaster = m_xFrame.query<util::XCloseBroadcaster>() ) + try + { + uno::Reference< util::XCloseBroadcaster > xBroadcaster( + m_xFrame, uno::UNO_QUERY_THROW ); xBroadcaster->removeCloseListener( static_cast<util::XCloseListener*>(this) ); + } + catch( const uno::Exception& ) + {} if ( bComplete ) { @@ -644,8 +661,14 @@ void DocumentHolder::CloseDocument() void DocumentHolder::CloseFrame() { - if (auto xBroadcaster = m_xFrame.query<util::XCloseBroadcaster>() ) + try + { + uno::Reference< util::XCloseBroadcaster > xBroadcaster( + m_xFrame, uno::UNO_QUERY_THROW ); xBroadcaster->removeCloseListener( static_cast<util::XCloseListener*>(this) ); + } + catch( const uno::Exception& ) + {} uno::Reference<util::XCloseable> xCloseable( m_xFrame,uno::UNO_QUERY); |