accessibility/source/extended/accessibleiconchoicectrl.cxx | 22 ---------- accessibility/source/extended/accessibleiconchoicectrlentry.cxx | 4 - include/vcl/toolkit/ivctrl.hxx | 2 vcl/source/control/imivctl.hxx | 2 vcl/source/control/imivctl1.cxx | 11 ----- vcl/source/control/ivctrl.cxx | 5 -- 6 files changed, 3 insertions(+), 43 deletions(-)
New commits: commit b3f8d9212e477bca4f94392bcc8e2d3efdcd65fa Author: Michael Weghorn <[email protected]> AuthorDate: Wed Jul 10 10:18:42 2024 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Jul 12 07:03:08 2024 +0200 icon choice ctrl a11y: Don't allow unselecting entry `SvtIconChoiceCtrl` is (only) used in `VerticalTabControl`, and having no tab selected doesn't make much sense. Support for non-single selection modes was dropped in commit af9413cb4ad49c0b4854c08cc2804644220755ae Author: Michael Weghorn <[email protected]> Date: Tue Jul 2 11:53:27 2024 +0200 tdf#161853 icon choice ctrl: Drop support for non-single selection modes Consequently, also drop support for explicitly unselecting one or all entries via the `XAccessibleSelection` interface in the corresponding a11y class, `AccessibleIconChoiceCtrl`. Drop the now unused `SvtIconChoiceCtrl::SetNoSelection` and `SvxIconChoiceCtrl_Impl::SetNoSelection`. This is also in line with handling for the the non-vertical tab control used elsewehere. Change-Id: I852b5bf7480daf18bfdf26c3105849c27624ad8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170369 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/accessibility/source/extended/accessibleiconchoicectrl.cxx b/accessibility/source/extended/accessibleiconchoicectrl.cxx index 877816466a19..061b7274e024 100644 --- a/accessibility/source/extended/accessibleiconchoicectrl.cxx +++ b/accessibility/source/extended/accessibleiconchoicectrl.cxx @@ -231,8 +231,7 @@ namespace accessibility void SAL_CALL AccessibleIconChoiceCtrl::clearAccessibleSelection( ) { - ::comphelper::OExternalLockGuard aGuard( this ); - getCtrl()->SetNoSelection(); + // one entry should always be selected, so don't unselect } void SAL_CALL AccessibleIconChoiceCtrl::selectAllAccessibleChildren( ) @@ -300,24 +299,7 @@ namespace accessibility if ( nSelectedChildIndex < 0 || nSelectedChildIndex >= getAccessibleChildCount() ) throw IndexOutOfBoundsException(); - sal_Int32 nSelCount = 0; - VclPtr<SvtIconChoiceCtrl> pCtrl = getCtrl(); - sal_Int32 nCount = pCtrl->GetEntryCount(); - bool bFound = false; - for ( sal_Int32 i = 0; i < nCount; ++i ) - { - SvxIconChoiceCtrlEntry* pEntry = pCtrl->GetEntry( i ); - if ( pEntry->IsSelected() ) - { - ++nSelCount; - if ( i == nSelectedChildIndex ) - bFound = true; - } - } - - // if only one entry is selected and its index is chosen to deselect -> no selection anymore - if ( nSelCount == 1 && bFound ) - pCtrl->SetNoSelection(); + // one entry should always be selected, so don't unselect } void AccessibleIconChoiceCtrl::FillAccessibleStateSet( sal_Int64& rStateSet ) diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx index 063ce54ff599..0e22da6bb385 100644 --- a/include/vcl/toolkit/ivctrl.hxx +++ b/include/vcl/toolkit/ivctrl.hxx @@ -178,8 +178,6 @@ public: tools::Rectangle GetBoundingBox( SvxIconChoiceCtrlEntry* pEntry ) const; tools::Rectangle GetEntryCharacterBounds( const sal_Int32 _nEntryPos, const sal_Int32 _nCharacterIndex ) const; - void SetNoSelection(); - // ACCESSIBILITY ========================================================== /** Creates and returns the accessible object of the Box. */ diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index 1d77a59488fb..9a46b6c1bbc1 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -225,8 +225,6 @@ public: void InvalidateEntry( SvxIconChoiceCtrlEntry* ); - void SetNoSelection(); - SvxIconChoiceCtrlEntry* GetCurEntry() const { return pCursor; } void SetCursor( SvxIconChoiceCtrlEntry* ); diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index f5ef978c1184..aa935c22632f 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -1091,17 +1091,6 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po rRenderContext.SetClipRegion(); } -void SvxIconChoiceCtrl_Impl::SetNoSelection() -{ - // block recursive calls via SelectEntry - if( !(nFlags & IconChoiceFlags::ClearingSelection )) - { - nFlags |= IconChoiceFlags::ClearingSelection; - DeselectAllBut( nullptr ); - nFlags &= ~IconChoiceFlags::ClearingSelection; - } -} - SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetEntry( const Point& rDocPos ) { CheckBoundingRects(); diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index 34e0a48f182b..0664ad9207a1 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -342,11 +342,6 @@ tools::Rectangle SvtIconChoiceCtrl::GetEntryCharacterBounds( const sal_Int32 _nE return aRect; } -void SvtIconChoiceCtrl::SetNoSelection() -{ - _pImpl->SetNoSelection(); -} - void SvtIconChoiceCtrl::CallImplEventListeners(VclEventId nEvent, void* pData) { CallEventListeners(nEvent, pData); commit 791c5b52f297f13746f4c23b005820b5e1adaddb Author: Michael Weghorn <[email protected]> AuthorDate: Wed Jul 10 10:36:05 2024 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Jul 12 07:03:00 2024 +0200 icon choice ctrl a11y: Don't explicitly unset selection `SvtIconChoiceCtrl::SetCursor` already takes care of unselecting all other entries when one is selected, so there's no need to explicitly call `SvtIconChoiceCtrl::SetNoSelection` first. This can e.g. be tested by triggering the action of the entries in the "Insert" -> "Hyperlink" dialog in Writer from Accerciser when running LO with the qt6 VCL plugin. The action causes the corresponding entry to get selected. Change-Id: Ic0c31d987b286095d58756fd92aacc662a723680 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170368 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx index 63e927cdb17a..ed43172a4753 100644 --- a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx +++ b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx @@ -641,7 +641,6 @@ namespace accessibility SvxIconChoiceCtrlEntry* pEntry = m_pIconCtrl->GetEntry( m_nIndex ); if ( pEntry && !pEntry->IsSelected() ) { - m_pIconCtrl->SetNoSelection(); m_pIconCtrl->SetCursor( pEntry ); bRet = true; } commit 818619567daf5ea72f4c10eb0728717744d36550 Author: Michael Weghorn <[email protected]> AuthorDate: Wed Jul 10 10:26:48 2024 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Jul 12 07:02:54 2024 +0200 icon choice ctrl a11y: Drop misleading comment There's only a single action, so the "only three actions" comment is misleading. Drop it. While at it, switch from `#define` to `constexpr` for the `ACCESSIBLE_ACTION_COUNT` constant. Change-Id: I2a031419d6166dee7f63612c6d51cc1232151110 Fixup Change-Id: Iea85d528468d7ae97b98439715cb9e18ee1d1fab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170367 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx index 869af7c3ffe1..63e927cdb17a 100644 --- a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx +++ b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx @@ -32,7 +32,7 @@ #include <comphelper/accessibleeventnotifier.hxx> #include <i18nlangtag/languagetag.hxx> -#define ACCESSIBLE_ACTION_COUNT 1 +constexpr sal_Int32 ACCESSIBLE_ACTION_COUNT = 1; namespace { @@ -40,7 +40,6 @@ namespace void checkActionIndex_Impl( sal_Int32 _nIndex ) { if ( _nIndex < 0 || _nIndex >= ACCESSIBLE_ACTION_COUNT ) - // only three actions throw css::lang::IndexOutOfBoundsException(); } }
