summaryrefslogtreecommitdiff
path: root/sdext
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 /sdext
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 'sdext')
-rw-r--r--sdext/source/minimizer/impoptimizer.cxx18
-rw-r--r--sdext/source/minimizer/optimizationstats.cxx6
2 files changed, 11 insertions, 13 deletions
diff --git a/sdext/source/minimizer/impoptimizer.cxx b/sdext/source/minimizer/impoptimizer.cxx
index 8cb61f01cb9c..72be9c666086 100644
--- a/sdext/source/minimizer/impoptimizer.cxx
+++ b/sdext/source/minimizer/impoptimizer.cxx
@@ -73,10 +73,10 @@ static void ImpExtractCustomShow( const Reference< XModel >& rxModel, std::u16st
try
{
PageCollector::CollectNonCustomShowPages( rxModel, rCustomShowName, vNonUsedPageList );
- if (auto xDrawPagesSupplier = rxModel.query<XDrawPagesSupplier>() )
- if (auto xDrawPages = xDrawPagesSupplier->getDrawPages().query<XDrawPages>() )
- for( const auto& rxPage : vNonUsedPageList )
- xDrawPages->remove( rxPage );
+ Reference< XDrawPagesSupplier > xDrawPagesSupplier( rxModel, UNO_QUERY_THROW );
+ Reference< XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_SET_THROW );
+ for( const auto& rxPage : vNonUsedPageList )
+ xDrawPages->remove( rxPage );
}
catch( Exception& )
{
@@ -544,12 +544,10 @@ static void DispatchURL( const Reference< XComponentContext >& xContext, const O
aUrl.Complete = sURL;
xURLTransformer->parseStrict( aUrl );
Sequence< PropertyValue > aArgs;
- if (auto xDispatchProvider = xFrame.query<XDispatchProvider>() )
- {
- Reference< XDispatch > xDispatch = xDispatchProvider->queryDispatch( aUrl, OUString(), 0 ); // "_self"
- if ( xDispatch.is() )
- xDispatch->dispatch( aUrl, aArgs );
- }
+ Reference< XDispatchProvider > xDispatchProvider( xFrame, UNO_QUERY_THROW );
+ Reference< XDispatch > xDispatch = xDispatchProvider->queryDispatch( aUrl, OUString(), 0 ); // "_self"
+ if ( xDispatch.is() )
+ xDispatch->dispatch( aUrl, aArgs );
}
catch( Exception& )
{
diff --git a/sdext/source/minimizer/optimizationstats.cxx b/sdext/source/minimizer/optimizationstats.cxx
index ab958b5cf851..1deef26ac059 100644
--- a/sdext/source/minimizer/optimizationstats.cxx
+++ b/sdext/source/minimizer/optimizationstats.cxx
@@ -74,9 +74,9 @@ void OptimizationStats::InitializeStatusValuesFromDocument( const Reference< XMo
{
try
{
- if (auto xDrawPagesSupplier = rxModel.query<XDrawPagesSupplier>() )
- if (auto xDrawPages = xDrawPagesSupplier->getDrawPages().query<XDrawPages>() )
- SetStatusValue( TK_Pages, Any( awt::Size( 0, xDrawPages->getCount() ) ) );
+ Reference< XDrawPagesSupplier > xDrawPagesSupplier( rxModel, UNO_QUERY_THROW );
+ Reference< XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_SET_THROW );
+ SetStatusValue( TK_Pages, Any( awt::Size( 0, xDrawPages->getCount() ) ) );
}
catch ( Exception& )
{