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 /sc/source/filter/oox | |
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 'sc/source/filter/oox')
-rw-r--r-- | sc/source/filter/oox/numberformatsbuffer.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/oox/pivotcachebuffer.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/oox/pivottablebuffer.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/oox/worksheethelper.cxx | 9 |
4 files changed, 28 insertions, 5 deletions
diff --git a/sc/source/filter/oox/numberformatsbuffer.cxx b/sc/source/filter/oox/numberformatsbuffer.cxx index 8aa9124d882b..447878000226 100644 --- a/sc/source/filter/oox/numberformatsbuffer.cxx +++ b/sc/source/filter/oox/numberformatsbuffer.cxx @@ -1866,8 +1866,14 @@ private: NumberFormatFinalizer::NumberFormatFinalizer( const WorkbookHelper& rHelper ) : maEnUsLocale( "en", "US", OUString() ) { - if (auto xNumFmtsSupp = rHelper.getDocument().query<XNumberFormatsSupplier>() ) + try + { + Reference< XNumberFormatsSupplier > xNumFmtsSupp( rHelper.getDocument(), UNO_QUERY_THROW ); mxNumFmts = xNumFmtsSupp->getNumberFormats(); + } + catch( Exception& ) + { + } OSL_ENSURE( mxNumFmts.is(), "NumberFormatFinalizer::NumberFormatFinalizer - cannot get number formats" ); } diff --git a/sc/source/filter/oox/pivotcachebuffer.cxx b/sc/source/filter/oox/pivotcachebuffer.cxx index 3655ffc40391..d8cf350bf9a5 100644 --- a/sc/source/filter/oox/pivotcachebuffer.cxx +++ b/sc/source/filter/oox/pivotcachebuffer.cxx @@ -646,8 +646,14 @@ OUString PivotCacheField::createDateGroupField( const Reference< XDataPilotField default: OSL_FAIL( "PivotCacheField::convertRangeGrouping - unknown date/time interval" ); } - if (auto xDPGrouping = rxBaseDPField.query<XDataPilotFieldGrouping>() ) + try + { + Reference< XDataPilotFieldGrouping > xDPGrouping( rxBaseDPField, UNO_QUERY_THROW ); xDPGroupField = xDPGrouping->createDateGroup( aGroupInfo ); + } + catch( Exception& ) + { + } } Reference< XNamed > xFieldName( xDPGroupField, UNO_QUERY ); diff --git a/sc/source/filter/oox/pivottablebuffer.cxx b/sc/source/filter/oox/pivottablebuffer.cxx index 08c0bc8a7dca..637637eb378c 100644 --- a/sc/source/filter/oox/pivottablebuffer.cxx +++ b/sc/source/filter/oox/pivottablebuffer.cxx @@ -1409,8 +1409,14 @@ Reference< XDataPilotField > PivotTable::getDataPilotField( sal_Int32 nFieldIdx Reference< XDataPilotField > PivotTable::getDataLayoutField() const { Reference< XDataPilotField > xDPField; - if (auto xDPDataFieldSupp = mxDPDescriptor.query<XDataPilotDataLayoutFieldSupplier>() ) + try + { + Reference< XDataPilotDataLayoutFieldSupplier > xDPDataFieldSupp( mxDPDescriptor, UNO_QUERY_THROW ); xDPField = xDPDataFieldSupp->getDataLayoutField(); + } + catch( Exception& ) + { + } return xDPField; } diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx index 34d393c08b3e..495cc0ff7828 100644 --- a/sc/source/filter/oox/worksheethelper.cxx +++ b/sc/source/filter/oox/worksheethelper.cxx @@ -527,8 +527,13 @@ Reference< XCellRange > WorksheetGlobals::getRow( sal_Int32 nRow ) const Reference< XDrawPage > WorksheetGlobals::getDrawPage() const { Reference< XDrawPage > xDrawPage; - if (auto xSupplier = mxSheet.query<XDrawPageSupplier>()) - xDrawPage = xSupplier->getDrawPage(); + try + { + xDrawPage = Reference< XDrawPageSupplier >( mxSheet, UNO_QUERY_THROW )->getDrawPage(); + } + catch( Exception& ) + { + } return xDrawPage; } |