summaryrefslogtreecommitdiffstats
path: root/accessibility/source/extended/accessiblelistboxentry.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'accessibility/source/extended/accessiblelistboxentry.cxx')
-rw-r--r--accessibility/source/extended/accessiblelistboxentry.cxx50
1 files changed, 25 insertions, 25 deletions
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx
index 7b5b055f4d95..22dc36aef3a1 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -96,20 +96,20 @@ namespace accessibility
OSL_ENSURE( rEvent.GetWindow() , "AccessibleListBoxEntry::WindowEventListener: no event window!" );
OSL_ENSURE( rEvent.GetWindow() == m_pTreeListBox, "AccessibleListBoxEntry::WindowEventListener: where did this come from?" );
- if ( m_pTreeListBox != nullptr )
+ if ( m_pTreeListBox == nullptr )
+ return;
+
+ switch ( rEvent.GetId() )
{
- switch ( rEvent.GetId() )
+ case VclEventId::ObjectDying :
{
- case VclEventId::ObjectDying :
- {
- if ( m_pTreeListBox )
- m_pTreeListBox->RemoveEventListener( LINK( this, AccessibleListBoxEntry, WindowEventListener ) );
- m_pTreeListBox = nullptr;
- dispose();
- break;
- }
- default: break;
+ if ( m_pTreeListBox )
+ m_pTreeListBox->RemoveEventListener( LINK( this, AccessibleListBoxEntry, WindowEventListener ) );
+ m_pTreeListBox = nullptr;
+ dispose();
+ break;
}
+ default: break;
}
}
@@ -710,22 +710,22 @@ namespace accessibility
void SAL_CALL AccessibleListBoxEntry::removeAccessibleEventListener( const Reference< XAccessibleEventListener >& xListener )
{
- if (xListener.is())
- {
- ::osl::MutexGuard aGuard( m_aMutex );
+ if (!xListener.is())
+ return;
- sal_Int32 nListenerCount = comphelper::AccessibleEventNotifier::removeEventListener( m_nClientId, xListener );
- if ( !nListenerCount )
- {
- // no listeners anymore
- // -> 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
- sal_Int32 nId = m_nClientId;
- m_nClientId = 0;
- comphelper::AccessibleEventNotifier::revokeClient( nId );
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ sal_Int32 nListenerCount = comphelper::AccessibleEventNotifier::removeEventListener( m_nClientId, xListener );
+ if ( !nListenerCount )
+ {
+ // no listeners anymore
+ // -> 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
+ sal_Int32 nId = m_nClientId;
+ m_nClientId = 0;
+ comphelper::AccessibleEventNotifier::revokeClient( nId );
- }
}
}