diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-08-13 13:29:23 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-08-14 12:56:50 +0200 |
commit | 14b7b50701e3874034f7f98a73794ba8a79792bf (patch) | |
tree | d94492a3b9b19349edb10ba580f4e0ee60fa6953 /ucb/source/ucp/cmis | |
parent | efe65eaaacfd155bfc38b91f51ed4e7e1d41c659 (diff) |
use less exception throwing for flow control
Change-Id: I289f1a2204af02576a585392b7f428a5dc65cf1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171850
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Diffstat (limited to 'ucb/source/ucp/cmis')
-rw-r--r-- | ucb/source/ucp/cmis/cmis_datasupplier.cxx | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/ucb/source/ucp/cmis/cmis_datasupplier.cxx b/ucb/source/ucp/cmis/cmis_datasupplier.cxx index 2a91770cd8f6..21ac2602de41 100644 --- a/ucb/source/ucp/cmis/cmis_datasupplier.cxx +++ b/ucb/source/ucp/cmis/cmis_datasupplier.cxx @@ -107,34 +107,34 @@ namespace cmis } } - if ( getResult( nIndex ) ) + if ( !getResult( nIndex ) ) + return {}; + + uno::Reference< ucb::XContent > xContent( queryContent( nIndex ) ); + if ( !xContent ) + return {}; + try { - uno::Reference< ucb::XContent > xContent( queryContent( nIndex ) ); - if ( xContent.is() ) + uno::Reference< ucb::XCommandProcessor > xCmdProc( xContent, uno::UNO_QUERY ); + if ( !xCmdProc ) + return {}; + sal_Int32 nCmdId( xCmdProc->createCommandIdentifier() ); + ucb::Command aCmd; + aCmd.Name = "getPropertyValues"; + aCmd.Handle = -1; + aCmd.Argument <<= getResultSet()->getProperties(); + uno::Any aResult( xCmdProc->execute( + aCmd, nCmdId, getResultSet()->getEnvironment() ) ); + uno::Reference< sdbc::XRow > xRow; + if ( aResult >>= xRow ) { - try - { - uno::Reference< ucb::XCommandProcessor > xCmdProc( - xContent, uno::UNO_QUERY_THROW ); - sal_Int32 nCmdId( xCmdProc->createCommandIdentifier() ); - ucb::Command aCmd; - aCmd.Name = "getPropertyValues"; - aCmd.Handle = -1; - aCmd.Argument <<= getResultSet()->getProperties(); - uno::Any aResult( xCmdProc->execute( - aCmd, nCmdId, getResultSet()->getEnvironment() ) ); - uno::Reference< sdbc::XRow > xRow; - if ( aResult >>= xRow ) - { - maResults[ nIndex ].xRow = xRow; - return xRow; - } - } - catch ( uno::Exception const & ) - { - } + maResults[ nIndex ].xRow = xRow; + return xRow; } } + catch ( uno::Exception const & ) + { + } return uno::Reference< sdbc::XRow >(); } |