diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2025-02-27 09:58:56 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2025-02-27 22:59:25 +0100 |
commit | 6530a474b4dd56a6f597cbcee87f72c3d9d8b03f (patch) | |
tree | 6c4756757a7ac3be7bf8399a308f3668b6a6c4a9 /sd/source | |
parent | 1ab613dcca54f6710c335f5e3251de3afd8d2817 (diff) |
sd presenter: Make PresenterHelper::getWindowExtentsRelative static
Now that PresenterHelper no longer needs to implement
the XPresenterHelper interface dropped in
commit a80dec4e7bfb64d5331fe59d0feaeede636376f4
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Wed Feb 26 17:17:42 2025 +0100
[API CHANGE] Drop css::drawing::XPresenterHelper
, make sd::presenter::PresenterHelper::getWindowExtentsRelative
static.
Drop rtl::Reference<PresenterHelper> 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 <m.weghorn@posteo.de>
Tested-by: Jenkins
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/console/PresenterController.cxx | 2 | ||||
-rw-r--r-- | sd/source/console/PresenterPaintManager.cxx | 10 | ||||
-rw-r--r-- | sd/source/console/PresenterPaintManager.hxx | 2 | ||||
-rw-r--r-- | sd/source/console/PresenterPane.cxx | 3 | ||||
-rw-r--r-- | sd/source/console/PresenterPaneBase.cxx | 4 | ||||
-rw-r--r-- | sd/source/console/PresenterPaneBase.hxx | 1 | ||||
-rw-r--r-- | sd/source/console/PresenterSlideShowView.cxx | 4 | ||||
-rw-r--r-- | sd/source/console/PresenterSlideShowView.hxx | 1 | ||||
-rw-r--r-- | sd/source/console/PresenterSpritePane.cxx | 3 |
9 files changed, 8 insertions, 22 deletions
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<XPane>& rxPane) if (xPane2.is()) xPane2->setVisible(true); - mpPaintManager = std::make_shared<PresenterPaintManager>(mxMainWindow, mxPresenterHelper, mpPaneContainer); + mpPaintManager = std::make_shared<PresenterPaintManager>(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<css::awt::XWindow>& rxParentWindow, - rtl::Reference<sd::presenter::PresenterHelper> xPresenterHelper, rtl::Reference<PresenterPaneContainer> 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<css::awt::XWindow>& rxParentWindow, - rtl::Reference<sd::presenter::PresenterHelper> xPresenterHelper, rtl::Reference<PresenterPaneContainer> xPaneContainer); ::std::function<void (const css::awt::Rectangle& rRepaintBox)> @@ -79,7 +78,6 @@ public: private: css::uno::Reference<css::awt::XWindow> mxParentWindow; css::uno::Reference<css::awt::XWindowPeer> mxParentWindowPeer; - rtl::Reference<sd::presenter::PresenterHelper> mxPresenterHelper; ::rtl::Reference<PresenterPaneContainer> 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<PresenterController>& 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<rendering::XSpriteCanvas>& 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<css::rendering::XCanvas> mxContentCanvas; css::uno::Reference<css::drawing::framework::XResourceId> mxPaneId; css::uno::Reference<css::drawing::framework::XPaneBorderPainter> mxBorderPainter; - rtl::Reference<sd::presenter::PresenterHelper> mxPresenterHelper; OUString msTitle; css::uno::Reference<css::uno::XComponentContext> 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<lang::XComponent> xSlideShowComponent (mxSlideShow, UNO_QUERY); xSlideShowComponent->addEventListener(static_cast<awt::XWindowListener*>(this)); - mxPresenterHelper = new sd::presenter::PresenterHelper(mxComponentContext); - // Use view id and controller to retrieve window and canvas from // configuration controller. Reference<XConfigurationController> 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<css::awt::XWindow> mxWindow; css::uno::Reference<css::awt::XWindow> mxViewWindow; css::uno::Reference<css::drawing::framework::XPane> mxTopPane; - rtl::Reference<sd::presenter::PresenterHelper> mxPresenterHelper; css::uno::Reference<css::rendering::XPolyPolygon2D> mxBackgroundPolygon1; css::uno::Reference<css::rendering::XPolyPolygon2D> 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<XComponentContext>& rx : PresenterPaneBase(rxContext, rpPresenterController), mpSprite(std::make_shared<PresenterSprite>()) { - 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(); } |