From d52136a8335024c32c81bbe79fef3557baf8fc45 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 2 Jul 2024 16:47:09 +0200 Subject: tdf#161853 Drop SvxIconChoiceCtrl_Impl::GetSelectionCount Support for anything except single selection mode was dropped in Change-Id: I0acde664d695571e9058b9829ad02745a4abaad2 Author: Michael Weghorn Date: Tue Jul 2 11:53:27 2024 +0200 tdf#161853 icon choice ctrl: Drop support for non-single selection modes , so the selection count will usually be 1. The only use is in `SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry`, and should it be possible for no entry to be selected, that will still return `nullptr` anyway. Change-Id: I46562b448b59ba7013ff2e98cfba5925347e01a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169886 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- vcl/source/control/imivctl.hxx | 2 -- vcl/source/control/imivctl1.cxx | 13 ------------- 2 files changed, 15 deletions(-) (limited to 'vcl/source/control') diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index 712599364304..cd268c3d271a 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -141,7 +141,6 @@ class SvxIconChoiceCtrl_Impl LocalFocus aFocus; // Data for focusrect ::vcl::AccessibleFactoryAccess aAccFactory; - sal_Int32 nSelectionCount; SvxIconChoiceCtrlPositionMode ePositionMode; bool bBoundRectsDirty; bool bUpdateMode; @@ -309,7 +308,6 @@ public: void Command( const CommandEvent& rCEvt ); void ToTop( SvxIconChoiceCtrlEntry* ); - sal_Int32 GetSelectionCount() const; void SetGrid( const Size& ); Size GetMinGrid() const; void Scroll( tools::Long nDeltaX, tools::Long nDeltaY ); diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index ac384b34d167..27f363f4da76 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -107,7 +107,6 @@ SvxIconChoiceCtrl_Impl::~SvxIconChoiceCtrl_Impl() void SvxIconChoiceCtrl_Impl::Clear( bool bInCtor ) { - nSelectionCount = 0; pCurHighlightFrame = nullptr; CancelUserEvents(); ShowCursor( false ); @@ -256,14 +255,12 @@ void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, bool b { nEntryFlags |= SvxIconViewFlags::SELECTED; pEntry->AssignFlags( nEntryFlags ); - nSelectionCount++; pView->ClickIcon(); } else { nEntryFlags &= ~SvxIconViewFlags::SELECTED; pEntry->AssignFlags( nEntryFlags ); - nSelectionCount--; pView->ClickIcon(); } EntrySelected( pEntry, bSelect ); @@ -1805,13 +1802,6 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const tools::Rectangle& rRect, bool bS VisRectChanged(); } -sal_Int32 SvxIconChoiceCtrl_Impl::GetSelectionCount() const -{ - if( (nWinBits & WB_HIGHLIGHTFRAME) && pCurHighlightFrame ) - return 1; - return nSelectionCount; -} - void SvxIconChoiceCtrl_Impl::ToggleSelection( SvxIconChoiceCtrlEntry* pEntry ) { bool bSel; @@ -2124,9 +2114,6 @@ void SvxIconChoiceCtrl_Impl::InvalidateEntry( SvxIconChoiceCtrlEntry* pEntry ) SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry() const { - if( !GetSelectionCount() ) - return nullptr; - size_t nCount = maEntries.size(); if( !pHead ) { -- cgit