Kaydet (Commit) da21e9de authored tarafından Michael Stahl's avatar Michael Stahl

require OAccessibleContextHelper to be initialized with SolarMutex

OAccessibleContextHelper methods are locked by OExternalLockGuard
which effectively only locks its ExternalMutex (i.e. SolarMutex);
so ensure that all sub-classes actually pass in a SolarMutex
by removing the default constructor.

(since these classes are in comphelper they can only use the
SolarMutex indirectly)

This uncovers that AccessibleToolPanelDeckTabBarItem and
OAccessibleControlContext did not pass in SolarMutex before.

Change-Id: Ib9085eeee6225f7c74b158e72f04b1bf62622071
üst 43d1b80a
......@@ -29,6 +29,7 @@
#include <svtools/toolpanel/paneltabbar.hxx>
#include <unotools/accessiblestatesethelper.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
#include <toolkit/helper/externallock.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/svapp.hxx>
#include <osl/mutex.hxx>
......@@ -263,7 +264,10 @@ namespace accessibility
//------------------------------------------------------------------------------------------------------------------
AccessibleToolPanelDeckTabBarItem::AccessibleToolPanelDeckTabBarItem( const Reference< XAccessible >& i_rAccessibleParent,
::svt::IToolPanelDeck& i_rPanelDeck, ::svt::PanelTabBar& i_rTabBar, const size_t i_nItemPos )
:m_pImpl( new AccessibleToolPanelDeckTabBarItem_Impl( *this, i_rAccessibleParent, i_rPanelDeck, i_rTabBar, i_nItemPos ) )
: ::comphelper::OAccessibleExtendedComponentHelper(
new VCLExternalSolarLock)
, m_pImpl(new AccessibleToolPanelDeckTabBarItem_Impl(*this,
i_rAccessibleParent, i_rPanelDeck, i_rTabBar, i_nItemPos))
{
}
......
......@@ -32,11 +32,6 @@ namespace comphelper
//=====================================================================
//= OCommonAccessibleComponent
//=====================================================================
//---------------------------------------------------------------------
OCommonAccessibleComponent::OCommonAccessibleComponent( )
{
}
//---------------------------------------------------------------------
OCommonAccessibleComponent::OCommonAccessibleComponent( IMutex* _pExternalLock )
:OAccessibleContextHelper( _pExternalLock )
......@@ -46,9 +41,6 @@ namespace comphelper
//---------------------------------------------------------------------
OCommonAccessibleComponent::~OCommonAccessibleComponent( )
{
forgetExternalLock();
// this ensures that the lock, which may be already destroyed as part of the derivee,
// is not used anymore
}
//--------------------------------------------------------------------
......@@ -108,11 +100,6 @@ namespace comphelper
//=====================================================================
//= OAccessibleComponentHelper
//=====================================================================
//---------------------------------------------------------------------
OAccessibleComponentHelper::OAccessibleComponentHelper( )
{
}
//---------------------------------------------------------------------
OAccessibleComponentHelper::OAccessibleComponentHelper( IMutex* _pExternalLock )
:OCommonAccessibleComponent( _pExternalLock )
......@@ -157,11 +144,6 @@ namespace comphelper
//=====================================================================
//= OAccessibleExtendedComponentHelper
//=====================================================================
//---------------------------------------------------------------------
OAccessibleExtendedComponentHelper::OAccessibleExtendedComponentHelper( )
{
}
//---------------------------------------------------------------------
OAccessibleExtendedComponentHelper::OAccessibleExtendedComponentHelper( IMutex* _pExternalLock )
:OCommonAccessibleComponent( _pExternalLock )
......
......@@ -78,19 +78,12 @@ namespace comphelper
//=====================================================================
//= OAccessibleContextHelper
//=====================================================================
//---------------------------------------------------------------------
OAccessibleContextHelper::OAccessibleContextHelper( )
:OAccessibleContextHelper_Base( GetMutex() )
,m_pImpl( NULL )
{
m_pImpl = new OContextHelper_Impl();
}
//---------------------------------------------------------------------
OAccessibleContextHelper::OAccessibleContextHelper( IMutex* _pExternalLock )
:OAccessibleContextHelper_Base( GetMutex() )
,m_pImpl( NULL )
{
assert(_pExternalLock);
m_pImpl = new OContextHelper_Impl();
m_pImpl->setExternalLock( _pExternalLock );
}
......
......@@ -41,7 +41,6 @@ namespace comphelper
class COMPHELPER_DLLPUBLIC OCommonAccessibleComponent : public OAccessibleContextHelper
{
protected:
OCommonAccessibleComponent();
/// see the respective base class ctor for an extensive comment on this, please
OCommonAccessibleComponent( IMutex* _pExternalLock );
~OCommonAccessibleComponent();
......@@ -81,7 +80,6 @@ namespace comphelper
,public OAccessibleComponentHelper_Base
{
protected:
OAccessibleComponentHelper( );
/// see the respective base class ctor for an extensive comment on this, please
OAccessibleComponentHelper( IMutex* _pExternalLock );
......@@ -113,7 +111,6 @@ namespace comphelper
,public OAccessibleExtendedComponentHelper_Base
{
protected:
OAccessibleExtendedComponentHelper( );
/// see the respective base class ctor for an extensive comment on this, please
OAccessibleExtendedComponentHelper( IMutex* _pExternalLock );
......
......@@ -90,7 +90,6 @@ namespace comphelper
OContextHelper_Impl* m_pImpl;
protected:
OAccessibleContextHelper( );
~OAccessibleContextHelper( );
/** ctor
......@@ -141,6 +140,7 @@ namespace comphelper
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
getAccessibleCreator( ) const;
private:
/** 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>
......
......@@ -25,6 +25,7 @@
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <toolkit/helper/vclunohelper.hxx>
#include <toolkit/helper/externallock.hxx>
#include <vcl/window.hxx>
//........................................................................
......@@ -44,7 +45,7 @@ namespace toolkit
//====================================================================
//--------------------------------------------------------------------
OAccessibleControlContext::OAccessibleControlContext()
:OAccessibleControlContext_Base( )
: OAccessibleControlContext_Base(new VCLExternalSolarLock)
{
// nothing to do here, we have a late ctor
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment