diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-12-11 11:56:22 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-12-12 08:04:42 +0100 |
commit | 2e2fec9b0d8f39af8dbc8ba7d637629ba77ebfed (patch) | |
tree | 71decc3ab3d2e09df72cc5ff3c698c1264b6441c /toolkit/source | |
parent | e6f54da28699fcf4fbbe3a042c0906cb5623b9f4 (diff) |
a11y: Use vcl::Window for VCLXAccessibleComponent validity check
Instead of checking for VCLXWindow reference being non-empty,
check whether the VclPtr<vcl::Window> ptr is non-empty.
The latter should never be true unless the former is
because VCLXAccessibleComponent::DisconnectEvents
gets called before both possible calls to
m_xVCLXWindow.clear();
, and VCLXAccessibleComponent::DisconnectEvents
clears VCLXAccessibleComponent::m_xEventSource.
No change in behavior intended, but this further
reduces the use of the toolkit/UNO VCLXWindow
in favor of using the vcl::Window directly.
While at it, also drop the references to
tickets that don't provide any additional helpful
information:
"#122218#" is a reference to the StarDivision internal
StarOffice bugtracker, which is unavailable
"#i68079#" refers to [1], but also doesn't really
explain whether/why that check is needed:
From the initial description in that ticket:
> This is a follow-up of the issue 43665... We still have the patch in
> ooo-build; it applies in IMPL_LINK( VCLXAccessibleComponent,
> WindowChildEventListener, VclSimpleEvent*, pEvent ) (few lines below the
> original problem). Is it necessary (could it avoid a possible problem), or is
> it just bogus, and not needed?
Reply in comment 1:
> I'm not aware of any known issue, but I think this patch makes sense in
> order to avoid any potential problems. I will integrate this patch in
> one of the next childworkspaces.
[1] https://bz.apache.org/ooo/show_bug.cgi?id=68079
Change-Id: I14118cb95db4859ddac57d9646531cdbe0f967f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178304
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Diffstat (limited to 'toolkit/source')
-rw-r--r-- | toolkit/source/awt/vclxaccessiblecomponent.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx index 33f86114bdca..5de2f2698065 100644 --- a/toolkit/source/awt/vclxaccessiblecomponent.cxx +++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx @@ -101,7 +101,7 @@ IMPL_LINK( VCLXAccessibleComponent, WindowEventListener, VclWindowEvent&, rEvent * might have been destroyed by the previous VCLEventListener (if no AT tool * is running), e.g. sub-toolbars in impress. */ - if ( m_xVCLXWindow.is() /* #122218# */ && (rEvent.GetId() != VclEventId::WindowEndPopupMode) ) + if (m_xEventSource && (rEvent.GetId() != VclEventId::WindowEndPopupMode)) { DBG_ASSERT( rEvent.GetWindow(), "Window???" ); if( !rEvent.GetWindow()->IsAccessibilityEventsSuppressed() || ( rEvent.GetId() == VclEventId::ObjectDying ) ) @@ -113,7 +113,7 @@ IMPL_LINK( VCLXAccessibleComponent, WindowEventListener, VclWindowEvent&, rEvent IMPL_LINK( VCLXAccessibleComponent, WindowChildEventListener, VclWindowEvent&, rEvent, void ) { - if ( m_xVCLXWindow.is() /* #i68079# */ ) + if (m_xEventSource) { DBG_ASSERT( rEvent.GetWindow(), "Window???" ); if( !rEvent.GetWindow()->IsAccessibilityEventsSuppressed() ) |