reportdesign/source/ui/inc/DesignView.hxx | 3 + reportdesign/source/ui/inc/MarkedSection.hxx | 39 ++++++++++----------- reportdesign/source/ui/inc/ReportWindow.hxx | 3 + reportdesign/source/ui/inc/ScrollHelper.hxx | 12 +++--- reportdesign/source/ui/inc/ViewsWindow.hxx | 3 + reportdesign/source/ui/report/ReportController.cxx | 6 ++- reportdesign/source/ui/report/ScrollHelper.cxx | 8 ++-- reportdesign/source/ui/report/ViewsWindow.cxx | 6 +-- solenv/clang-format/excludelist | 1 9 files changed, 43 insertions(+), 38 deletions(-)
New commits: commit cbd368eedf558eb3f01dd1debf5d9e611a88e88f Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Wed Jul 16 16:12:02 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Thu Jul 17 07:23:26 2025 +0200 reportdesign: Make NearSectionAccess an enum class Change-Id: I1512268c1bdfd190f9f95c46aadcd4057ec0eb41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187965 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/reportdesign/source/ui/inc/DesignView.hxx b/reportdesign/source/ui/inc/DesignView.hxx index be5dead8e4c8..e2706fb906f4 100644 --- a/reportdesign/source/ui/inc/DesignView.hxx +++ b/reportdesign/source/ui/inc/DesignView.hxx @@ -193,7 +193,8 @@ namespace rptui css::uno::Reference< css::report::XReportComponent > getCurrentControlModel() const; // IMarkedSection - OSectionWindow* getMarkedSection(NearSectionAccess nsa = CURRENT) const override; + OSectionWindow* getMarkedSection(NearSectionAccess nsa + = NearSectionAccess::CURRENT) const override; OSectionWindow* getSectionWindow(const css::uno::Reference< css::report::XSection>& _xSection) const; virtual void markSection(const sal_uInt16 _nPos) override; diff --git a/reportdesign/source/ui/inc/MarkedSection.hxx b/reportdesign/source/ui/inc/MarkedSection.hxx index 4ff034768e15..3668095f0c8e 100644 --- a/reportdesign/source/ui/inc/MarkedSection.hxx +++ b/reportdesign/source/ui/inc/MarkedSection.hxx @@ -26,7 +26,7 @@ namespace rptui { class OSectionWindow; -enum NearSectionAccess +enum class NearSectionAccess { CURRENT = 0, PREVIOUS = -1, @@ -38,7 +38,8 @@ class IMarkedSection public: /** returns the section which is currently marked. */ - virtual OSectionWindow* getMarkedSection(NearSectionAccess nsa = CURRENT) const = 0; + virtual OSectionWindow* getMarkedSection(NearSectionAccess nsa + = NearSectionAccess::CURRENT) const = 0; /** mark the section on the given position . * diff --git a/reportdesign/source/ui/inc/ReportWindow.hxx b/reportdesign/source/ui/inc/ReportWindow.hxx index 7e1716384548..49af357fc307 100644 --- a/reportdesign/source/ui/inc/ReportWindow.hxx +++ b/reportdesign/source/ui/inc/ReportWindow.hxx @@ -176,7 +176,8 @@ namespace rptui void setMarked(const css::uno::Sequence< css::uno::Reference< css::report::XReportComponent> >& _xShape, bool _bMark); // IMarkedSection - OSectionWindow* getMarkedSection(NearSectionAccess nsa = CURRENT) const override; + OSectionWindow* getMarkedSection(NearSectionAccess nsa + = NearSectionAccess::CURRENT) const override; OSectionWindow* getSectionWindow(const css::uno::Reference< css::report::XSection>& _xSection) const; virtual void markSection(const sal_uInt16 _nPos) override; diff --git a/reportdesign/source/ui/inc/ScrollHelper.hxx b/reportdesign/source/ui/inc/ScrollHelper.hxx index a99d72e26b57..5fbd129c2977 100644 --- a/reportdesign/source/ui/inc/ScrollHelper.hxx +++ b/reportdesign/source/ui/inc/ScrollHelper.hxx @@ -165,7 +165,8 @@ namespace rptui void setMarked(const css::uno::Sequence< css::uno::Reference< css::report::XReportComponent> >& _xShape, bool _bMark); // IMarkedSection - OSectionWindow* getMarkedSection(NearSectionAccess nsa = CURRENT) const override; + OSectionWindow* getMarkedSection(NearSectionAccess nsa + = NearSectionAccess::CURRENT) const override; OSectionWindow* getSectionWindow(const css::uno::Reference< css::report::XSection>& _xSection) const; virtual void markSection(const sal_uInt16 _nPos) override; diff --git a/reportdesign/source/ui/inc/ViewsWindow.hxx b/reportdesign/source/ui/inc/ViewsWindow.hxx index 46b6de07a82b..ed97ffc79fc5 100644 --- a/reportdesign/source/ui/inc/ViewsWindow.hxx +++ b/reportdesign/source/ui/inc/ViewsWindow.hxx @@ -201,7 +201,8 @@ namespace rptui void setMarked(const css::uno::Sequence< css::uno::Reference< css::report::XReportComponent> >& _xShape, bool _bMark); // IMarkedSection - OSectionWindow* getMarkedSection(NearSectionAccess nsa = CURRENT) const override; + OSectionWindow* getMarkedSection(NearSectionAccess nsa + = NearSectionAccess::CURRENT) const override; virtual void markSection(const sal_uInt16 _nPos) override; /** align all marked objects in all sections diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index cf84a01b5c7f..8c06ff929ce2 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -3326,7 +3326,8 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) if ( bLabelAboveTextField || nDNDAction == DND_ACTION_LINK ) { // Add the Label one Section up - pSectionWindow[1] = getDesignView()->getMarkedSection(bLabelAboveTextField ? PREVIOUS : POST); + pSectionWindow[1] = getDesignView()->getMarkedSection( + bLabelAboveTextField ? NearSectionAccess::PREVIOUS : NearSectionAccess::POST); if (!pSectionWindow[1]) { // maybe out of bounds @@ -3923,7 +3924,8 @@ void OReportController::markSection(const bool _bNext) OSectionWindow *pSection = getDesignView()->getMarkedSection(); if ( pSection ) { - OSectionWindow *pPrevSection = getDesignView()->getMarkedSection(_bNext ? POST : PREVIOUS); + OSectionWindow* pPrevSection = getDesignView()->getMarkedSection( + _bNext ? NearSectionAccess::POST : NearSectionAccess::PREVIOUS); if ( pPrevSection != pSection && pPrevSection ) select(uno::Any(pPrevSection->getReportSection().getSection())); else diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index eb425471ea86..92a9ba74953d 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -419,12 +419,12 @@ OSectionWindow* OViewsWindow::getMarkedSection(NearSectionAccess nsa) const { if ( (*aIter)->getStartMarker().isMarked() ) { - if (nsa == CURRENT) + if (nsa == NearSectionAccess::CURRENT) { pRet = aIter->get(); break; } - else if ( nsa == PREVIOUS ) + else if (nsa == NearSectionAccess::PREVIOUS) { if (nCurrentPosition > 0) { @@ -441,7 +441,7 @@ OSectionWindow* OViewsWindow::getMarkedSection(NearSectionAccess nsa) const } break; } - else if ( nsa == POST ) + else if (nsa == NearSectionAccess::POST) { sal_uInt32 nSize = m_aSections.size(); if ((nCurrentPosition + 1) < nSize) commit b682e577cc66e61f2edee4a9659d200da2c6aca3 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Wed Jul 16 16:07:57 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Thu Jul 17 07:23:21 2025 +0200 reportdesign: clang-format MarkedSection.hxx This in particular gets rid of an extra indentation level. Change-Id: I95dd201d9e3a28330888739ab1ba1228df8826c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187964 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/reportdesign/source/ui/inc/MarkedSection.hxx b/reportdesign/source/ui/inc/MarkedSection.hxx index 2d97645c4e86..4ff034768e15 100644 --- a/reportdesign/source/ui/inc/MarkedSection.hxx +++ b/reportdesign/source/ui/inc/MarkedSection.hxx @@ -24,31 +24,31 @@ namespace rptui { - class OSectionWindow; - - enum NearSectionAccess - { - CURRENT = 0, - PREVIOUS = -1, - POST = 1 - }; - - class IMarkedSection - { - public: - /** returns the section which is currently marked. +class OSectionWindow; + +enum NearSectionAccess +{ + CURRENT = 0, + PREVIOUS = -1, + POST = 1 +}; + +class IMarkedSection +{ +public: + /** returns the section which is currently marked. */ - virtual OSectionWindow* getMarkedSection(NearSectionAccess nsa = CURRENT) const =0; + virtual OSectionWindow* getMarkedSection(NearSectionAccess nsa = CURRENT) const = 0; - /** mark the section on the given position . + /** mark the section on the given position . * * \param _nPos the position is zero based. */ - virtual void markSection(const sal_uInt16 _nPos) = 0; + virtual void markSection(const sal_uInt16 _nPos) = 0; - protected: - ~IMarkedSection() {} - }; +protected: + ~IMarkedSection() {} +}; } // rptui diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index c524f7b4da60..6cbab26df590 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -7304,7 +7304,6 @@ reportdesign/source/ui/inc/FunctionHelper.hxx reportdesign/source/ui/inc/GeometryHandler.hxx reportdesign/source/ui/inc/GroupsSorting.hxx reportdesign/source/ui/inc/IReportControllerObserver.hxx -reportdesign/source/ui/inc/MarkedSection.hxx reportdesign/source/ui/inc/Navigator.hxx reportdesign/source/ui/inc/PageNumber.hxx reportdesign/source/ui/inc/ReportComponentHandler.hxx commit 3b96aa6aadb5b8c937d7e2af35607fd58ef9a82b Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Wed Jul 16 16:05:58 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Thu Jul 17 07:23:14 2025 +0200 reportdesign: Drop OScrollWindowHelper_BASE typedef Change-Id: If5c2c2484303dd5ec5007ab5cbfc000b61d80e61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187963 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/reportdesign/source/ui/inc/ScrollHelper.hxx b/reportdesign/source/ui/inc/ScrollHelper.hxx index 6b73aa756fdc..a99d72e26b57 100644 --- a/reportdesign/source/ui/inc/ScrollHelper.hxx +++ b/reportdesign/source/ui/inc/ScrollHelper.hxx @@ -37,11 +37,10 @@ namespace rptui /** This class defines the scrollable area of the report design. It includes the h-ruler and the sections, and end marker. Not the start marker. */ - typedef vcl::Window OScrollWindowHelper_BASE; - class OScrollWindowHelper : public ::cppu::BaseMutex - , public OScrollWindowHelper_BASE/*TabPage*/ - , public ::comphelper::OPropertyChangeListener - , public IMarkedSection + class OScrollWindowHelper : public ::cppu::BaseMutex, + public vcl::Window, + public ::comphelper::OPropertyChangeListener, + public IMarkedSection { private: VclPtr<ScrollAdaptor> m_aHScroll; diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx index e028de9c7d5c..57439d320d20 100644 --- a/reportdesign/source/ui/report/ScrollHelper.cxx +++ b/reportdesign/source/ui/report/ScrollHelper.cxx @@ -43,7 +43,7 @@ static void lcl_setScrollBar(sal_Int32 _nNewValue,const Point& _aPos,const Size& OScrollWindowHelper::OScrollWindowHelper( ODesignView* _pDesignView) - : OScrollWindowHelper_BASE( _pDesignView,WB_DIALOGCONTROL) + : vcl::Window( _pDesignView,WB_DIALOGCONTROL) ,OPropertyChangeListener() ,m_aHScroll( VclPtr<ScrollAdaptor>::Create(this, true) ) ,m_aVScroll( VclPtr<ScrollAdaptor>::Create(this, false) ) @@ -78,7 +78,7 @@ void OScrollWindowHelper::dispose() m_aVScroll.disposeAndClear(); m_aReportWindow.disposeAndClear(); m_pParent.reset(); - OScrollWindowHelper_BASE::dispose(); + vcl::Window::dispose(); } void OScrollWindowHelper::impl_initScrollBar( ScrollAdaptor& _rScrollBar ) const @@ -166,7 +166,7 @@ Size OScrollWindowHelper::ResizeScrollBars() void OScrollWindowHelper::Resize() { - OScrollWindowHelper_BASE::Resize(); + vcl::Window::Resize(); const Size aTotalOutputSize = ResizeScrollBars(); m_aReportWindow->SetPosSizePixel(Point( 0, 0 ),aTotalOutputSize); @@ -323,7 +323,7 @@ bool OScrollWindowHelper::EventNotify( NotifyEvent& rNEvt ) if ( HandleScrollCommand( *pCommandEvent, pHScrBar, pVScrBar ) ) return true; } - return OScrollWindowHelper_BASE::EventNotify(rNEvt); + return vcl::Window::EventNotify(rNEvt); } void OScrollWindowHelper::alignMarkedObjects(ControlModification _nControlModification, bool _bAlignAtSection)