sd/inc/PresenterHelper.hxx | 20 ----------------- sd/source/console/PresenterBitmapContainer.cxx | 5 ---- sd/source/console/PresenterBitmapContainer.hxx | 2 - 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 -- sd/source/console/PresenterTheme.cxx | 2 - sd/source/console/PresenterToolBar.cxx | 2 - sd/source/ui/presenter/PresenterHelper.cxx | 29 ------------------------- 15 files changed, 10 insertions(+), 80 deletions(-)
New commits: commit bb609ee548ceb017825076e3bee12dfa52bd5da8 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Feb 27 10:10:15 2025 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Thu Feb 27 22:59:38 2025 +0100 sd presenter: Drop PresenterHelper param The `rxPresenterHelper` param in PresenterBitmapContainer::LoadBitmap is effectively unused by now: Only an `OSL_ASSERT` remained after Change-Id: I7741b966e09850412f60d2a3f44d36b401553729 Author: Michael Weghorn <m.wegh...@posteo.de> Date: Thu Feb 27 09:43:46 2025 +0100 sd presenter: Make PresenterHelper::loadBitmap static Therefore, drop the param altogether. Change-Id: I0afcf0e429fbc1b3c503f79373d3150fdd59a4bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182291 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/sd/source/console/PresenterBitmapContainer.cxx b/sd/source/console/PresenterBitmapContainer.cxx index f857251cd718..57cc911f1131 100644 --- a/sd/source/console/PresenterBitmapContainer.cxx +++ b/sd/source/console/PresenterBitmapContainer.cxx @@ -130,7 +130,6 @@ void PresenterBitmapContainer::LoadBitmaps ( std::shared_ptr<PresenterBitmapContainer::BitmapDescriptor> PresenterBitmapContainer::LoadBitmap ( const css::uno::Reference<css::container::XHierarchicalNameAccess>& rxNode, const OUString& rsPath, - const rtl::Reference<sd::presenter::PresenterHelper>& rxPresenterHelper, const css::uno::Reference<css::rendering::XCanvas>& rxCanvas, const std::shared_ptr<BitmapDescriptor>& rpDefault) { @@ -146,7 +145,6 @@ std::shared_ptr<PresenterBitmapContainer::BitmapDescriptor> PresenterBitmapConta if (xBitmapProperties.is()) pBitmap = LoadBitmap( xBitmapProperties, - rxPresenterHelper, rxCanvas, rpDefault); } @@ -169,19 +167,16 @@ void PresenterBitmapContainer::ProcessBitmap ( maIconContainer[sName] = LoadBitmap( rxProperties, - mxPresenterHelper, mxCanvas, SharedBitmapDescriptor()); } std::shared_ptr<PresenterBitmapContainer::BitmapDescriptor> PresenterBitmapContainer::LoadBitmap ( const Reference<beans::XPropertySet>& rxProperties, - const rtl::Reference<sd::presenter::PresenterHelper>& rxPresenterHelper, const css::uno::Reference<css::rendering::XCanvas>& rxCanvas, const std::shared_ptr<BitmapDescriptor>& rpDefault) { OSL_ASSERT(rxCanvas.is()); - OSL_ASSERT(rxPresenterHelper.is()); SharedBitmapDescriptor pBitmap = std::make_shared<BitmapDescriptor>(rpDefault); diff --git a/sd/source/console/PresenterBitmapContainer.hxx b/sd/source/console/PresenterBitmapContainer.hxx index b1374934398a..a5d34db290a9 100644 --- a/sd/source/console/PresenterBitmapContainer.hxx +++ b/sd/source/console/PresenterBitmapContainer.hxx @@ -112,7 +112,6 @@ public: static std::shared_ptr<BitmapDescriptor> LoadBitmap ( const css::uno::Reference<css::container::XHierarchicalNameAccess>& rxNode, const OUString& rsPathToBitmapNode, - const rtl::Reference<sd::presenter::PresenterHelper>& rxPresenterHelper, const css::uno::Reference<css::rendering::XCanvas>& rxCanvas, const std::shared_ptr<BitmapDescriptor>& rpDefaultBitmap); @@ -130,7 +129,6 @@ private: const css::uno::Reference<css::beans::XPropertySet>& rProperties); static std::shared_ptr<BitmapDescriptor> LoadBitmap ( const css::uno::Reference<css::beans::XPropertySet>& rxProperties, - const rtl::Reference<sd::presenter::PresenterHelper>& rxPresenterHelper, const css::uno::Reference<css::rendering::XCanvas>& rxCanvas, const std::shared_ptr<PresenterBitmapContainer::BitmapDescriptor>& rpDefault); static BitmapDescriptor::TexturingMode diff --git a/sd/source/console/PresenterTheme.cxx b/sd/source/console/PresenterTheme.cxx index d3573a227841..801c14e488c7 100644 --- a/sd/source/console/PresenterTheme.cxx +++ b/sd/source/console/PresenterTheme.cxx @@ -580,7 +580,6 @@ void PresenterTheme::Theme::Read ( mpBackground = PresenterBitmapContainer::LoadBitmap( mxThemeRoot, u"Background"_ustr, - rReadContext.mxPresenterHelper, rReadContext.mxCanvas, SharedBitmapDescriptor()); @@ -957,7 +956,6 @@ void ViewStyleContainer::ProcessViewStyle( SharedBitmapDescriptor pBackground (PresenterBitmapContainer::LoadBitmap( xBackgroundNode, OUString(), - rReadContext.mxPresenterHelper, rReadContext.mxCanvas, SharedBitmapDescriptor())); if (pBackground && pBackground->GetNormalBitmap().is()) diff --git a/sd/source/console/PresenterToolBar.cxx b/sd/source/console/PresenterToolBar.cxx index 89ddb37be720..2286748c2623 100644 --- a/sd/source/console/PresenterToolBar.cxx +++ b/sd/source/console/PresenterToolBar.cxx @@ -1358,7 +1358,7 @@ void ElementMode::ReadElementMode ( Reference<container::XHierarchicalNameAccess> xIconNode ( PresenterConfigurationAccess::GetProperty(xProperties, u"Icon"_ustr), UNO_QUERY); mpIcon = PresenterBitmapContainer::LoadBitmap( - xIconNode, u""_ustr, rContext.mxPresenterHelper, rContext.mxCanvas, + xIconNode, u""_ustr, rContext.mxCanvas, rpDefaultMode != nullptr ? rpDefaultMode->mpIcon : SharedBitmapDescriptor()); } catch(Exception&) commit 67b4f79188f6a95c245d31625c31fe989ecac041 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Feb 27 10:02:58 2025 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Thu Feb 27 22:59:31 2025 +0100 sd presenter: Drop unused PresenterHelper::createCanvas Change-Id: Ia3231f30ff7ee0223d596d1b15936b5ddd792a47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182290 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/sd/inc/PresenterHelper.hxx b/sd/inc/PresenterHelper.hxx index 37ff21761a3e..d74057f9b135 100644 --- a/sd/inc/PresenterHelper.hxx +++ b/sd/inc/PresenterHelper.hxx @@ -94,24 +94,6 @@ public: const css::uno::Reference<css::awt::XWindow>& rxSharedWindow, const css::uno::Reference<css::awt::XWindow>& rxWindow); - /** Create a new canvas for the given window. - @param rxWindow - The canvas is created for this window. Must not be `NULL` - @param nRequestedCanvasFeatureList - List of requested features that the new canvas should (has to) - provide. Use only values from the CanvasFeature - constants group. - @param rsOptionalCanvasServiceName - When an explicit service name is given then a new object of this - service is created. This service name lets the caller select a - specific canvas implementation, e.g. with or without hardware - acceleration. - */ - virtual css::uno::Reference<css::rendering::XCanvas> createCanvas ( - const css::uno::Reference<css::awt::XWindow>& rxWindow, - sal_Int16 nRequestedCanvasFeatures, - const OUString& rsOptionalCanvasServiceName); - /** Move the specified window to the top of its stacking order. As a result the window will be painted over all its overlapping siblings. diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx index 6ee6d5266233..7de04097bb38 100644 --- a/sd/source/ui/presenter/PresenterHelper.cxx +++ b/sd/source/ui/presenter/PresenterHelper.cxx @@ -128,35 +128,6 @@ Reference<rendering::XCanvas> PresenterHelper::createSharedCanvas ( rxWindow); } -Reference<rendering::XCanvas> PresenterHelper::createCanvas ( - const Reference<awt::XWindow>& rxWindow, - sal_Int16, - const OUString& rsOptionalCanvasServiceName) -{ - // No shared window is given or an explicit canvas service name is - // specified. Create a new canvas. - VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(rxWindow); - if (!pWindow) - throw RuntimeException(); - - Sequence<Any> aArg{ // common: first any is VCL pointer to window (for VCL canvas) - Any(reinterpret_cast<sal_Int64>(pWindow.get())), - Any(css::awt::Rectangle()), - Any(false), - Any(rxWindow) - }; - - Reference<lang::XMultiServiceFactory> xFactory ( - mxComponentContext->getServiceManager(), UNO_QUERY_THROW); - return Reference<rendering::XCanvas>( - xFactory->createInstanceWithArguments( - !rsOptionalCanvasServiceName.isEmpty() - ? rsOptionalCanvasServiceName - : u"com.sun.star.rendering.Canvas.VCL"_ustr, - aArg), - UNO_QUERY); -} - void PresenterHelper::toTop(const Reference<awt::XWindow>& rxWindow) { VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(rxWindow); commit 6530a474b4dd56a6f597cbcee87f72c3d9d8b03f Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Feb 27 09:58:56 2025 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Thu Feb 27 22:59:25 2025 +0100 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.wegh...@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.wegh...@posteo.de> Tested-by: Jenkins diff --git a/sd/inc/PresenterHelper.hxx b/sd/inc/PresenterHelper.hxx index 0cdbbe7e1940..37ff21761a3e 100644 --- a/sd/inc/PresenterHelper.hxx +++ b/sd/inc/PresenterHelper.hxx @@ -149,7 +149,7 @@ public: /** Return the bounding box of the given child window relative to the direct or indirect parent window. */ - virtual css::awt::Rectangle getWindowExtentsRelative ( + static css::awt::Rectangle getWindowExtentsRelative( const css::uno::Reference<css::awt::XWindow>& rxChildWindow, const css::uno::Reference<css::awt::XWindow>& rxParentWindow); 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(); }