summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorAndre Fische <andre.f.fischer Andre Fischerandre.f.fischer@oracle.com>2011-02-17 10:24:49 +0100
committerMichael Meeks <michael.meeks@suse.com>2012-11-28 12:48:32 +0000
commita19fac0de93bc45187628fa9cd5238ccb9cee0bf (patch)
tree4039484265d665c1c51734187e478c5d404bdaa4 /sd
parent60157eabf35827a360ebc84c6381e1224685badc (diff)
impress211: #i114732# Revoke comphelper notification client only when it was previously registered.
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/accessibility/AccessibleTreeNode.cxx19
1 files changed, 13 insertions, 6 deletions
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;
+ }
}
}
}