summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorArnaud Versini <arnaud.versini@gmail.com>2017-06-05 16:12:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-12 08:45:48 +0200
commita7532d8f061986c2e828df32f47f1fee1a339a14 (patch)
treea7a1421a1476e246e620a03c6188b312db015c06 /comphelper
parent0b8c2c72c988488895d74d1bb36e60378283a4da (diff)
Remove VCLExternalSolarLock and IMutex.
Next step is to remove OContextEntryGuard. Change-Id: I9460fb67fba6f3bfb3c809b730c33f38d225a64e Reviewed-on: https://gerrit.libreoffice.org/38411 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/misc/accessiblecomponenthelper.cxx9
-rw-r--r--comphelper/source/misc/accessiblecontexthelper.cxx38
-rw-r--r--comphelper/source/misc/accessibleselectionhelper.cxx2
-rw-r--r--comphelper/source/misc/accessibletexthelper.cxx3
4 files changed, 11 insertions, 41 deletions
diff --git a/comphelper/source/misc/accessiblecomponenthelper.cxx b/comphelper/source/misc/accessiblecomponenthelper.cxx
index a5211d6f3af9..ab01665afcf3 100644
--- a/comphelper/source/misc/accessiblecomponenthelper.cxx
+++ b/comphelper/source/misc/accessiblecomponenthelper.cxx
@@ -29,8 +29,7 @@ namespace comphelper
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::accessibility;
- OCommonAccessibleComponent::OCommonAccessibleComponent( IMutex* _pExternalLock )
- :OAccessibleContextHelper( _pExternalLock )
+ OCommonAccessibleComponent::OCommonAccessibleComponent( )
{
}
@@ -93,8 +92,7 @@ namespace comphelper
return implGetBounds();
}
- OAccessibleComponentHelper::OAccessibleComponentHelper( IMutex* _pExternalLock )
- :OCommonAccessibleComponent( _pExternalLock )
+ OAccessibleComponentHelper::OAccessibleComponentHelper( )
{
}
@@ -133,8 +131,7 @@ namespace comphelper
return OCommonAccessibleComponent::getBounds( );
}
- OAccessibleExtendedComponentHelper::OAccessibleExtendedComponentHelper( IMutex* _pExternalLock )
- :OCommonAccessibleComponent( _pExternalLock )
+ OAccessibleExtendedComponentHelper::OAccessibleExtendedComponentHelper( )
{
}
diff --git a/comphelper/source/misc/accessiblecontexthelper.cxx b/comphelper/source/misc/accessiblecontexthelper.cxx
index f03598df2c7c..df837e2e946b 100644
--- a/comphelper/source/misc/accessiblecontexthelper.cxx
+++ b/comphelper/source/misc/accessiblecontexthelper.cxx
@@ -24,25 +24,20 @@
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/accessibility/IllegalAccessibleComponentStateException.hpp>
#include <comphelper/accessibleeventnotifier.hxx>
+#include <comphelper/solarmutex.hxx>
namespace comphelper
{
-
-
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::accessibility;
- IMutex::~IMutex() {}
-
/** implementation class for OAccessibleContextHelper. No own thread safety!
*/
class OContextHelper_Impl
{
private:
- IMutex* m_pExternalLock; // the optional additional external lock
-
WeakReference< XAccessible > m_aCreator; // the XAccessible which created our XAccessibleContext
AccessibleEventNotifier::TClientId m_nClientId;
@@ -51,9 +46,6 @@ namespace comphelper
Reference< XAccessible > getCreator( ) const { return m_aCreator; }
inline void setCreator( const Reference< XAccessible >& _rAcc );
- IMutex* getExternalLock( ) { return m_pExternalLock; }
- void setExternalLock( IMutex* _pLock ) { m_pExternalLock = _pLock; }
-
AccessibleEventNotifier::TClientId
getClientId() const { return m_nClientId; }
void setClientId( const AccessibleEventNotifier::TClientId _nId )
@@ -61,8 +53,7 @@ namespace comphelper
public:
OContextHelper_Impl()
- :m_pExternalLock( nullptr )
- ,m_nClientId( 0 )
+ :m_nClientId( 0 )
{
}
};
@@ -73,26 +64,15 @@ namespace comphelper
m_aCreator = _rAcc;
}
- OAccessibleContextHelper::OAccessibleContextHelper( IMutex* _pExternalLock )
+ OAccessibleContextHelper::OAccessibleContextHelper( )
:OAccessibleContextHelper_Base( GetMutex() )
,m_pImpl(new OContextHelper_Impl)
{
- assert(_pExternalLock);
- m_pImpl->setExternalLock( _pExternalLock );
}
OAccessibleContextHelper::~OAccessibleContextHelper( )
{
- /* forgets the reference to the external lock, if present.
-
- <p>This means any further locking will not be guard the external lock anymore, never.</p>
-
- <p>To be used in derived classes which do not supply the external lock themself, but instead get
- them passed from own derivees (or clients).</p>
- */
- m_pImpl->setExternalLock( nullptr );
-
// this ensures that the lock, which may be already destroyed as part of the derivee,
// is not used anymore
@@ -100,17 +80,11 @@ namespace comphelper
}
- IMutex* OAccessibleContextHelper::getExternalLock( )
- {
- return m_pImpl->getExternalLock();
- }
-
-
void SAL_CALL OAccessibleContextHelper::disposing()
{
// rhbz#1001768: de facto this class is locked by SolarMutex;
// do not lock m_Mutex because it may cause deadlock
- OMutexGuard aGuard( getExternalLock() );
+ osl::Guard<SolarMutex> aGuard(SolarMutex::get());
if ( m_pImpl->getClientId( ) )
{
@@ -122,7 +96,7 @@ namespace comphelper
void SAL_CALL OAccessibleContextHelper::addAccessibleEventListener( const Reference< XAccessibleEventListener >& _rxListener )
{
- OMutexGuard aGuard( getExternalLock() );
+ osl::Guard<SolarMutex> aGuard(SolarMutex::get());
// don't use the OContextEntryGuard - it will throw an exception if we're not alive
// anymore, while the most recent specification for XComponent states that we should
// silently ignore the call in such a situation
@@ -145,7 +119,7 @@ namespace comphelper
void SAL_CALL OAccessibleContextHelper::removeAccessibleEventListener( const Reference< XAccessibleEventListener >& _rxListener )
{
- OMutexGuard aGuard( getExternalLock() );
+ osl::Guard<SolarMutex> aGuard(SolarMutex::get());
// don't use the OContextEntryGuard - it will throw an exception if we're not alive
// anymore, while the most recent specification for XComponent states that we should
// silently ignore the call in such a situation
diff --git a/comphelper/source/misc/accessibleselectionhelper.cxx b/comphelper/source/misc/accessibleselectionhelper.cxx
index fe5f47b97482..c19079226207 100644
--- a/comphelper/source/misc/accessibleselectionhelper.cxx
+++ b/comphelper/source/misc/accessibleselectionhelper.cxx
@@ -101,7 +101,7 @@ namespace comphelper
implSelect( nSelectedChildIndex, false );
}
- OAccessibleSelectionHelper::OAccessibleSelectionHelper( IMutex* _pExternalLock ) : OAccessibleComponentHelper(_pExternalLock)
+ OAccessibleSelectionHelper::OAccessibleSelectionHelper()
{
}
diff --git a/comphelper/source/misc/accessibletexthelper.cxx b/comphelper/source/misc/accessibletexthelper.cxx
index 13ab75e0f83b..99f095bdeb83 100644
--- a/comphelper/source/misc/accessibletexthelper.cxx
+++ b/comphelper/source/misc/accessibletexthelper.cxx
@@ -752,8 +752,7 @@ namespace comphelper
// OAccessibleTextHelper
- OAccessibleTextHelper::OAccessibleTextHelper( IMutex* _pExternalLock )
- :OAccessibleExtendedComponentHelper( _pExternalLock )
+ OAccessibleTextHelper::OAccessibleTextHelper( )
{
}