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