summaryrefslogtreecommitdiff
path: root/include/comphelper
diff options
context:
space:
mode:
authorArnaud Versini <arnaud.versini@gmail.com>2017-07-02 10:57:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-07 22:01:26 +0200
commite36e5dcc908bd996fba7012fa793ff094b1fb0c4 (patch)
tree68641bc970ba04a50da905f9d3df0969416b38d6 /include/comphelper
parentc5e4534808c03ce30c7b3e4bbed38ed5fca2d77f (diff)
comphelper : Simplify guards in OAccessibleContextHelper.
Change-Id: Iabc7293370c7a8b3fdccb00d6e1cdbfac4c46992 Reviewed-on: https://gerrit.libreoffice.org/39445 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/comphelper')
-rw-r--r--include/comphelper/accessiblecontexthelper.hxx35
1 files changed, 4 insertions, 31 deletions
diff --git a/include/comphelper/accessiblecontexthelper.hxx b/include/comphelper/accessiblecontexthelper.hxx
index 1cc27da80b3e..c29f61ff3bb0 100644
--- a/include/comphelper/accessiblecontexthelper.hxx
+++ b/include/comphelper/accessiblecontexthelper.hxx
@@ -48,6 +48,7 @@ namespace comphelper
:public ::cppu::BaseMutex
,public OAccessibleContextHelper_Base
{
+ friend class OContextEntryGuard;
private:
std::unique_ptr<OContextHelper_Impl> m_pImpl;
@@ -103,21 +104,6 @@ namespace comphelper
*/
virtual css::lang::Locale SAL_CALL getLocale( ) override;
- public:
- // helper struct for granting selective access rights
- struct OAccessControl
- {
- friend class OContextEntryGuard;
- friend class OContextHelper_Impl;
- friend class OExternalLockGuard;
- private:
- OAccessControl() { }
- };
-
- // ensures that the object is alive
- inline void ensureAlive( const OAccessControl& ) const;
- inline ::osl::Mutex& GetMutex( const OAccessControl& );
-
protected:
// OComponentHelper
virtual void SAL_CALL disposing() override;
@@ -162,21 +148,8 @@ namespace comphelper
};
- inline void OAccessibleContextHelper::ensureAlive( const OAccessControl& ) const
- {
- ensureAlive();
- }
-
-
- inline ::osl::Mutex& OAccessibleContextHelper::GetMutex( const OAccessControl& )
- {
- return GetMutex();
- }
-
-
//= OContextEntryGuard
- typedef ::osl::ClearableMutexGuard OContextEntryGuard_Base;
/** helper class for guarding the entry into OAccessibleContextHelper methods.
<p>The class has two responsibilities:
@@ -189,7 +162,7 @@ namespace comphelper
you derived class.
</p>
*/
- class OContextEntryGuard : public OContextEntryGuard_Base
+ class OContextEntryGuard : public ::osl::ClearableMutexGuard
{
public:
/** constructs the guard
@@ -206,9 +179,9 @@ namespace comphelper
inline OContextEntryGuard::OContextEntryGuard( OAccessibleContextHelper* _pContext )
- :OContextEntryGuard_Base( _pContext->GetMutex( OAccessibleContextHelper::OAccessControl() ) )
+ : ::osl::ClearableMutexGuard( _pContext->GetMutex() )
{
- _pContext->ensureAlive( OAccessibleContextHelper::OAccessControl() );
+ _pContext->ensureAlive();
}