1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <comphelper/accessiblewrapper.hxx>
21 #include <com/sun/star/reflection/XProxyFactory.hpp>
22 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
23 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
27 using namespace ::comphelper
;
28 using namespace ::com::sun::star::accessibility
;
29 using namespace ::com::sun::star::uno
;
30 using namespace ::com::sun::star::lang
;
36 struct RemoveEventListener
37 : public ::std::unary_function
< AccessibleMap::value_type
, void >
40 Reference
< XEventListener
> m_xListener
;
43 RemoveEventListener( const Reference
< XEventListener
>& _rxListener
)
44 :m_xListener( _rxListener
)
48 void operator()( const AccessibleMap::value_type
& _rMapEntry
) const
50 Reference
< XComponent
> xComp( _rMapEntry
.first
, UNO_QUERY
);
52 xComp
->removeEventListener( m_xListener
);
57 struct DisposeMappedChild
58 : public ::std::unary_function
< AccessibleMap::value_type
, void >
60 void operator()( const AccessibleMap::value_type
& _rMapEntry
) const
62 Reference
< XComponent
> xContextComponent
;
63 if ( _rMapEntry
.second
.is() )
64 xContextComponent
.set(_rMapEntry
.second
->getAccessibleContext(), css::uno::UNO_QUERY
);
65 if ( xContextComponent
.is() )
66 xContextComponent
->dispose();
71 OWrappedAccessibleChildrenManager::OWrappedAccessibleChildrenManager( const Reference
< XComponentContext
>& _rxContext
)
72 :m_xContext( _rxContext
)
73 ,m_bTransientChildren( true )
78 OWrappedAccessibleChildrenManager::~OWrappedAccessibleChildrenManager( )
83 void OWrappedAccessibleChildrenManager::setTransientChildren( bool _bSet
)
85 m_bTransientChildren
= _bSet
;
89 void OWrappedAccessibleChildrenManager::setOwningAccessible( const Reference
< XAccessible
>& _rxAcc
)
91 OSL_ENSURE( !m_aOwningAccessible
.get().is(), "OWrappedAccessibleChildrenManager::setOwningAccessible: to be called only once!" );
92 m_aOwningAccessible
= WeakReference
< XAccessible
>( _rxAcc
);
96 void OWrappedAccessibleChildrenManager::removeFromCache( const Reference
< XAccessible
>& _rxKey
)
98 AccessibleMap::iterator aRemovedPos
= m_aChildrenMap
.find( _rxKey
);
99 if ( m_aChildrenMap
.end() != aRemovedPos
)
101 // remove ourself as event listener
102 RemoveEventListener
aOperator( this );
103 aOperator( *aRemovedPos
);
104 // and remove the entry from the map
105 m_aChildrenMap
.erase( aRemovedPos
);
110 void OWrappedAccessibleChildrenManager::invalidateAll( )
112 // remove as event listener from the map elements
113 ::std::for_each( m_aChildrenMap
.begin(), m_aChildrenMap
.end(), RemoveEventListener( this ) );
116 m_aChildrenMap
.swap( aMap
);
120 Reference
< XAccessible
> OWrappedAccessibleChildrenManager::getAccessibleWrapperFor(
121 const Reference
< XAccessible
>& _rxKey
, bool _bCreate
)
123 Reference
< XAccessible
> xValue
;
127 // fprintf( stderr, "It was this path that was crashing stuff\n" );
131 // do we have this child in the cahce?
132 AccessibleMap::const_iterator aPos
= m_aChildrenMap
.find( _rxKey
);
133 if ( m_aChildrenMap
.end() != aPos
)
135 xValue
= aPos
->second
;
138 { // not found in the cache, and allowed to create
140 xValue
= new OAccessibleWrapper( m_xContext
, _rxKey
, m_aOwningAccessible
);
142 // see if we do cache children
143 if ( !m_bTransientChildren
)
145 if (!m_aChildrenMap
.insert(
146 AccessibleMap::value_type( _rxKey
, xValue
) ).second
)
149 "OWrappedAccessibleChildrenManager::"
150 "getAccessibleWrapperFor: element was already"
154 // listen for disposals of inner children - this may happen when the inner context
155 // is the owner for the inner children (it will dispose these children, and of course
156 // not our wrapper for these children)
157 Reference
< XComponent
> xComp( _rxKey
, UNO_QUERY
);
159 xComp
->addEventListener( this );
167 void OWrappedAccessibleChildrenManager::dispose()
169 // dispose our children
170 ::std::for_each( m_aChildrenMap
.begin(), m_aChildrenMap
.end(), RemoveEventListener( this ) );
171 ::std::for_each( m_aChildrenMap
.begin(), m_aChildrenMap
.end(), DisposeMappedChild( ) );
172 // clear our children
174 m_aChildrenMap
.swap( aMap
);
178 void OWrappedAccessibleChildrenManager::implTranslateChildEventValue( const Any
& _rInValue
, Any
& _rOutValue
)
181 Reference
< XAccessible
> xChild
;
182 if ( _rInValue
>>= xChild
)
183 _rOutValue
<<= getAccessibleWrapperFor( xChild
, true );
187 void OWrappedAccessibleChildrenManager::translateAccessibleEvent( const AccessibleEventObject
& _rEvent
, AccessibleEventObject
& _rTranslatedEvent
)
189 // just in case we can't translate some of the values:
190 _rTranslatedEvent
.NewValue
= _rEvent
.NewValue
;
191 _rTranslatedEvent
.OldValue
= _rEvent
.OldValue
;
193 switch ( _rEvent
.EventId
)
195 case AccessibleEventId::CHILD
:
196 case AccessibleEventId::ACTIVE_DESCENDANT_CHANGED
:
197 case AccessibleEventId::CONTROLLED_BY_RELATION_CHANGED
:
198 case AccessibleEventId::CONTROLLER_FOR_RELATION_CHANGED
:
199 case AccessibleEventId::LABEL_FOR_RELATION_CHANGED
:
200 case AccessibleEventId::LABELED_BY_RELATION_CHANGED
:
201 case AccessibleEventId::CONTENT_FLOWS_FROM_RELATION_CHANGED
:
202 case AccessibleEventId::CONTENT_FLOWS_TO_RELATION_CHANGED
:
203 // these are events where both the old and the new value contain child references
204 implTranslateChildEventValue( _rEvent
.OldValue
, _rTranslatedEvent
.OldValue
);
205 implTranslateChildEventValue( _rEvent
.NewValue
, _rTranslatedEvent
.NewValue
);
208 case AccessibleEventId::NAME_CHANGED
:
209 case AccessibleEventId::DESCRIPTION_CHANGED
:
210 case AccessibleEventId::ACTION_CHANGED
:
211 case AccessibleEventId::STATE_CHANGED
:
212 case AccessibleEventId::BOUNDRECT_CHANGED
:
213 case AccessibleEventId::INVALIDATE_ALL_CHILDREN
:
214 case AccessibleEventId::SELECTION_CHANGED
:
215 case AccessibleEventId::VISIBLE_DATA_CHANGED
:
216 case AccessibleEventId::VALUE_CHANGED
:
217 case AccessibleEventId::MEMBER_OF_RELATION_CHANGED
:
218 case AccessibleEventId::CARET_CHANGED
:
219 case AccessibleEventId::TEXT_CHANGED
:
220 case AccessibleEventId::HYPERTEXT_CHANGED
:
221 case AccessibleEventId::TABLE_CAPTION_CHANGED
:
222 case AccessibleEventId::TABLE_COLUMN_DESCRIPTION_CHANGED
:
223 case AccessibleEventId::TABLE_COLUMN_HEADER_CHANGED
:
224 case AccessibleEventId::TABLE_MODEL_CHANGED
:
225 case AccessibleEventId::TABLE_ROW_DESCRIPTION_CHANGED
:
226 case AccessibleEventId::TABLE_ROW_HEADER_CHANGED
:
227 case AccessibleEventId::TABLE_SUMMARY_CHANGED
:
229 // these Ids are also missed: SUB_WINDOW_OF_RELATION_CHANGED & TEXT_ATTRIBUTE_CHANGED
230 case AccessibleEventId::TEXT_SELECTION_CHANGED
:
231 // nothing to translate
235 OSL_FAIL( "OWrappedAccessibleChildrenManager::translateAccessibleEvent: unknown (or unexpected) event id!" );
241 void OWrappedAccessibleChildrenManager::handleChildNotification( const AccessibleEventObject
& _rEvent
)
243 if ( AccessibleEventId::INVALIDATE_ALL_CHILDREN
== _rEvent
.EventId
)
244 { // clear our child map
247 else if ( AccessibleEventId::CHILD
== _rEvent
.EventId
)
249 // check if the removed or replaced element is cached
250 Reference
< XAccessible
> xRemoved
;
251 if ( _rEvent
.OldValue
>>= xRemoved
)
252 removeFromCache( xRemoved
);
257 void SAL_CALL
OWrappedAccessibleChildrenManager::disposing( const EventObject
& _rSource
) throw (RuntimeException
, std::exception
)
259 // this should come from one of the inner XAccessible's of our children
260 Reference
< XAccessible
> xSource( _rSource
.Source
, UNO_QUERY
);
261 AccessibleMap::iterator aDisposedPos
= m_aChildrenMap
.find( xSource
);
262 #if OSL_DEBUG_LEVEL > 0
263 if ( m_aChildrenMap
.end() == aDisposedPos
)
265 OSL_FAIL( "OWrappedAccessibleChildrenManager::disposing: where did this come from?" );
266 // helper for dignostics
267 Reference
< XAccessible
> xOwningAccessible( m_aOwningAccessible
);
268 Reference
< XAccessibleContext
> xContext
;
271 if ( xOwningAccessible
.is() )
272 xContext
= xOwningAccessible
->getAccessibleContext();
276 //OUString sName = xContext->getAccessibleName();
277 //OUString sDescription = xContext->getAccessibleDescription();
278 //sal_Int32 nPlaceYourBreakpointHere = 0;
281 catch( const Exception
& /*e*/ )
283 // silent this, it's only diagnostics which failed
287 if ( m_aChildrenMap
.end() != aDisposedPos
)
289 m_aChildrenMap
.erase( aDisposedPos
);
293 OAccessibleWrapper::OAccessibleWrapper( const Reference
< XComponentContext
>& _rxContext
,
294 const Reference
< XAccessible
>& _rxInnerAccessible
, const Reference
< XAccessible
>& _rxParentAccessible
)
295 :OAccessibleWrapper_Base( )
296 ,OComponentProxyAggregation( _rxContext
, Reference
< XComponent
>( _rxInnerAccessible
, UNO_QUERY
) )
297 ,m_xParentAccessible( _rxParentAccessible
)
298 ,m_xInnerAccessible( _rxInnerAccessible
)
303 OAccessibleWrapper::~OAccessibleWrapper( )
305 if ( !m_rBHelper
.bDisposed
)
307 acquire(); // to prevent duplicate dtor calls
313 IMPLEMENT_FORWARD_XTYPEPROVIDER2( OAccessibleWrapper
, OComponentProxyAggregation
, OAccessibleWrapper_Base
)
314 IMPLEMENT_FORWARD_REFCOUNT( OAccessibleWrapper
, OComponentProxyAggregation
)
317 Any
OAccessibleWrapper::queryInterface( const Type
& _rType
) throw (RuntimeException
, std::exception
)
319 // #111089# instead of the inner XAccessible the proxy XAccessible must be returned
320 Any aReturn
= OAccessibleWrapper_Base::queryInterface( _rType
);
321 if ( !aReturn
.hasValue() )
322 aReturn
= OComponentProxyAggregation::queryInterface( _rType
);
328 Reference
< XAccessibleContext
> OAccessibleWrapper::getContextNoCreate( ) const
334 OAccessibleContextWrapper
* OAccessibleWrapper::createAccessibleContext( const Reference
< XAccessibleContext
>& _rxInnerContext
)
336 return new OAccessibleContextWrapper( getComponentContext(), _rxInnerContext
, this, m_xParentAccessible
);
340 Reference
< XAccessibleContext
> SAL_CALL
OAccessibleWrapper::getAccessibleContext( ) throw (RuntimeException
, std::exception
)
342 // see if the context is still alive (we cache it)
343 Reference
< XAccessibleContext
> xContext
= m_aContext
;
344 if ( !xContext
.is() )
346 // create a new context
347 Reference
< XAccessibleContext
> xInnerContext
= m_xInnerAccessible
->getAccessibleContext( );
348 if ( xInnerContext
.is() )
350 xContext
= createAccessibleContext( xInnerContext
);
352 m_aContext
= WeakReference
< XAccessibleContext
>( xContext
);
359 OAccessibleContextWrapperHelper::OAccessibleContextWrapperHelper(
360 const Reference
< XComponentContext
>& _rxContext
,
361 ::cppu::OBroadcastHelper
& _rBHelper
,
362 const Reference
< XAccessibleContext
>& _rxInnerAccessibleContext
,
363 const Reference
< XAccessible
>& _rxOwningAccessible
,
364 const Reference
< XAccessible
>& _rxParentAccessible
)
365 :OComponentProxyAggregationHelper( _rxContext
, _rBHelper
)
366 ,m_xInnerContext( _rxInnerAccessibleContext
)
367 ,m_xOwningAccessible( _rxOwningAccessible
)
368 ,m_xParentAccessible( _rxParentAccessible
)
369 ,m_pChildMapper( NULL
)
371 // initialize the mapper for our children
372 m_pChildMapper
= new OWrappedAccessibleChildrenManager( getComponentContext() );
373 m_pChildMapper
->acquire();
375 // determine if we're allowed to cache children
376 Reference
< XAccessibleStateSet
> xStates( m_xInnerContext
->getAccessibleStateSet( ) );
377 OSL_ENSURE( xStates
.is(), "OAccessibleContextWrapperHelper::OAccessibleContextWrapperHelper: no inner state set!" );
378 m_pChildMapper
->setTransientChildren( !xStates
.is() || xStates
->contains( AccessibleStateType::MANAGES_DESCENDANTS
) );
380 m_pChildMapper
->setOwningAccessible( m_xOwningAccessible
);
384 void OAccessibleContextWrapperHelper::aggregateProxy( oslInterlockedCount
& _rRefCount
, ::cppu::OWeakObject
& _rDelegator
)
386 Reference
< XComponent
> xInnerComponent( m_xInnerContext
, UNO_QUERY
);
387 OSL_ENSURE( xInnerComponent
.is(), "OComponentProxyAggregation::aggregateProxy: accessible is no XComponent!" );
388 if ( xInnerComponent
.is() )
389 componentAggregateProxyFor( xInnerComponent
, _rRefCount
, _rDelegator
);
391 // add as event listener to the inner context, because we want to multiplex the AccessibleEvents
392 osl_atomic_increment( &_rRefCount
);
394 Reference
< XAccessibleEventBroadcaster
> xBroadcaster( m_xInner
, UNO_QUERY
);
395 if ( xBroadcaster
.is() )
396 xBroadcaster
->addAccessibleEventListener( this );
398 osl_atomic_decrement( &_rRefCount
);
402 OAccessibleContextWrapperHelper::~OAccessibleContextWrapperHelper( )
404 OSL_ENSURE( m_rBHelper
.bDisposed
, "OAccessibleContextWrapperHelper::~OAccessibleContextWrapperHelper: you should ensure (in your dtor) that the object is disposed!" );
406 m_pChildMapper
->release();
407 m_pChildMapper
= NULL
;
411 Any SAL_CALL
OAccessibleContextWrapperHelper::queryInterface( const Type
& _rType
) throw (RuntimeException
, std::exception
)
413 Any aReturn
= OComponentProxyAggregationHelper::queryInterface( _rType
);
414 if ( !aReturn
.hasValue() )
415 aReturn
= OAccessibleContextWrapperHelper_Base::queryInterface( _rType
);
420 IMPLEMENT_FORWARD_XTYPEPROVIDER2( OAccessibleContextWrapperHelper
, OComponentProxyAggregationHelper
, OAccessibleContextWrapperHelper_Base
)
423 sal_Int32
OAccessibleContextWrapperHelper::baseGetAccessibleChildCount( ) throw (RuntimeException
, std::exception
)
425 return m_xInnerContext
->getAccessibleChildCount();
429 Reference
< XAccessible
> OAccessibleContextWrapperHelper::baseGetAccessibleChild( sal_Int32 i
) throw (IndexOutOfBoundsException
, RuntimeException
, std::exception
)
431 // get the child of the wrapped component
432 Reference
< XAccessible
> xInnerChild
= m_xInnerContext
->getAccessibleChild( i
);
433 return m_pChildMapper
->getAccessibleWrapperFor( xInnerChild
);
437 Reference
< XAccessibleRelationSet
> OAccessibleContextWrapperHelper::baseGetAccessibleRelationSet( ) throw (RuntimeException
, std::exception
)
439 return m_xInnerContext
->getAccessibleRelationSet();
440 // TODO: if this relation set would contain relations to siblings, we would normally need
441 // to wrap them, too ....
445 void SAL_CALL
OAccessibleContextWrapperHelper::notifyEvent( const AccessibleEventObject
& _rEvent
) throw (RuntimeException
, std::exception
)
447 #if OSL_DEBUG_LEVEL > 0
448 if ( AccessibleEventId::STATE_CHANGED
== _rEvent
.EventId
)
450 bool bChildTransienceChanged
= false;
451 sal_Int16 nChangeState
= 0;
452 if ( _rEvent
.OldValue
>>= nChangeState
)
453 bChildTransienceChanged
= bChildTransienceChanged
|| AccessibleStateType::MANAGES_DESCENDANTS
== nChangeState
;
454 if ( _rEvent
.NewValue
>>= nChangeState
)
455 bChildTransienceChanged
= bChildTransienceChanged
|| AccessibleStateType::MANAGES_DESCENDANTS
== nChangeState
;
456 OSL_ENSURE( !bChildTransienceChanged
, "OAccessibleContextWrapperHelper::notifyEvent: MANAGES_DESCENDANTS is not expected to change during runtime!" );
457 // if this asserts, then we would need to update our m_bTransientChildren flag here,
458 // as well as (potentially) our child cache
461 AccessibleEventObject
aTranslatedEvent( _rEvent
);
464 ::osl::MutexGuard
aGuard( m_rBHelper
.rMutex
);
466 // translate the event
467 queryInterface( cppu::UnoType
<XInterface
>::get() ) >>= aTranslatedEvent
.Source
;
468 m_pChildMapper
->translateAccessibleEvent( _rEvent
, aTranslatedEvent
);
470 // see if any of these notifications affect our child manager
471 m_pChildMapper
->handleChildNotification( _rEvent
);
473 if ( aTranslatedEvent
.NewValue
== m_xInner
)
474 aTranslatedEvent
.NewValue
= makeAny(aTranslatedEvent
.Source
);
475 if ( aTranslatedEvent
.OldValue
== m_xInner
)
476 aTranslatedEvent
.OldValue
= makeAny(aTranslatedEvent
.Source
);
479 notifyTranslatedEvent( aTranslatedEvent
);
483 void SAL_CALL
OAccessibleContextWrapperHelper::dispose() throw( RuntimeException
, std::exception
)
485 ::osl::MutexGuard
aGuard( m_rBHelper
.rMutex
);
487 // stop multiplexing events
488 Reference
< XAccessibleEventBroadcaster
> xBroadcaster( m_xInner
, UNO_QUERY
);
489 OSL_ENSURE( xBroadcaster
.is(), "OAccessibleContextWrapperHelper::disposing(): inner context is no broadcaster!" );
490 if ( xBroadcaster
.is() )
491 xBroadcaster
->removeAccessibleEventListener( this );
493 // dispose the child cache/map
494 m_pChildMapper
->dispose();
496 // let the base class dispose the inner component
497 OComponentProxyAggregationHelper::dispose();
501 void SAL_CALL
OAccessibleContextWrapperHelper::disposing( const EventObject
& _rEvent
) throw (RuntimeException
, std::exception
)
503 // simply disambiguate this
504 OComponentProxyAggregationHelper::disposing( _rEvent
);
507 IMPLEMENT_FORWARD_XINTERFACE2( OAccessibleContextWrapper
, OAccessibleContextWrapper_CBase
, OAccessibleContextWrapperHelper
)
510 IMPLEMENT_FORWARD_XTYPEPROVIDER2( OAccessibleContextWrapper
, OAccessibleContextWrapper_CBase
, OAccessibleContextWrapperHelper
)
513 OAccessibleContextWrapper::OAccessibleContextWrapper( const Reference
< XComponentContext
>& _rxContext
,
514 const Reference
< XAccessibleContext
>& _rxInnerAccessibleContext
, const Reference
< XAccessible
>& _rxOwningAccessible
,
515 const Reference
< XAccessible
>& _rxParentAccessible
)
516 :OAccessibleContextWrapper_CBase( m_aMutex
)
517 ,OAccessibleContextWrapperHelper( _rxContext
, rBHelper
, _rxInnerAccessibleContext
, _rxOwningAccessible
, _rxParentAccessible
)
518 ,m_nNotifierClient( 0 )
520 aggregateProxy( m_refCount
, *this );
524 OAccessibleContextWrapper::~OAccessibleContextWrapper()
529 sal_Int32 SAL_CALL
OAccessibleContextWrapper::getAccessibleChildCount( ) throw (RuntimeException
, std::exception
)
531 return baseGetAccessibleChildCount();
535 Reference
< XAccessible
> SAL_CALL
OAccessibleContextWrapper::getAccessibleChild( sal_Int32 i
) throw (IndexOutOfBoundsException
, RuntimeException
, std::exception
)
537 return baseGetAccessibleChild( i
);
541 Reference
< XAccessible
> SAL_CALL
OAccessibleContextWrapper::getAccessibleParent( ) throw (RuntimeException
, std::exception
)
543 return m_xParentAccessible
;
547 sal_Int32 SAL_CALL
OAccessibleContextWrapper::getAccessibleIndexInParent( ) throw (RuntimeException
, std::exception
)
549 return m_xInnerContext
->getAccessibleIndexInParent();
553 sal_Int16 SAL_CALL
OAccessibleContextWrapper::getAccessibleRole( ) throw (RuntimeException
, std::exception
)
555 return m_xInnerContext
->getAccessibleRole();
559 OUString SAL_CALL
OAccessibleContextWrapper::getAccessibleDescription( ) throw (RuntimeException
, std::exception
)
561 return m_xInnerContext
->getAccessibleDescription();
565 OUString SAL_CALL
OAccessibleContextWrapper::getAccessibleName( ) throw (RuntimeException
, std::exception
)
567 return m_xInnerContext
->getAccessibleName();
571 Reference
< XAccessibleRelationSet
> SAL_CALL
OAccessibleContextWrapper::getAccessibleRelationSet( ) throw (RuntimeException
, std::exception
)
573 return baseGetAccessibleRelationSet();
577 Reference
< XAccessibleStateSet
> SAL_CALL
OAccessibleContextWrapper::getAccessibleStateSet( ) throw (RuntimeException
, std::exception
)
579 return m_xInnerContext
->getAccessibleStateSet();
583 Locale SAL_CALL
OAccessibleContextWrapper::getLocale( ) throw (IllegalAccessibleComponentStateException
, RuntimeException
, std::exception
)
585 return m_xInnerContext
->getLocale();
589 void OAccessibleContextWrapper::notifyTranslatedEvent( const AccessibleEventObject
& _rEvent
) throw (RuntimeException
)
591 if ( m_nNotifierClient
)
592 AccessibleEventNotifier::addEvent( m_nNotifierClient
, _rEvent
);
596 void SAL_CALL
OAccessibleContextWrapper::addAccessibleEventListener( const Reference
< XAccessibleEventListener
>& _rxListener
) throw (RuntimeException
, std::exception
)
598 ::osl::MutexGuard
aGuard( m_aMutex
);
599 if ( !m_nNotifierClient
)
600 m_nNotifierClient
= AccessibleEventNotifier::registerClient( );
601 AccessibleEventNotifier::addEventListener( m_nNotifierClient
, _rxListener
);
605 void SAL_CALL
OAccessibleContextWrapper::removeAccessibleEventListener( const Reference
< XAccessibleEventListener
>& _rxListener
) throw (RuntimeException
, std::exception
)
607 ::osl::MutexGuard
aGuard( m_aMutex
);
608 if ( m_nNotifierClient
)
610 if ( 0 == AccessibleEventNotifier::removeEventListener( m_nNotifierClient
, _rxListener
) )
612 AccessibleEventNotifier::TClientId
nId( m_nNotifierClient
);
613 m_nNotifierClient
= 0;
614 AccessibleEventNotifier::revokeClient( nId
);
620 void SAL_CALL
OAccessibleContextWrapper::disposing() throw (RuntimeException
)
622 AccessibleEventNotifier::TClientId
nClientId( 0 );
624 // --- <mutex lock> -----------------------------------------
626 ::osl::MutexGuard
aGuard( m_aMutex
);
628 // prepare notifying our AccessibleListeners
629 if ( m_nNotifierClient
)
631 nClientId
= m_nNotifierClient
;
632 m_nNotifierClient
= 0;
635 // --- </mutex lock> -----------------------------------------
637 // let the base class do
638 OAccessibleContextWrapperHelper::dispose();
640 // notify the disposal
642 AccessibleEventNotifier::revokeClientNotifyDisposing( nClientId
, *this );
644 } // namespace accessibility
647 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */