sd/source/console/PresenterToolBar.cxx | 31 ++++++++++++++----------------- sd/source/console/PresenterToolBar.hxx | 9 +++------ 2 files changed, 17 insertions(+), 23 deletions(-)
New commits: commit 220bd7fcb3c99a2a1bdf65aea48a6998f58485a8 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri May 16 10:29:54 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri May 16 20:17:49 2025 +0200 sd Presenter: Drop PresenterToolBar::CalculatePartSize canvas param Use `mxCanvas` directly instead of passing it around. Change-Id: Ie17fd0c3180334f8b149e6a68086db4c790bb344 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185393 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/sd/source/console/PresenterToolBar.cxx b/sd/source/console/PresenterToolBar.cxx index 8c0cc19edb24..ac80fab6093b 100644 --- a/sd/source/console/PresenterToolBar.cxx +++ b/sd/source/console/PresenterToolBar.cxx @@ -656,7 +656,7 @@ void PresenterToolBar::Layout() sal_Int32 nGapCount (0); for (const auto& rxPart : maElementContainer) { - geometry::RealSize2D aSize (CalculatePartSize(mxCanvas, rxPart, bIsHorizontal)); + geometry::RealSize2D aSize = CalculatePartSize(rxPart, bIsHorizontal); // Remember the size of each part for later. aPartSizes[rxPart] = aSize; @@ -738,8 +738,7 @@ void PresenterToolBar::Layout() xManager->Invalidate(mxWindow); } -geometry::RealSize2D PresenterToolBar::CalculatePartSize ( - const Reference<rendering::XCanvas>& rxCanvas, +geometry::RealSize2D PresenterToolBar::CalculatePartSize( const SharedElementContainerPart& rpPart, const bool bIsHorizontal) { @@ -753,7 +752,7 @@ geometry::RealSize2D PresenterToolBar::CalculatePartSize ( if (!rxElement) continue; - const awt::Size aBSize (rxElement->GetBoundingSize(rxCanvas)); + const awt::Size aBSize = rxElement->GetBoundingSize(mxCanvas); if (bIsHorizontal) { aTotalSize.Width += aBSize.Width; diff --git a/sd/source/console/PresenterToolBar.hxx b/sd/source/console/PresenterToolBar.hxx index a7fa38b4bb6e..2bb9362ea25e 100644 --- a/sd/source/console/PresenterToolBar.hxx +++ b/sd/source/console/PresenterToolBar.hxx @@ -158,8 +158,7 @@ private: void CreateControls ( const OUString& rsConfigurationPath); void Layout(); - css::geometry::RealSize2D CalculatePartSize ( - const css::uno::Reference<css::rendering::XCanvas>& rxCanvas, + css::geometry::RealSize2D CalculatePartSize( const SharedElementContainerPart& rpPart, const bool bIsHorizontal); static void LayoutPart ( commit ee74541f376eee348e8e032158dd8505f4af1f43 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri May 16 10:26:50 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri May 16 20:17:42 2025 +0200 sd presenter: Drop PresenterToolBar::Layout canvas param The only callers pass the own `mxCanvas`, so use that one directly instead. Change-Id: I7fdffe60e1fae25cc007a9c06f95e4f06793a634 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185392 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/sd/source/console/PresenterToolBar.cxx b/sd/source/console/PresenterToolBar.cxx index 53cde55502fc..8c0cc19edb24 100644 --- a/sd/source/console/PresenterToolBar.cxx +++ b/sd/source/console/PresenterToolBar.cxx @@ -436,7 +436,7 @@ void PresenterToolBar::RequestLayout() geometry::RealSize2D const & PresenterToolBar::GetMinimalSize() { if (mbIsLayoutPending) - Layout(mxCanvas); + Layout(); return maMinimalSize; } @@ -488,7 +488,7 @@ void SAL_CALL PresenterToolBar::windowPaint (const css::awt::PaintEvent& rEvent) PresenterGeometryHelper::CreatePolygon(rEvent.UpdateRect, mxCanvas->getDevice())); if (mbIsLayoutPending) - Layout(mxCanvas); + Layout(); Paint(rEvent.UpdateRect, aViewState); @@ -641,8 +641,7 @@ void PresenterToolBar::ProcessEntry ( } } -void PresenterToolBar::Layout ( - const Reference<rendering::XCanvas>& rxCanvas) +void PresenterToolBar::Layout() { if (maElementContainer.empty()) return; @@ -657,7 +656,7 @@ void PresenterToolBar::Layout ( sal_Int32 nGapCount (0); for (const auto& rxPart : maElementContainer) { - geometry::RealSize2D aSize (CalculatePartSize(rxCanvas, rxPart, bIsHorizontal)); + geometry::RealSize2D aSize (CalculatePartSize(mxCanvas, rxPart, bIsHorizontal)); // Remember the size of each part for later. aPartSizes[rxPart] = aSize; @@ -721,7 +720,7 @@ void PresenterToolBar::Layout ( if (rxPart->size() > 1 && bIsHorizontal) aBoundingBox.X2 += (rxPart->size() - 1) * nGapWidth; - LayoutPart(rxCanvas, rxPart, aBoundingBox, aPartSizes[rxPart], bIsHorizontal); + LayoutPart(mxCanvas, rxPart, aBoundingBox, aPartSizes[rxPart], bIsHorizontal); bIsHorizontal = !bIsHorizontal; nX += aBoundingBox.X2 - aBoundingBox.X1 + nGapWidth; }; diff --git a/sd/source/console/PresenterToolBar.hxx b/sd/source/console/PresenterToolBar.hxx index 4d347aa63f24..a7fa38b4bb6e 100644 --- a/sd/source/console/PresenterToolBar.hxx +++ b/sd/source/console/PresenterToolBar.hxx @@ -157,7 +157,7 @@ private: void CreateControls ( const OUString& rsConfigurationPath); - void Layout (const css::uno::Reference<css::rendering::XCanvas>& rxCanvas); + void Layout(); css::geometry::RealSize2D CalculatePartSize ( const css::uno::Reference<css::rendering::XCanvas>& rxCanvas, const SharedElementContainerPart& rpPart, commit 9659eb747c8dd3f9664ec7064e55e75cfb76f2a6 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri May 16 10:20:37 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri May 16 20:17:35 2025 +0200 sd presenter: Drop PresenterToolBar::ProcessEntry canvas param The only caller passes the own `mxCanvas`, so use that one directly instead. Change-Id: I90dc11666715170f7b665ae3b73e31e50c21810c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185391 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/sd/source/console/PresenterToolBar.cxx b/sd/source/console/PresenterToolBar.cxx index ef6299b3655c..53cde55502fc 100644 --- a/sd/source/console/PresenterToolBar.cxx +++ b/sd/source/console/PresenterToolBar.cxx @@ -584,14 +584,13 @@ void PresenterToolBar::CreateControls ( xEntries, [this] (OUString const&, uno::Reference<beans::XPropertySet> const& xProps) { - return this->ProcessEntry(xProps, mxCanvas); + return this->ProcessEntry(xProps); }); } } void PresenterToolBar::ProcessEntry ( - const Reference<beans::XPropertySet>& rxProperties, - const css::uno::Reference<css::rendering::XCanvas>& rxCanvas) + const Reference<beans::XPropertySet>& rxProperties) { if ( ! rxProperties.is()) return; @@ -607,11 +606,11 @@ void PresenterToolBar::ProcessEntry ( SharedElementMode pSelectedMode = std::make_shared<ElementMode>(); SharedElementMode pDisabledMode = std::make_shared<ElementMode>(); SharedElementMode pMouseOverSelectedMode = std::make_shared<ElementMode>(); - pNormalMode->ReadElementMode(rxProperties, u"Normal"_ustr, pNormalMode, rxCanvas); - pMouseOverMode->ReadElementMode(rxProperties, u"MouseOver"_ustr, pNormalMode, rxCanvas); - pSelectedMode->ReadElementMode(rxProperties, u"Selected"_ustr, pNormalMode, rxCanvas); - pDisabledMode->ReadElementMode(rxProperties, u"Disabled"_ustr, pNormalMode, rxCanvas); - pMouseOverSelectedMode->ReadElementMode(rxProperties, u"MouseOverSelected"_ustr, pSelectedMode, rxCanvas); + pNormalMode->ReadElementMode(rxProperties, u"Normal"_ustr, pNormalMode, mxCanvas); + pMouseOverMode->ReadElementMode(rxProperties, u"MouseOver"_ustr, pNormalMode, mxCanvas); + pSelectedMode->ReadElementMode(rxProperties, u"Selected"_ustr, pNormalMode, mxCanvas); + pDisabledMode->ReadElementMode(rxProperties, u"Disabled"_ustr, pNormalMode, mxCanvas); + pMouseOverSelectedMode->ReadElementMode(rxProperties, u"MouseOverSelected"_ustr, pSelectedMode, mxCanvas); // Create new element. ::rtl::Reference<Element> pElement; diff --git a/sd/source/console/PresenterToolBar.hxx b/sd/source/console/PresenterToolBar.hxx index 530c4f66b92d..4d347aa63f24 100644 --- a/sd/source/console/PresenterToolBar.hxx +++ b/sd/source/console/PresenterToolBar.hxx @@ -179,9 +179,7 @@ private: const bool bOverWindow, const bool bMouseDown=false); - void ProcessEntry ( - const css::uno::Reference<css::beans::XPropertySet>& rProperties, - const css::uno::Reference<css::rendering::XCanvas>& rxCanvas); + void ProcessEntry(const css::uno::Reference<css::beans::XPropertySet>& rProperties); /** @throws css::lang::DisposedException when the object has already been disposed.