From a19fac0de93bc45187628fa9cd5238ccb9cee0bf Mon Sep 17 00:00:00 2001 From: Andre Fische Date: Thu, 17 Feb 2011 10:24:49 +0100 Subject: impress211: #i114732# Revoke comphelper notification client only when it was previously registered. --- sd/source/ui/accessibility/AccessibleTreeNode.cxx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/accessibility/AccessibleTreeNode.cxx b/sd/source/ui/accessibility/AccessibleTreeNode.cxx index d59748047dee..bcf7b2c2fbce 100644 --- a/sd/source/ui/accessibility/AccessibleTreeNode.cxx +++ b/sd/source/ui/accessibility/AccessibleTreeNode.cxx @@ -133,8 +133,11 @@ void SAL_CALL AccessibleTreeNode::disposing (void) // probably are by now more or less dead and we must not call them to // unregister. - comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing( mnClientId, *this ); - mnClientId = 0; + if (mnClientId != 0) + { + comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing( mnClientId, *this ); + mnClientId = 0; + } } @@ -360,9 +363,10 @@ void SAL_CALL AccessibleTreeNode::addEventListener( } else { - if ( ! mnClientId) + if (mnClientId == 0) mnClientId = comphelper::AccessibleEventNotifier::registerClient(); - comphelper::AccessibleEventNotifier::addEventListener(mnClientId, rxListener); + if (mnClientId != 0) + comphelper::AccessibleEventNotifier::addEventListener(mnClientId, rxListener); } } } @@ -386,8 +390,11 @@ void SAL_CALL AccessibleTreeNode::removeEventListener( // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client), // and at least to us not firing any events anymore, in case somebody calls // NotifyAccessibleEvent, again - comphelper::AccessibleEventNotifier::revokeClient( mnClientId ); - mnClientId = 0; + if (mnClientId != 0) + { + comphelper::AccessibleEventNotifier::revokeClient( mnClientId ); + mnClientId = 0; + } } } } -- cgit