summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2025-02-04 16:52:50 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2025-02-05 08:37:28 +0100
commit1a40b93d11b940bfff020e330ee23801b10826a2 (patch)
treeb4d3118aaf400d763a940ef53212e29effd1d1ab
parent8b9a7146bc6d8ccd19968b89ed97ce59cd466573 (diff)
treeview a11y: Don't report header twice
AccessibleTabListBox is the a11y class for SvHeaderTabListBox. That widget only contains the table without the header, while the (column) header is implemented by HeaderBar which is a sibling of the SvHeaderTabListBox, see the "GtkTreeView" case in VclBuilder::makeObject. The header bar is already part of the a11y tree as a11y class for the HeaderBar. The fact that AccessibleTabListBox::getAccessibleChild was reporting that as a child as well resulted in the header bar (an a11y object with Table role) to appear in the a11y hierarchy seen in Accerciser twice when using the qt6 VCL plugin. (And clicking on it would result in an area to be highlighted that is not part of the area that the parent a11y object occupies. No longer report it as a child of the AccessibleTabListBox. The above can be observed with the "Tools" -> "Options" -> "Advanced" -> "Open Expert Configuration" dialog and the qt6 VCL plugin on Linux. Change-Id: If3099e12dd84cd4f3c420e94c377182c87c65106 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181137 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
-rw-r--r--vcl/source/accessibility/accessibletablistbox.cxx19
1 files changed, 4 insertions, 15 deletions
diff --git a/vcl/source/accessibility/accessibletablistbox.cxx b/vcl/source/accessibility/accessibletablistbox.cxx
index c5e98159abf9..dcda21b84af7 100644
--- a/vcl/source/accessibility/accessibletablistbox.cxx
+++ b/vcl/source/accessibility/accessibletablistbox.cxx
@@ -63,7 +63,8 @@ rtl::Reference<AccessibleBrowseBoxTable> AccessibleTabListBox::createAccessibleT
sal_Int64 SAL_CALL AccessibleTabListBox::getAccessibleChildCount()
{
- return 2; // header and table
+ // only the table; header is handled by HeaderBar (which is a sibling of the SvHeaderTabListBox)
+ return 1;
}
Reference< XAccessibleContext > SAL_CALL AccessibleTabListBox::getAccessibleContext()
@@ -77,22 +78,10 @@ AccessibleTabListBox::getAccessibleChild( sal_Int64 nChildIndex )
SolarMethodGuard aGuard(getMutex());
ensureIsAlive();
- if ( nChildIndex < 0 || nChildIndex > 1 )
+ if (nChildIndex != 0)
throw IndexOutOfBoundsException();
- Reference< XAccessible > xRet;
- if (nChildIndex == 0)
- {
- //! so far the actual implementation object only supports column headers
- xRet = implGetHeaderBar( AccessibleBrowseBoxObjType::ColumnHeaderBar );
- }
- else if (nChildIndex == 1)
- xRet = implGetTable();
-
- if ( !xRet.is() )
- throw RuntimeException(u"getAccessibleChild called with NULL xRet"_ustr,getXWeak());
-
- return xRet;
+ return implGetTable();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */