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 /toolkit | |
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 'toolkit')
-rw-r--r-- | toolkit/source/controls/grid/gridcontrol.cxx | 9 | ||||
-rw-r--r-- | toolkit/source/hatchwindow/documentcloser.cxx | 9 |
2 files changed, 2 insertions, 16 deletions
diff --git a/toolkit/source/controls/grid/gridcontrol.cxx b/toolkit/source/controls/grid/gridcontrol.cxx index 0fb9e9695958..bd4c12e692f8 100644 --- a/toolkit/source/controls/grid/gridcontrol.cxx +++ b/toolkit/source/controls/grid/gridcontrol.cxx @@ -167,15 +167,8 @@ namespace { void lcl_dispose_nothrow( const Any& i_component ) { - try - { - const Reference< XComponent > xComponent( i_component, UNO_QUERY_THROW ); + if (auto xComponent = i_component.query<XComponent>() ) xComponent->dispose(); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION("toolkit.controls"); - } } } diff --git a/toolkit/source/hatchwindow/documentcloser.cxx b/toolkit/source/hatchwindow/documentcloser.cxx index 6ef68a6a8845..37f72c701f73 100644 --- a/toolkit/source/hatchwindow/documentcloser.cxx +++ b/toolkit/source/hatchwindow/documentcloser.cxx @@ -124,15 +124,8 @@ IMPL_STATIC_LINK( MainThreadFrameCloserRequest, worker, void*, p, void ) // ignore all the errors } - try - { - uno::Reference< util::XCloseable > xCloseable( pMTRequest->m_xFrame, uno::UNO_QUERY_THROW ); + if (auto xCloseable = pMTRequest->m_xFrame.query<util::XCloseable>() ) xCloseable->close( true ); - } - catch( uno::Exception& ) - { - // ignore all the errors - } } delete pMTRequest; |