include/comphelper/accessiblecontexthelper.hxx | 35 ++----------------------- 1 file changed, 4 insertions(+), 31 deletions(-)
New commits: commit e36e5dcc908bd996fba7012fa793ff094b1fb0c4 Author: Arnaud Versini <[email protected]> Date: Sun Jul 2 10:57:42 2017 +0200 comphelper : Simplify guards in OAccessibleContextHelper. Change-Id: Iabc7293370c7a8b3fdccb00d6e1cdbfac4c46992 Reviewed-on: https://gerrit.libreoffice.org/39445 Tested-by: Jenkins <[email protected]> Reviewed-by: Noel Grandin <[email protected]> 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(); } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
