accessibility/source/extended/accessibletablistboxtable.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit 645197d81fec7328b1ddef9d2996a2b068451b61 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Jul 21 11:33:04 2023 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Jul 21 15:03:30 2023 +0200 tdf#99609 a11y: Fix reporting selection in tab list table more Besides the issue already fixed in Change-Id I394027695616b17f7290136d8ee10c06a0282e80 ("tdf#99609 a11y: Fix reporting selection in tab list table"), the previous use of `GetEntry` here in `AccessibleTabListBoxTable` is problematic, as described for the previous uses in `SvTabListBox` and replaced in Change-Id I35f7280d2c386a9a8e04e636ebf34850a733c84a ("tdf#99609 a11y: Announce the correct entry in tab list box") and follow-up commits. Therefore, replace that here as well. Instead of having to use `SvTabListBox::GetEntryOnPos`, just use the existing `SvTabListBox` methods that already take a row index (and use `SvTabListBox::GetEntryOnPos` internally). This fixes querying the selected status of children (=cells) via the Selection interface. Sample use in Accerciser before, with the tree view in the Expert Configuration dialog selected in Accerciser's treeview of the a11y hierachy, and entry "org.openoffice.Interaction" selected in the dialog. Before: In [6]: sel = acc.querySelection() In [7]: sel.getSelectedChild(0).getIndexInParent() Out[7]: 56 In [8]: sel.isChildSelected(56) Out[8]: False In [9]: sel.selectChild(56) Out[9]: True In [10]: sel.getSelectedChild(0).getIndexInParent() Out[10]: 112 With the fix in place: In [11]: sel = acc.querySelection() In [12]: sel.getSelectedChild(0).getIndexInParent() Out[12]: 56 In [13]: sel.isChildSelected(56) Out[13]: True In [14]: sel.selectChild(56) Out[14]: True In [15]: sel.getSelectedChild(0).getIndexInParent() Out[15]: 56 In [16]: sel.selectChild(114) Out[16]: True In [17]: sel.getSelectedChild(0).getIndexInParent() Out[17]: 112 (112 instead of 114 for the index of the first selected child is OK because selecting a cell selects the whole row and child with index 112 is the first cell in the same row as the child with index 114.) Change-Id: I28cd1633dae601818e2a1d310859bd4d55d311ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154714 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/accessibility/source/extended/accessibletablistboxtable.cxx b/accessibility/source/extended/accessibletablistboxtable.cxx index a6997d37d5bf..7157febc3ea3 100644 --- a/accessibility/source/extended/accessibletablistboxtable.cxx +++ b/accessibility/source/extended/accessibletablistboxtable.cxx @@ -211,7 +211,7 @@ namespace accessibility void AccessibleTabListBoxTable::implSelectRow( sal_Int32 _nRow, bool _bSelect ) { if ( m_pTabListBox ) - m_pTabListBox->Select( m_pTabListBox->GetEntry( _nRow ), _bSelect ); + m_pTabListBox->SelectRow(_nRow, _bSelect); } sal_Int32 AccessibleTabListBoxTable::implGetRowCount() const @@ -280,7 +280,7 @@ namespace accessibility ensureIsAlive(); ensureValidIndex( nChildIndex ); - return m_pTabListBox && m_pTabListBox->IsSelected( m_pTabListBox->GetEntry( implGetRow( nChildIndex ) ) ); + return m_pTabListBox && m_pTabListBox->IsRowSelected(implGetRow(nChildIndex)); } void SAL_CALL AccessibleTabListBoxTable::clearAccessibleSelection( )