summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-08-17 15:42:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-08-18 11:03:02 +0200
commit7fc6063914432d58d86cfcbd728d967e7c86ebfd (patch)
treef71fe9f99edaa4e896c78cdf32e34b516194d748 /svtools
parentdb83c41d460103df5d80f5bd99816575c4ead5cd (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 'svtools')
-rw-r--r--svtools/source/misc/bindablecontrolhelper.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/svtools/source/misc/bindablecontrolhelper.cxx b/svtools/source/misc/bindablecontrolhelper.cxx
index ba5494975695..e127c1a55090 100644
--- a/svtools/source/misc/bindablecontrolhelper.cxx
+++ b/svtools/source/misc/bindablecontrolhelper.cxx
@@ -45,9 +45,9 @@ static bool lcl_isNamedRange( const OUString& sAddress, const uno::Reference< fr
uno::Reference< sheet::XCellRangeReferrer > xReferrer;
try
{
- uno::Reference< beans::XPropertySet > xPropSet( xModel, uno::UNO_QUERY_THROW );
- uno::Reference< container::XNameAccess > xNamed( xPropSet->getPropertyValue( "NamedRanges" ), uno::UNO_QUERY_THROW );
- xReferrer.set ( xNamed->getByName( sAddress ), uno::UNO_QUERY );
+ if (auto xPropSet = xModel.query<beans::XPropertySet>() )
+ if (auto xNamed = xPropSet->getPropertyValue( "NamedRanges" ).query<container::XNameAccess>() )
+ xReferrer.set ( xNamed->getByName( sAddress ), uno::UNO_QUERY );
}
catch( uno::Exception& /*e*/ )
{