diff options
author | Andre Fischer <andre.f.fischer <Andre Fischer<andre.f.fischer@oracle.com> | 2011-02-17 10:24:49 +0100 |
---|---|---|
committer | Andre Fischer <andre.f.fischer <Andre Fischer<andre.f.fischer@oracle.com> | 2011-02-17 10:24:49 +0100 |
commit | 5b5932190f97f3f2c59578b16f1d643bf269ca35 (patch) | |
tree | 92edb9616d7c269146932f10dc8d61a12b085261 /sd | |
parent | 89ae9990f2c2b520445b2a27b8675c50872394f9 (diff) |
impress211: #i114732# Revoke comphelper notification client only when it was previously registered.
Diffstat (limited to 'sd')
-rwxr-xr-x | sd/source/ui/accessibility/AccessibleTreeNode.cxx | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/sd/source/ui/accessibility/AccessibleTreeNode.cxx b/sd/source/ui/accessibility/AccessibleTreeNode.cxx index ced9852b74c3..137ae572ead8 100755 --- a/sd/source/ui/accessibility/AccessibleTreeNode.cxx +++ b/sd/source/ui/accessibility/AccessibleTreeNode.cxx @@ -134,8 +134,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; + } } @@ -361,9 +364,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); } } } @@ -387,8 +391,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; + } } } } |