Various VCLXAccessibleComponent subclasses were already
implementing the XAccessible interface and returning
`this` in their XAccessible::getAccessibleContext implementation.
Unify that and move the implementation to the
VCLXAccessibleComponent base class.
Locking specifics (whether a mutex was locked and which one)
and whether a check whether the accessible hadn't been
disposed yet was done varied across the different implementations.
The new VCLXAccessibleComponent::getAccessibleContext
unifies this to use OExternalLockGuard, i.e. it both locks
the mutex and throws an exception if the instance is no
longer alive.
Should this commit result in any issues, it's likely because
there is a preexisting locking issue or an object has already
been disposed and that needs to be addressed.
(The easiest approach in case of a disposed object would be
to simply catch + ignore the exception in the caller, but
a more thorough investigation would likely be helpful.)
This commit also prepares for letting vcl::Window create
its accessible directly, at which point the VCLXAccessibleWindow
will become both, its XAccessible and its XAccessibleContext
(while it is only the latter at the moment for those cases
still handled in Window::CreateAccessible, i.e. not an override
inside a subclass).
Change-Id: I62da0040e6c98636681c4f05dbd0b796dae5b928
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185839
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>