diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-07-21 08:27:09 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-07-21 15:02:54 +0200 |
commit | 452c17e08fd8f18d032788170d873b019c8e9716 (patch) | |
tree | 8fde93c550e8b1930271a69b65a48ba8cc6a0a93 /vcl/source | |
parent | 1c0f0ab9b5bf23997640f44b7edd45c693c3f74d (diff) |
tdf#99609 a11y: Announce the correct entry in tab list box
The tree view in in the Expert Configuration dialog
has a lot of "<dummy>" entries to implement creating
entries on demand when expanding an entry (see
`SalInstanceTreeView`). While these
are not visible in the user interface, these
have the effect that calling
`SvTreeListBox::GetEntry` with the row index does
not actually return the correct entry, but an entry
further down in the tree view if there are non-expanded
nodes (as is the case e.g. right after opening
the Expert Configuration dialog, without having
done any search).
Use `SvTabListBox::GetEntryOnPos` that does exactly
what is needed and returns the correct entry.
With this in place, Orca with the qt6 VCL plugin
now correctly announces the focused entry in the
Expert Configuration dialog.
NVDA on Windows now also announces the focused
entry correctly at first. It then still always incorrectly
announces the first row as selected, but that's another
issue that will be addressed separately.
This fixes the remaining issue about the selected/focused
states not being reported correctly mentioned in
Change-Id I6b532bfd6c3f437e44b3d67da8a5cc5f77b562d2
("tdf#99609 a11y: Handle focused state for cells in tab list box"):
> This at least makes the focused state being reported
> properly for the first item ("org.openoffice.VCL")
> in the Expoert Configuration dialog, but others still happen to not
> have the focused state set properly when moving there with the arrow
> down key, so there seems to be another issue somewhere.
There are more uses of `GetEntry` that will be
looked at separately.
(Whether the dummy entries in the tree view should be exposed
as cells of the table on the accessibility layer, as it is now,
is another question, but leave it like that for now.
With gtk3, which uses native Gtk widgets instead,
the dummy entries are not exposed, which seems
reasonable.)
Change-Id: I35f7280d2c386a9a8e04e636ebf34850a733c84a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154687
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/treelist/svtabbx.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx index 2699ec4cfcf6..cad1a46bbb58 100644 --- a/vcl/source/treelist/svtabbx.cxx +++ b/vcl/source/treelist/svtabbx.cxx @@ -354,7 +354,7 @@ std::u16string_view SvTabListBox::GetToken( std::u16string_view sStr, sal_Int32& OUString SvTabListBox::GetTabEntryText( sal_uInt32 nPos, sal_uInt16 nCol ) const { - SvTreeListEntry* pEntry = SvTreeListBox::GetEntry( nPos ); + SvTreeListEntry* pEntry = GetEntryOnPos( nPos ); DBG_ASSERT( pEntry, "GetTabEntryText(): Invalid entry " ); OUStringBuffer aResult; if ( pEntry ) @@ -701,7 +701,7 @@ void SvHeaderTabListBox::SelectAll() void SvHeaderTabListBox::SelectRow( sal_Int32 _nRow, bool _bSelect, bool ) { - Select( GetEntry( _nRow ), _bSelect ); + Select( GetEntryOnPos( _nRow ), _bSelect ); } void SvHeaderTabListBox::SelectColumn( sal_uInt16, bool ) @@ -720,7 +720,7 @@ sal_Int32 SvHeaderTabListBox::GetSelectedColumnCount() const bool SvHeaderTabListBox::IsRowSelected( sal_Int32 _nRow ) const { - SvTreeListEntry* pEntry = GetEntry( _nRow ); + SvTreeListEntry* pEntry = GetEntryOnPos( _nRow ); return ( pEntry && IsSelected( pEntry ) ); } |