Kaydet (Commit) e4e208fa authored tarafından Kohei Yoshida's avatar Kohei Yoshida

tdf#71409: properly remove itself from the context it listens.

When the context itself is being disposed.  While this solves the
issue of addAccessibleEventListener() being called twice despite
removeAccessibleEventListener() being called only once, it won't
solve the problem of leaky atk focus events.

Change-Id: I984107ed2d30e6dba8067d11f400ff64d665d157
üst 84f644ee
......@@ -196,6 +196,15 @@ void AtkListener::handleChildRemoved(
// for now.
if( nIndex >= 0 )
{
uno::Reference<accessibility::XAccessibleEventBroadcaster> xBroadcaster(
rxChild->getAccessibleContext(), uno::UNO_QUERY);
if (xBroadcaster.is())
{
uno::Reference<accessibility::XAccessibleEventListener> xListener(this);
xBroadcaster->removeAccessibleEventListener(xListener);
}
updateChildList(rxParent);
AtkObject * pChild = atk_object_wrapper_ref( rxChild, false );
......
......@@ -846,7 +846,10 @@ atk_object_wrapper_new( const css::uno::Reference< css::accessibility::XAccessib
{
uno::Reference< accessibility::XAccessibleEventBroadcaster > xBroadcaster(xContext, uno::UNO_QUERY);
if( xBroadcaster.is() )
xBroadcaster->addAccessibleEventListener( static_cast< accessibility::XAccessibleEventListener * > ( new AtkListener(pWrap) ) );
{
uno::Reference<accessibility::XAccessibleEventListener> xListener(new AtkListener(pWrap));
xBroadcaster->addAccessibleEventListener(xListener);
}
else
OSL_ASSERT( false );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment