summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-08-25 11:30:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-08-25 14:15:56 +0200
commit87db52ab1e9c39ad8319aaf9c0c59d4435b6ffb5 (patch)
tree64795c67bc154c4d5bcf4287139d1db7e11c9a6c /oox
parent139cffc531277b57bae8e272fef13af00ace5366 (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 'oox')
-rw-r--r--oox/source/drawingml/chart/converterbase.cxx8
-rw-r--r--oox/source/ole/oleobjecthelper.cxx8
-rw-r--r--oox/source/ole/vbamodule.cxx8
3 files changed, 21 insertions, 3 deletions
diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx
index 989a5d58541b..d7130ec9795d 100644
--- a/oox/source/drawingml/chart/converterbase.cxx
+++ b/oox/source/drawingml/chart/converterbase.cxx
@@ -277,9 +277,15 @@ void ConverterRoot::registerTitleLayout( const Reference< XTitle >& rxTitle,
void ConverterRoot::convertTitlePositions()
{
- if (auto xChart1Doc = mxData->mxDoc.query<cssc::XChartDocument>() )
+ try
+ {
+ Reference< cssc::XChartDocument > xChart1Doc( mxData->mxDoc, UNO_QUERY_THROW );
for (auto & title : mxData->maTitles)
title.second.convertTitlePos( *this, xChart1Doc );
+ }
+ catch( Exception& )
+ {
+ }
}
namespace {
diff --git a/oox/source/ole/oleobjecthelper.cxx b/oox/source/ole/oleobjecthelper.cxx
index d1f1baf25448..b71f1ade194a 100644
--- a/oox/source/ole/oleobjecthelper.cxx
+++ b/oox/source/ole/oleobjecthelper.cxx
@@ -74,8 +74,14 @@ OleObjectHelper::OleObjectHelper(
OleObjectHelper::~OleObjectHelper()
{
- if (auto xResolverComp = mxResolver.query<XComponent>() )
+ try
+ {
+ Reference< XComponent > xResolverComp( mxResolver, UNO_QUERY_THROW );
xResolverComp->dispose();
+ }
+ catch(const Exception& )
+ {
+ }
}
// TODO: this is probably a sub-optimal approach: ideally the media type
diff --git a/oox/source/ole/vbamodule.cxx b/oox/source/ole/vbamodule.cxx
index 1a7fa48d15e9..4bd93cec132c 100644
--- a/oox/source/ole/vbamodule.cxx
+++ b/oox/source/ole/vbamodule.cxx
@@ -323,8 +323,14 @@ void VbaModule::createModule( std::u16string_view rVBASourceCode,
aSourceCode.append( "End Sub\n" );
// insert extended module info
- if (auto xVBAModuleInfo = rxBasicLib.query<XVBAModuleInfo>() )
+ try
+ {
+ Reference< XVBAModuleInfo > xVBAModuleInfo( rxBasicLib, UNO_QUERY_THROW );
xVBAModuleInfo->insertModuleInfo( maName, aModuleInfo );
+ }
+ catch (const Exception&)
+ {
+ }
// insert the module into the passed Basic library
try