diff options
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/misc/bindablecontrolhelper.cxx | 6 |
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*/ ) { |