summaryrefslogtreecommitdiff
path: root/sc/source/filter/oox
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/filter/oox')
-rw-r--r--sc/source/filter/oox/numberformatsbuffer.cxx8
-rw-r--r--sc/source/filter/oox/pivotcachebuffer.cxx8
-rw-r--r--sc/source/filter/oox/pivottablebuffer.cxx8
-rw-r--r--sc/source/filter/oox/worksheethelper.cxx9
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;
}