diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-08-13 11:35:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-08-13 19:36:37 +0200 |
commit | ade52eb721524e3717f47ccd97e0aa2018b96cb0 (patch) | |
tree | 7293c6b5bf077d14479ca3f714cf0a1942d1f709 /vbahelper/source/vbahelper/vbadocumentsbase.cxx | |
parent | cd72aca086ff84467d51f6864c58648c3322c53f (diff) |
use less exception throwing for flow control
Change-Id: I7ad023479229f89918e588eb8dc7431b5830b45d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171813
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vbahelper/source/vbahelper/vbadocumentsbase.cxx')
-rw-r--r-- | vbahelper/source/vbahelper/vbadocumentsbase.cxx | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx b/vbahelper/source/vbahelper/vbadocumentsbase.cxx index 4821fc5c1c09..ec7694c59294 100644 --- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx @@ -206,12 +206,23 @@ void lclSetupComponent( const uno::Reference< lang::XComponent >& rxComponent, b { } - if( !bInteractive ) try + if( bInteractive ) + return; + try { - uno::Reference< frame::XModel > xModel( rxComponent, uno::UNO_QUERY_THROW ); - uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_SET_THROW ); - uno::Reference< frame::XFrame > xFrame( xController->getFrame(), uno::UNO_SET_THROW ); - uno::Reference< awt::XWindow >( xFrame->getContainerWindow(), uno::UNO_SET_THROW )->setEnable( false ); + uno::Reference< frame::XModel > xModel( rxComponent, uno::UNO_QUERY ); + if (!xModel) + return; + uno::Reference< frame::XController > xController( xModel->getCurrentController() ); + if (!xController) + return; + uno::Reference< frame::XFrame > xFrame( xController->getFrame() ); + if (!xFrame) + return; + uno::Reference< awt::XWindow > xWindow( xFrame->getContainerWindow() ); + if (!xWindow) + return; + xWindow->setEnable( false ); } catch( uno::Exception& ) { |