diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-07-10 10:18:42 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-07-12 07:03:08 +0200 |
commit | b3f8d9212e477bca4f94392bcc8e2d3efdcd65fa (patch) | |
tree | ba7f159a28633d9e3fd7272b4a46b23fe50bed3e /accessibility | |
parent | 791c5b52f297f13746f4c23b005820b5e1adaddb (diff) |
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 <m.weghorn@posteo.de>
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 <m.weghorn@posteo.de>
Diffstat (limited to 'accessibility')
-rw-r--r-- | accessibility/source/extended/accessibleiconchoicectrl.cxx | 22 |
1 files changed, 2 insertions, 20 deletions
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 ) |