diff options
Diffstat (limited to 'sd/source')
-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 | ||||
-rw-r--r-- | sd/source/core/stlsheet.cxx | 6 | ||||
-rw-r--r-- | sd/source/filter/eppt/epptso.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/annotations/annotationmanager.cxx | 22 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshowviewimpl.cxx | 7 |
7 files changed, 44 insertions, 22 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); } diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index d7384ed53b9d..2038604861df 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -309,9 +309,9 @@ bool SdStyleSheet::IsUsed() const Reference< XStyle > xStyle( rListener, UNO_QUERY ); try { - if (auto xPropertySet = xStyle.query<XPropertySet>() ) - if (xPropertySet->getPropertyValue("IsPhysical").get<bool>()) - return true; + Reference<XPropertySet> xPropertySet(xStyle, UNO_QUERY_THROW); + if (xPropertySet->getPropertyValue("IsPhysical").get<bool>()) + return true; } catch (const Exception&) { diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 219cf9ebf785..e794d9600e06 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -1944,8 +1944,8 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a try { // try to get the aspect when available - if (auto xShapeProps = mXShape.query<css::beans::XPropertySet>() ) - xShapeProps->getPropertyValue("Aspect") >>= nAspect; + css::uno::Reference< css::beans::XPropertySet > xShapeProps( mXShape, css::uno::UNO_QUERY_THROW ); + xShapeProps->getPropertyValue("Aspect") >>= nAspect; } catch( css::uno::Exception& ) {} @@ -2527,8 +2527,8 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a try { // try to get the aspect when available - if (auto xShapeProps = mXShape.query<css::beans::XPropertySet>() ) - xShapeProps->getPropertyValue("Aspect") >>= nAspect; + css::uno::Reference< css::beans::XPropertySet > xShapeProps( mXShape, css::uno::UNO_QUERY_THROW ); + xShapeProps->getPropertyValue("Aspect") >>= nAspect; } catch( css::uno::Exception& ) {} diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index 4f3b6a85048b..81d6b3c0176b 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -183,15 +183,29 @@ void AnnotationManagerImpl::init() TOOLS_WARN_EXCEPTION( "sd", "sd::AnnotationManagerImpl::AnnotationManagerImpl()" ); } - if (auto xModel = mrBase.GetDocShell()->GetModel().query<XEventBroadcaster>() ) - xModel->addEventListener( Reference<XEventListener>( this ) ); + try + { + Reference<XEventBroadcaster> xModel (mrBase.GetDocShell()->GetModel(), UNO_QUERY_THROW ); + Reference<XEventListener> xListener( this ); + xModel->addEventListener( xListener ); + } + catch( Exception& ) + { + } } // WeakComponentImplHelper void AnnotationManagerImpl::disposing (std::unique_lock<std::mutex>&) { - if (auto xModel = mrBase.GetDocShell()->GetModel().query<XEventBroadcaster>() ) - xModel->removeEventListener( Reference<XEventListener>( this ) ); + try + { + Reference<XEventBroadcaster> xModel (mrBase.GetDocShell()->GetModel(), UNO_QUERY_THROW ); + Reference<XEventListener> xListener( this ); + xModel->removeEventListener( xListener ); + } + catch( Exception& ) + { + } removeListener(); DisposeTags(); diff --git a/sd/source/ui/slideshow/slideshowviewimpl.cxx b/sd/source/ui/slideshow/slideshowviewimpl.cxx index 4b476812a8d8..d6addc3f87fe 100644 --- a/sd/source/ui/slideshow/slideshowviewimpl.cxx +++ b/sd/source/ui/slideshow/slideshowviewimpl.cxx @@ -125,9 +125,10 @@ SlideShowView::SlideShowView( ShowWindow& rOutputWindow, { try { - if (auto xCanvasProps = getCanvas().query<beans::XPropertySet>() ) - xCanvasProps->setPropertyValue("UnsafeScrolling", - uno::Any( true ) ); + Reference< beans::XPropertySet > xCanvasProps( getCanvas(), + uno::UNO_QUERY_THROW ); + xCanvasProps->setPropertyValue("UnsafeScrolling", + uno::Any( true ) ); } catch( uno::Exception& ) { |