@@ -418,7 +418,6 @@ void ValueItemAcc::FireAccessibleEvent( short nEventId, const uno::Any& rOldValu
418
418
}
419
419
420
420
ValueSetAcc::ValueSetAcc ( ValueSet* pParent ) :
421
- ValueSetAccComponentBase (m_aMutex),
422
421
mpParent( pParent ),
423
422
mbIsFocused(false )
424
423
{
@@ -661,7 +660,7 @@ lang::Locale SAL_CALL ValueSetAcc::getLocale()
661
660
void SAL_CALL ValueSetAcc::addAccessibleEventListener ( const uno::Reference< accessibility::XAccessibleEventListener >& rxListener )
662
661
{
663
662
ThrowIfDisposed ();
664
- ::osl::MutexGuard aGuard (m_aMutex);
663
+ std::unique_lock aGuard (m_aMutex);
665
664
666
665
if ( !rxListener.is () )
667
666
return ;
@@ -685,7 +684,7 @@ void SAL_CALL ValueSetAcc::addAccessibleEventListener( const uno::Reference< acc
685
684
void SAL_CALL ValueSetAcc::removeAccessibleEventListener ( const uno::Reference< accessibility::XAccessibleEventListener >& rxListener )
686
685
{
687
686
ThrowIfDisposed ();
688
- ::osl::MutexGuard aGuard (m_aMutex);
687
+ std::unique_lock aGuard (m_aMutex);
689
688
690
689
if ( rxListener.is () )
691
690
{
@@ -911,21 +910,19 @@ sal_Int64 SAL_CALL ValueSetAcc::getSomething( const uno::Sequence< sal_Int8 >& r
911
910
}
912
911
913
912
914
- void SAL_CALL ValueSetAcc::disposing ()
913
+ void ValueSetAcc::disposing (std::unique_lock<std::mutex>& rGuard )
915
914
{
916
- ::std::vector<uno::Reference<accessibility::XAccessibleEventListener> > aListenerListCopy;
915
+ // Make a copy of the list and clear the original.
916
+ ::std::vector<uno::Reference<accessibility::XAccessibleEventListener> > aListenerListCopy = std::move (mxEventListeners);
917
917
918
- {
919
- // Make a copy of the list and clear the original.
920
- const SolarMutexGuard aSolarGuard;
921
- ::osl::MutexGuard aGuard (m_aMutex);
922
- aListenerListCopy.swap (mxEventListeners);
923
-
924
- // Reset the pointer to the parent. It has to be the one who has
925
- // disposed us because he is dying.
926
- mpParent = nullptr ;
927
- }
918
+ // Reset the pointer to the parent. It has to be the one who has
919
+ // disposed us because he is dying.
920
+ mpParent = nullptr ;
921
+
922
+ if (aListenerListCopy.empty ())
923
+ return ;
928
924
925
+ rGuard.unlock ();
929
926
// Inform all listeners that this objects is disposing.
930
927
lang::EventObject aEvent (static_cast <accessibility::XAccessible*>(this ));
931
928
for (auto const & listenerCopy : aListenerListCopy)
@@ -974,7 +971,7 @@ ValueSetItem* ValueSetAcc::getItem (sal_uInt16 nIndex) const
974
971
975
972
void ValueSetAcc::ThrowIfDisposed ()
976
973
{
977
- if (rBHelper. bDisposed || rBHelper. bInDispose )
974
+ if (m_bDisposed )
978
975
{
979
976
SAL_WARN (" svx" , " Calling disposed object. Throwing exception:" );
980
977
throw lang::DisposedException (
0 commit comments