diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-09-06 15:26:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-09-06 20:24:16 +0200 |
commit | d9e31f3c82082226dbc5afa697d0f0ac7e4214a2 (patch) | |
tree | 6765946c6688da36627206ed62fc76d2cadd805f /include/comphelper/accessiblewrapper.hxx | |
parent | 268a2009bc8acd9412183b4cd9bb7023b31e4f0b (diff) |
tdf#156683 a11y: Handle both disposing variants in context wrapper
commit db0044242a897e447988169630ff74e4c8bfecf9
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Wed Sep 6 09:12:23 2023 +0200
tdf#156683 a11y: Forward when wrapped a11y context is disposing
switched from overriding `disposing()` to overriding
`disposing(const css::lang::EventObject&)` in
`OAccessibleContextWrapperHelper` in order to
make sure that the corresponding entry in the
`AccessibleEventNotifier` client map is removed and
event listeners for the wrapper get notified
(via `AccessibleEventNotifier::revokeClientNotifyDisposing`)
when the wrapped object is disposing.
As Noel points out in [1], the `disposing()`
case should probably still be overriden/handled
and make sure that the wrapped object etc. get
disposed, so disposing one object via the other
works both ways.
(If the wrapped object is disposed, so is the
wrapper. If the wrapper gets disposed, so is
the wrapped object.)
Therefore, add back `OAccessibleContextWrapper::disposing()`
and extract the logic to a separate helper method
that is called from both `disposing` variants.
[1] https://gerrit.libreoffice.org/c/core/+/156592/comments/bb7c24bc_94033649
Change-Id: If15fd1839b222ad94fcbc569842dc43b517d3574
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156620
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/comphelper/accessiblewrapper.hxx')
-rw-r--r-- | include/comphelper/accessiblewrapper.hxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/comphelper/accessiblewrapper.hxx b/include/comphelper/accessiblewrapper.hxx index c2ababe40e1a..089c143b971f 100644 --- a/include/comphelper/accessiblewrapper.hxx +++ b/include/comphelper/accessiblewrapper.hxx @@ -297,8 +297,11 @@ namespace comphelper // OAccessibleContextWrapper virtual void notifyTranslatedEvent( const css::accessibility::AccessibleEventObject& _rEvent ) override; + // helper method for both 'disposing' methods + void implDisposing(const css::lang::EventObject* pEvent); + // OComponentHelper - using cppu::WeakComponentImplHelperBase::disposing; + void SAL_CALL disposing() override; // XAccessibleEventListener virtual void SAL_CALL disposing(const css::lang::EventObject& rEvent) override; |