summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2023-07-21 18:20:25 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2023-07-21 22:47:53 +0200
commit0e3d0612a0942b3627a8dca61a072fc04f59d161 (patch)
tree5712a22e9a625c0c2212fd4ab32868f3ebde8877
parentef9bfcdbc67667f217ea01886ee728f8d1cbeb19 (diff)
a11y: Don't look for grandparent when asked for parent
`AccessibleListBoxEntry::implGetParentAccessible` was first retrieving the parent, and then that one's parent, which was failing (and thus returning an empty reference) e.g. for the 2nd level items (like "2nd Reminder") in Writer's AutoText Dialog (Ctrl+F3). This resulted in Orca not announcing any such item when focused with the qt6 VCL plugin in use, because Orca considers the object a zombie due to it reporting an index of -1 in the parent. Since the parent is requested, drop one level of finding the parent (don't look for the grandparent). Also convert an `OSL_ENSURE` to a real assert so this triggers if there are still any remaining issues that need to be addressed. This makes Orca announce the item just fine and the hierarchy now looks good in Accerciser, too. (Orca announces the item's text twice for qt6 now instead of not at all, which matches the behaviour with gtk3 that's using native Gtk widgets.) With the "2nd Reminder" item selected in Accerciser's treeview of the LO a11y hierarchy: Before: In [7]: acc.get_index_in_parent() Out[7]: -1 In [8]: acc.parent In [9]: acc.parent == None Out[9]: True With the fix in place: In [11]: acc.get_index_in_parent() Out[11]: 1 In [12]: acc.parent Out[12]: <Atspi.Accessible object at 0x7f14fa3e2340 (AtspiAccessible at 0x3c09da0)> In [13]: acc.parent.name Out[13]: 'Standard' Change-Id: I2994211368508c74093b73eb8c330aa293411e0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154746 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
-rw-r--r--accessibility/source/extended/accessiblelistboxentry.cxx5
1 files changed, 1 insertions, 4 deletions
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx
index 63d808b39cd2..de291fe529cb 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -335,10 +335,7 @@ namespace accessibility
// get the entry for this shortened access path
SvTreeListEntry* pParentEntry = m_pTreeListBox->GetEntryFromPath( aParentPath );
- OSL_ENSURE( pParentEntry, "AccessibleListBoxEntry::implGetParentAccessible: could not obtain a parent entry!" );
-
- if ( pParentEntry )
- pParentEntry = m_pTreeListBox->GetParent(pParentEntry);
+ assert(pParentEntry && "AccessibleListBoxEntry::implGetParentAccessible: could not obtain a parent entry!");
if ( pParentEntry )
{
uno::Reference<XAccessible> xListBox(m_wListBox);