summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--comphelper/source/misc/accessiblecontexthelper.cxx2
-rw-r--r--comphelper/source/misc/accessibleeventnotifier.cxx2
-rw-r--r--svtools/source/control/accessibleruler.cxx23
-rw-r--r--sw/source/core/access/acccontext.cxx2
4 files changed, 11 insertions, 18 deletions
diff --git a/comphelper/source/misc/accessiblecontexthelper.cxx b/comphelper/source/misc/accessiblecontexthelper.cxx
index 5f855ed20681..bbc4102c10a8 100644
--- a/comphelper/source/misc/accessiblecontexthelper.cxx
+++ b/comphelper/source/misc/accessiblecontexthelper.cxx
@@ -151,7 +151,7 @@ namespace comphelper
if ( !isAlive() )
return;
- if ( _rxListener.is() )
+ if ( _rxListener.is() && m_pImpl->getClientId() )
{
sal_Int32 nListenerCount = AccessibleEventNotifier::removeEventListener( m_pImpl->getClientId( ), _rxListener );
if ( !nListenerCount )
diff --git a/comphelper/source/misc/accessibleeventnotifier.cxx b/comphelper/source/misc/accessibleeventnotifier.cxx
index 9c7d89a12985..742de12ff6cb 100644
--- a/comphelper/source/misc/accessibleeventnotifier.cxx
+++ b/comphelper/source/misc/accessibleeventnotifier.cxx
@@ -130,7 +130,7 @@ namespace
// look up this client
ClientMap &rClients = Clients::get();
rPos = rClients.find( nClient );
- OSL_ENSURE( rClients.end() != rPos,
+ assert( rClients.end() != rPos &&
"AccessibleEventNotifier::implLookupClient: invalid client id "
"(did you register your client?)!" );
diff --git a/svtools/source/control/accessibleruler.cxx b/svtools/source/control/accessibleruler.cxx
index bd71793865f4..f528ca65a505 100644
--- a/svtools/source/control/accessibleruler.cxx
+++ b/svtools/source/control/accessibleruler.cxx
@@ -260,7 +260,7 @@ void SAL_CALL SvtRulerAccessible::addAccessibleEventListener( const uno::Referen
void SAL_CALL SvtRulerAccessible::removeAccessibleEventListener( const uno::Reference< XAccessibleEventListener >& xListener )
throw( RuntimeException, std::exception )
{
- if (xListener.is())
+ if (xListener.is() && mnClientId)
{
::osl::MutexGuard aGuard( m_aMutex );
@@ -332,23 +332,16 @@ void SAL_CALL SvtRulerAccessible::disposing()
{
if( !rBHelper.bDisposed )
{
- {
- ::osl::MutexGuard aGuard( m_aMutex );
- mpRepr = nullptr; // object dies with representation
-
- }
+ ::osl::MutexGuard aGuard( m_aMutex );
+ mpRepr = nullptr; // object dies with representation
+ // Send a disposing to all listeners.
+ if ( mnClientId )
{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- // Send a disposing to all listeners.
- if ( mnClientId )
- {
- comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing( mnClientId, *this );
- mnClientId = 0;
- }
- mxParent.clear();
+ comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing( mnClientId, *this );
+ mnClientId = 0;
}
+ mxParent.clear();
}
}
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
index e0069991f214..52672aa34973 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -730,7 +730,7 @@ void SAL_CALL SwAccessibleContext::removeAccessibleEventListener(
const uno::Reference< XAccessibleEventListener >& xListener )
throw (uno::RuntimeException, std::exception)
{
- if (xListener.is())
+ if (xListener.is() && m_nClientId)
{
SolarMutexGuard aGuard;
sal_Int32 nListenerCount = comphelper::AccessibleEventNotifier::removeEventListener( m_nClientId, xListener );