From 6530a474b4dd56a6f597cbcee87f72c3d9d8b03f Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Thu, 27 Feb 2025 09:58:56 +0100 Subject: sd presenter: Make PresenterHelper::getWindowExtentsRelative static Now that PresenterHelper no longer needs to implement the XPresenterHelper interface dropped in commit a80dec4e7bfb64d5331fe59d0feaeede636376f4 Author: Michael Weghorn Date: Wed Feb 26 17:17:42 2025 +0100 [API CHANGE] Drop css::drawing::XPresenterHelper , make sd::presenter::PresenterHelper::getWindowExtentsRelative static. Drop rtl::Reference class members in other classes that are now no more needed as they were only used to call the now static method. Change-Id: Ic095cfa900db7211bc3b7e286702807afeba1c20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182289 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- sd/source/console/PresenterController.cxx | 2 +- sd/source/console/PresenterPaintManager.cxx | 10 ++++------ sd/source/console/PresenterPaintManager.hxx | 2 -- sd/source/console/PresenterPane.cxx | 3 --- sd/source/console/PresenterPaneBase.cxx | 4 +--- sd/source/console/PresenterPaneBase.hxx | 1 - sd/source/console/PresenterSlideShowView.cxx | 4 +--- sd/source/console/PresenterSlideShowView.hxx | 1 - sd/source/console/PresenterSpritePane.cxx | 3 +-- 9 files changed, 8 insertions(+), 22 deletions(-) (limited to 'sd/source') diff --git a/sd/source/console/PresenterController.cxx b/sd/source/console/PresenterController.cxx index 56786d3b9cf5..da330a5d71ab 100644 --- a/sd/source/console/PresenterController.cxx +++ b/sd/source/console/PresenterController.cxx @@ -1081,7 +1081,7 @@ void PresenterController::InitializeMainPane (const Reference& rxPane) if (xPane2.is()) xPane2->setVisible(true); - mpPaintManager = std::make_shared(mxMainWindow, mxPresenterHelper, mpPaneContainer); + mpPaintManager = std::make_shared(mxMainWindow, mpPaneContainer); mxCanvas.set(rxPane->getCanvas(), UNO_QUERY); diff --git a/sd/source/console/PresenterPaintManager.cxx b/sd/source/console/PresenterPaintManager.cxx index 20808a996b67..3553a5177b44 100644 --- a/sd/source/console/PresenterPaintManager.cxx +++ b/sd/source/console/PresenterPaintManager.cxx @@ -31,11 +31,9 @@ namespace sdext::presenter { PresenterPaintManager::PresenterPaintManager ( const css::uno::Reference& rxParentWindow, - rtl::Reference xPresenterHelper, rtl::Reference xPaneContainer) : mxParentWindow(rxParentWindow), mxParentWindowPeer(rxParentWindow, UNO_QUERY), - mxPresenterHelper(std::move(xPresenterHelper)), mpPaneContainer(std::move(xPaneContainer)) { } @@ -73,10 +71,10 @@ void PresenterPaintManager::Invalidate ( { // Window is transparent and parent window(s) have to be painted as // well. Invalidate the parent explicitly. - if (mxPresenterHelper.is() && mxParentWindowPeer.is()) + if (mxParentWindowPeer.is()) { const awt::Rectangle aBBox ( - mxPresenterHelper->getWindowExtentsRelative(rxWindow, mxParentWindow)); + sd::presenter::PresenterHelper::getWindowExtentsRelative(rxWindow, mxParentWindow)); mxParentWindowPeer->invalidateRect(aBBox, nInvalidateFlags); } } @@ -116,10 +114,10 @@ void PresenterPaintManager::Invalidate ( { // Window is transparent and parent window(s) have to be painted as // well. Invalidate the parent explicitly. - if (mxPresenterHelper.is() && mxParentWindowPeer.is()) + if (mxParentWindowPeer.is()) { const awt::Rectangle aBBox ( - mxPresenterHelper->getWindowExtentsRelative(rxWindow, mxParentWindow)); + sd::presenter::PresenterHelper::getWindowExtentsRelative(rxWindow, mxParentWindow)); mxParentWindowPeer->invalidateRect( awt::Rectangle( rRepaintBox.X + aBBox.X, diff --git a/sd/source/console/PresenterPaintManager.hxx b/sd/source/console/PresenterPaintManager.hxx index 4df9ee12b64e..2b5efb881989 100644 --- a/sd/source/console/PresenterPaintManager.hxx +++ b/sd/source/console/PresenterPaintManager.hxx @@ -46,7 +46,6 @@ public: */ PresenterPaintManager ( const css::uno::Reference& rxParentWindow, - rtl::Reference xPresenterHelper, rtl::Reference xPaneContainer); ::std::function @@ -79,7 +78,6 @@ public: private: css::uno::Reference mxParentWindow; css::uno::Reference mxParentWindowPeer; - rtl::Reference mxPresenterHelper; ::rtl::Reference mpPaneContainer; }; diff --git a/sd/source/console/PresenterPane.cxx b/sd/source/console/PresenterPane.cxx index cb9411f23e6a..8c65753b0d2d 100644 --- a/sd/source/console/PresenterPane.cxx +++ b/sd/source/console/PresenterPane.cxx @@ -35,7 +35,6 @@ PresenterPane::PresenterPane ( const ::rtl::Reference& rpPresenterController) : PresenterPaneBase(rxContext, rpPresenterController) { - mxPresenterHelper = new sd::presenter::PresenterHelper(mxComponentContext); } PresenterPane::~PresenterPane() @@ -120,8 +119,6 @@ void SAL_CALL PresenterPane::windowPaint (const awt::PaintEvent& rEvent) void PresenterPane::CreateCanvases ( const Reference& rxParentCanvas) { - if ( ! mxPresenterHelper.is()) - return; if ( ! mxParentWindow.is()) return; if ( ! rxParentCanvas.is()) diff --git a/sd/source/console/PresenterPaneBase.cxx b/sd/source/console/PresenterPaneBase.cxx index ce9ef8b3c0c1..73eab7572b42 100644 --- a/sd/source/console/PresenterPaneBase.cxx +++ b/sd/source/console/PresenterPaneBase.cxx @@ -39,8 +39,6 @@ PresenterPaneBase::PresenterPaneBase ( mpPresenterController(std::move(xPresenterController)), mxComponentContext(rxContext) { - if (mpPresenterController) - mxPresenterHelper = mpPresenterController->GetPresenterHelper(); } PresenterPaneBase::~PresenterPaneBase() @@ -250,7 +248,7 @@ void SAL_CALL PresenterPaneBase::disposing (const lang::EventObject& rEvent) void PresenterPaneBase::CreateWindows ( const bool bIsWindowVisibleOnCreation) { - if (!(mxPresenterHelper.is() && mxParentWindow.is())) + if (!mxParentWindow.is()) return; mxBorderWindow = sd::presenter::PresenterHelper::createWindow( diff --git a/sd/source/console/PresenterPaneBase.hxx b/sd/source/console/PresenterPaneBase.hxx index 3fc7d2eb332a..cd53913f0a6f 100644 --- a/sd/source/console/PresenterPaneBase.hxx +++ b/sd/source/console/PresenterPaneBase.hxx @@ -102,7 +102,6 @@ protected: css::uno::Reference mxContentCanvas; css::uno::Reference mxPaneId; css::uno::Reference mxBorderPainter; - rtl::Reference mxPresenterHelper; OUString msTitle; css::uno::Reference mxComponentContext; diff --git a/sd/source/console/PresenterSlideShowView.cxx b/sd/source/console/PresenterSlideShowView.cxx index 2700547f2159..e2efaa4e3aea 100644 --- a/sd/source/console/PresenterSlideShowView.cxx +++ b/sd/source/console/PresenterSlideShowView.cxx @@ -106,8 +106,6 @@ void PresenterSlideShowView::LateInit() Reference xSlideShowComponent (mxSlideShow, UNO_QUERY); xSlideShowComponent->addEventListener(static_cast(this)); - mxPresenterHelper = new sd::presenter::PresenterHelper(mxComponentContext); - // Use view id and controller to retrieve window and canvas from // configuration controller. Reference xCC (mxController->getConfigurationController()); @@ -475,7 +473,7 @@ void SAL_CALL PresenterSlideShowView::setMouseCursor(::sal_Int16 nPointerShape) awt::Rectangle SAL_CALL PresenterSlideShowView::getCanvasArea( ) { if( mxViewWindow.is() && mxTopPane.is() ) - return mxPresenterHelper->getWindowExtentsRelative( mxViewWindow, mxTopPane->getWindow() ); + return sd::presenter::PresenterHelper::getWindowExtentsRelative( mxViewWindow, mxTopPane->getWindow() ); awt::Rectangle aRectangle; diff --git a/sd/source/console/PresenterSlideShowView.hxx b/sd/source/console/PresenterSlideShowView.hxx index 4418d150c609..7551243812c0 100644 --- a/sd/source/console/PresenterSlideShowView.hxx +++ b/sd/source/console/PresenterSlideShowView.hxx @@ -185,7 +185,6 @@ private: css::uno::Reference mxWindow; css::uno::Reference mxViewWindow; css::uno::Reference mxTopPane; - rtl::Reference mxPresenterHelper; css::uno::Reference mxBackgroundPolygon1; css::uno::Reference mxBackgroundPolygon2; bool mbIsViewAdded; diff --git a/sd/source/console/PresenterSpritePane.cxx b/sd/source/console/PresenterSpritePane.cxx index f0704490e51e..4b97b85208af 100644 --- a/sd/source/console/PresenterSpritePane.cxx +++ b/sd/source/console/PresenterSpritePane.cxx @@ -34,7 +34,6 @@ PresenterSpritePane::PresenterSpritePane (const Reference& rx : PresenterPaneBase(rxContext, rpPresenterController), mpSprite(std::make_shared()) { - mxPresenterHelper = new sd::presenter::PresenterHelper(mxComponentContext); } PresenterSpritePane::~PresenterSpritePane() @@ -82,7 +81,7 @@ void SAL_CALL PresenterSpritePane::windowMoved (const awt::WindowEvent& rEvent) PresenterPaneBase::windowMoved(rEvent); awt::Rectangle aBox ( - mxPresenterHelper->getWindowExtentsRelative(mxBorderWindow, mxParentWindow)); + sd::presenter::PresenterHelper::getWindowExtentsRelative(mxBorderWindow, mxParentWindow)); mpSprite->MoveTo(geometry::RealPoint2D(aBox.X, aBox.Y)); mpSprite->Update(); } -- cgit