/binaryurp/

xt/html' href='https://go.suokunlong.cn:88/cgit/lo/core/commit/?id=812fe185fba48b439fb1229517d62aa67c209016'/> 812fe185fba48b439fb1229517d62aa67c209016 Previously, a new `QtXAccessible` object was created for an `XAccessible` each time before `QAccessible::queryAccessibleInterface` was called, which is not only unnecessary but also causes various issues, e.g. it breaks walking the a11y hierarchy upwards (i.e. from children to parents), since a new object is created for the parent. This introduces `QtAccessibleRegistry` that keeps a mapping between the `XAccessible` and the associated `QObject`. That mapping is used to reuse already created objects instead of creating new ones for the same `XAccessible`. The entry for an `XAccessible` is removed again from the map in `QtAccessibleWidget::invalidate`, which gets called when the `XAccessible` gets disposed, s. `QtAccessibleEventListener::disposing`. With this in place, Orca now also nicely announces only the text of the push buttons themselves in the "Save Document?" dialog when switching between the buttons using the Tab key, rather than announcing the whole widget hierarchy every time (probably because creating a new object every time prevented Orca from recognizing that the previously selected pushbutton and the newly selected one are siblings, i.e. have the same parent object.) Change-Id: Ic890a387ff016e889f25dba70c82d0d81ae7a9e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138757 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Previously, a new `QtXAccessible` object was created
for an `XAccessible` each time before
`QAccessible::queryAccessibleInterface` was called,
which is not only unnecessary but also causes
various issues, e.g. it breaks walking the a11y hierarchy
upwards (i.e. from children to parents), since a new
object is created for the parent.

This introduces `QtAccessibleRegistry` that keeps
a mapping between the `XAccessible` and
the associated `QObject`. That mapping is used
to reuse already created objects instead of creating
new ones for the same `XAccessible`.

The entry for an `XAccessible` is removed again from the
map in `QtAccessibleWidget::invalidate`, which gets called
when the `XAccessible` gets disposed,
s. `QtAccessibleEventListener::disposing`.

With this in place, Orca now also nicely announces
only the text of the push buttons themselves in the "Save Document?"
dialog when switching between the buttons using the
Tab key, rather than announcing the whole widget hierarchy
every time (probably because creating a new object every time
prevented Orca from recognizing that the previously selected
pushbutton and the newly selected one are siblings, i.e.
have the same parent object.)

Change-Id: Ic890a387ff016e889f25dba70c82d0d81ae7a9e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138757
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>