From cd6d8538d09bd043b8d6432c76d83eb395c0a87a Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 6 Oct 2026 17:22:54 +0200 Subject: [PATCH] svtools: Drop always false ValueSet::InsertItem bLegend param No single caller passes any explicit value for that param, so the default of `false` is always used. Drop the param and simplify the implementation a bit. This will also allow for further cleanup in an upcoming commit. Change-Id: I0d2f691eecfac013bc8ad3e506484d958d18ce0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211909 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- include/svtools/valueset.hxx | 4 ++-- svtools/source/control/valueset.cxx | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx index 41709da40644..9d4272745ed9 100644 --- a/include/svtools/valueset.hxx +++ b/include/svtools/valueset.hxx @@ -278,9 +278,9 @@ public: /// Insert @rImage item. void InsertItem(sal_uInt16 nItemId, const Image& rImage); - /// Insert @rImage item with @rStr as either a legend or tooltip depending on @bShowLegend. + /// Insert @rImage item with @rStr as tooltip. void InsertItem(sal_uInt16 nItemId, const Image& rImage, - const OUString& rStr, size_t nPos = VALUESET_APPEND, bool bShowLegend = false); + const OUString& rStr, size_t nPos = VALUESET_APPEND); /// Insert an @rColor item with @rStr tooltip. void InsertItem(sal_uInt16 nItemId, const Color& rColor, const OUString& rStr); diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 1fa3899e9134..0ce64a382b3e 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -1455,12 +1455,11 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage ) } void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage, - const OUString& rText, size_t nPos, - bool bShowLegend ) + const OUString& rText, size_t nPos) { std::unique_ptr pItem(new ValueSetItem( *this )); pItem->mnId = nItemId; - pItem->meType = bShowLegend ? ValueSetItemType::ImageAndText : ValueSetItemType::Image; + pItem->meType = ValueSetItemType::Image; pItem->maImage = rImage; pItem->maText = rText; ImplInsertItem( std::move(pItem), nPos );