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 /sd/source/console | |
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 'sd/source/console')
-rw-r--r-- | sd/source/console/PresenterHelper.cxx | 15 | ||||
-rw-r--r-- | sd/source/console/PresenterScreen.cxx | 4 | ||||
-rw-r--r-- | sd/source/console/PresenterSlideShowView.cxx | 4 |
3 files changed, 15 insertions, 8 deletions
diff --git a/sd/source/console/PresenterHelper.cxx b/sd/source/console/PresenterHelper.cxx index 9bdd580460f8..76bec0ecee7d 100644 --- a/sd/source/console/PresenterHelper.cxx +++ b/sd/source/console/PresenterHelper.cxx @@ -36,10 +36,17 @@ Reference<presentation::XSlideShowController> PresenterHelper::GetSlideShowContr { Reference<presentation::XSlideShowController> xSlideShowController; - if( rxController.is() ) - if (auto xPS = rxController->getModel().query<XPresentationSupplier>()) - if (auto xPresentation = xPS->getPresentation().query<XPresentation2>()) - xSlideShowController = xPresentation->getController(); + if( rxController.is() ) try + { + Reference<XPresentationSupplier> xPS ( rxController->getModel(), UNO_QUERY_THROW); + + Reference<XPresentation2> xPresentation(xPS->getPresentation(), UNO_QUERY_THROW); + + xSlideShowController = xPresentation->getController(); + } + catch(RuntimeException&) + { + } return xSlideShowController; } diff --git a/sd/source/console/PresenterScreen.cxx b/sd/source/console/PresenterScreen.cxx index dcf0cb93a564..cd6c20d38cc5 100644 --- a/sd/source/console/PresenterScreen.cxx +++ b/sd/source/console/PresenterScreen.cxx @@ -411,8 +411,8 @@ void PresenterScreen::SwitchMonitors() nNewScreen++; // otherwise we store screens offset by one. // Set the new presentation display - if (auto xProperties = xPresentation.query<beans::XPropertySet>()) - xProperties->setPropertyValue("Display", Any(nNewScreen)); + Reference<beans::XPropertySet> xProperties (xPresentation, UNO_QUERY_THROW); + xProperties->setPropertyValue("Display", Any(nNewScreen)); } catch (const uno::Exception &) { } } diff --git a/sd/source/console/PresenterSlideShowView.cxx b/sd/source/console/PresenterSlideShowView.cxx index 002bc217d659..32693f116410 100644 --- a/sd/source/console/PresenterSlideShowView.cxx +++ b/sd/source/console/PresenterSlideShowView.cxx @@ -799,8 +799,8 @@ Reference<awt::XWindow> PresenterSlideShowView::CreateViewWindow ( xViewWindow.set( xToolkit->createWindow(aWindowDescriptor),UNO_QUERY_THROW); // Make the background transparent. The slide show paints its own background. - if (auto xPeer = xViewWindow.query<awt::XWindowPeer>()) - xPeer->setBackground(0xff000000); + Reference<awt::XWindowPeer> xPeer (xViewWindow, UNO_QUERY_THROW); + xPeer->setBackground(0xff000000); xViewWindow->setVisible(true); } |