diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-08-17 15:42:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-08-18 11:03:02 +0200 |
commit | 7fc6063914432d58d86cfcbd728d967e7c86ebfd (patch) | |
tree | f71fe9f99edaa4e896c78cdf32e34b516194d748 /embedserv/source/embed | |
parent | db83c41d460103df5d80f5bd99816575c4ead5cd (diff) |
use more Reference::query instead of UNO_QUERY_THROW
since querying with exceptions is consideably more expensive
Change-Id: I968a9a40766b2abb0d3058549b0ed44011fd5716
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155791
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'embedserv/source/embed')
-rw-r--r-- | embedserv/source/embed/docholder.cxx | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/embedserv/source/embed/docholder.cxx b/embedserv/source/embed/docholder.cxx index 12300b856517..a70483e0de80 100644 --- a/embedserv/source/embed/docholder.cxx +++ b/embedserv/source/embed/docholder.cxx @@ -603,31 +603,14 @@ void DocumentHolder::FreeOffice() void DocumentHolder::DisconnectFrameDocument( bool bComplete ) { - try - { - uno::Reference< util::XModifyBroadcaster > xModifiable( m_xDocument, uno::UNO_QUERY_THROW ); + if (auto xModifiable = m_xDocument.query<util::XModifyBroadcaster>() ) xModifiable->removeModifyListener( static_cast<util::XModifyListener*>(this) ); - } - catch( const uno::Exception& ) - {} - try - { - uno::Reference< util::XCloseBroadcaster > xBroadcaster( - m_xDocument, uno::UNO_QUERY_THROW ); + if (auto xBroadcaster = m_xDocument.query<util::XCloseBroadcaster>() ) xBroadcaster->removeCloseListener( static_cast<util::XCloseListener*>(this) ); - } - catch( const uno::Exception& ) - {} - try - { - uno::Reference< util::XCloseBroadcaster > xBroadcaster( - m_xFrame, uno::UNO_QUERY_THROW ); + if (auto xBroadcaster = m_xFrame.query<util::XCloseBroadcaster>() ) xBroadcaster->removeCloseListener( static_cast<util::XCloseListener*>(this) ); - } - catch( const uno::Exception& ) - {} if ( bComplete ) { @@ -661,14 +644,8 @@ void DocumentHolder::CloseDocument() void DocumentHolder::CloseFrame() { - try - { - uno::Reference< util::XCloseBroadcaster > xBroadcaster( - m_xFrame, uno::UNO_QUERY_THROW ); + if (auto xBroadcaster = m_xFrame.query<util::XCloseBroadcaster>() ) xBroadcaster->removeCloseListener( static_cast<util::XCloseListener*>(this) ); - } - catch( const uno::Exception& ) - {} uno::Reference<util::XCloseable> xCloseable( m_xFrame,uno::UNO_QUERY); |