From dc79823c7e9bc43472e6e4a02b19a7132e48619f Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 6 Oct 2026 17:39:23 +0200 Subject: [PATCH] svtools: Drop unused ValueSet::{Format,ImpFormatItem} param Now after Change-Id: I3593630b4758d0547264c0ed63fec7ac111ccfd7 Author: Michael Weghorn Date: Tue Oct 6 17:30:24 2026 +0200 svtools: Drop ValueSetItemType::ImageAndText and related logic , the `rRendercontext` param for ValueSet::ImplFormatItem is unused, so drop it, and also the then unused corresponding ValueSet::Format param. Change-Id: Ibc8afabf147974da1ed67ef903abc13c054c4c12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211911 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- include/svtools/valueset.hxx | 5 ++--- svtools/source/control/valueset.cxx | 13 ++++++------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx index 9d4272745ed9..4d209ea41fc1 100644 --- a/include/svtools/valueset.hxx +++ b/include/svtools/valueset.hxx @@ -212,8 +212,7 @@ private: friend class ValueSetAcc; SVT_DLLPRIVATE void ImplDeleteItems(); - SVT_DLLPRIVATE void ImplFormatItem(vcl::RenderContext const& rRenderContext, - ValueSetItem& rItem, tools::Rectangle aRect); + SVT_DLLPRIVATE void ImplFormatItem(ValueSetItem& rItem, tools::Rectangle aRect); // nItemId is the item to draw selected, but if nothing is selected something else may be drawn as selected instead, the item to draw // selected is returned SVT_DLLPRIVATE ValueSetItem* ImplGetDrawSelectItem(sal_uInt16 nItemId, const bool bFocus, tools::Rectangle& rRect); @@ -349,7 +348,7 @@ public: void SetExtraSpacing( sal_uInt16 nNewSpacing ); void SetMargin( sal_uInt16 nNewMargin ); - void Format(vcl::RenderContext const & rRenderContext); + void Format(); void SetFormat(); Size CalcWindowSizePixel(const Size& rItemSize, diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index a0b406e97ac7..c20a50492346 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -627,7 +627,7 @@ void ValueSet::ImplHighlightItem(sal_uInt16 nItemId) void ValueSet::ImplDraw(vcl::RenderContext& rRenderContext) { if (mbFormat) - Format(rRenderContext); + Format(); Point aDefPos; Size aSize = maVirDev->GetOutputSizePixel(); @@ -668,9 +668,9 @@ void ValueSet::SelectItem( sal_uInt16 nItemId ) bool bNewOut = !mbFormat && IsReallyVisible(); bool bNewLine = false; - if (weld::DrawingArea* pNeedsFormatToScroll = !mnCols ? GetDrawingArea() : nullptr) + if (!mnCols && GetDrawingArea()) { - Format(pNeedsFormatToScroll->get_ref_device()); + Format(); // reset scrollbar so it's set to the later calculated mnFirstLine on // the next Format RecalcScrollBar(); @@ -774,7 +774,7 @@ void ValueSet::SetStyle(WinBits nStyle) } } -void ValueSet::Format(vcl::RenderContext const & rRenderContext) +void ValueSet::Format() { Size aWinSize(GetOutputSizePixel()); size_t nItemCount = mItemList.size(); @@ -972,7 +972,7 @@ void ValueSet::Format(vcl::RenderContext const & rRenderContext) } pItem->mbVisible = true; - ImplFormatItem(rRenderContext, *pItem, + ImplFormatItem(*pItem, tools::Rectangle(Point(x, y), Size(mnItemWidth, mnItemHeight))); if (!((i + 1) % mnCols)) @@ -1218,8 +1218,7 @@ void ValueSet::ImplDrawSelect(vcl::RenderContext& rRenderContext, const tools::R } } -void ValueSet::ImplFormatItem(vcl::RenderContext const&, ValueSetItem& rItem, - tools::Rectangle aRect) +void ValueSet::ImplFormatItem(ValueSetItem& rItem, tools::Rectangle aRect) { WinBits nStyle = GetStyle(); if (nStyle & WB_ITEMBORDER)