Remove all allocation of VCLExternalSolarLock.

This patch is graciously offered by Arnaud Versini.

Change-Id: I3ed5e1758d09542a2ca0533e3f4a6ceb2dbb6346
Reviewed-on: https://gerrit.libreoffice.org/38404
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Arnaud Versini
2017-06-05 12:34:39 +02:00
committed by Noel Grandin
parent 118bcbc83e
commit f2d40b8ba1
19 changed files with 35 additions and 45 deletions

View File

@@ -21,7 +21,6 @@
#ifndef ACCESSIBILITY_EXT_ACCESSIBLETABBARPAGELIST
#include "extended/accessibletabbarpagelist.hxx"
#endif
#include <toolkit/helper/externallock.hxx>
#include <svtools/tabbar.hxx>

View File

@@ -21,7 +21,6 @@
#include <standard/vclxaccessiblemenu.hxx>
#include <standard/vclxaccessiblemenuitem.hxx>
#include <standard/vclxaccessiblemenuseparator.hxx>
#include <toolkit/helper/externallock.hxx>
#include <toolkit/helper/convert.hxx>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>

View File

@@ -23,7 +23,6 @@
#include <helper/accresmgr.hxx>
#include <helper/accessiblestrings.hrc>
#include <toolkit/awt/vclxwindows.hxx>
#include <toolkit/helper/externallock.hxx>
#include <toolkit/helper/convert.hxx>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>

View File

@@ -18,7 +18,6 @@
*/
#include <standard/vclxaccessiblestatusbaritem.hxx>
#include <toolkit/helper/externallock.hxx>
#include <toolkit/helper/convert.hxx>
#include <helper/characterattributeshelper.hxx>

View File

@@ -18,7 +18,6 @@
*/
#include <standard/vclxaccessibletabpage.hxx>
#include <toolkit/helper/externallock.hxx>
#include <toolkit/helper/convert.hxx>
#include <helper/characterattributeshelper.hxx>

View File

@@ -38,7 +38,6 @@
#include <vcl/help.hxx>
#include <vcl/settings.hxx>
#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/helper/externallock.hxx>
#include <unotools/accessiblestatesethelper.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
#include <cppuhelper/typeprovider.hxx>

View File

@@ -30,7 +30,6 @@
#include <unotools/accessiblestatesethelper.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
#include <toolkit/awt/vclxfont.hxx>
#include <toolkit/helper/externallock.hxx>
#include <toolkit/helper/convert.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/svapp.hxx>
@@ -51,7 +50,7 @@ using namespace ::comphelper;
AccessibleDialogControlShape::AccessibleDialogControlShape (DialogWindow* pDialogWindow, DlgEdObj* pDlgEdObj)
:OAccessibleExtendedComponentHelper( new VCLExternalSolarLock )
:OAccessibleExtendedComponentHelper( &m_aLock )
,m_pDialogWindow( pDialogWindow )
,m_pDlgEdObj( pDlgEdObj )
{
@@ -71,8 +70,6 @@ AccessibleDialogControlShape::~AccessibleDialogControlShape()
{
if ( m_xControlModel.is() )
m_xControlModel->removePropertyChangeListener( OUString(), static_cast< beans::XPropertyChangeListener* >( this ) );
delete getExternalLock();
}

View File

@@ -34,7 +34,6 @@
#include <unotools/accessiblestatesethelper.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
#include <toolkit/awt/vclxfont.hxx>
#include <toolkit/helper/externallock.hxx>
#include <toolkit/helper/convert.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
@@ -100,7 +99,7 @@ bool AccessibleDialogWindow::ChildDescriptor::operator<( const ChildDescriptor&
AccessibleDialogWindow::AccessibleDialogWindow (basctl::DialogWindow* pDialogWindow)
: OAccessibleExtendedComponentHelper( new VCLExternalSolarLock )
: OAccessibleExtendedComponentHelper( &m_aLock)
, m_pDialogWindow(pDialogWindow)
, m_pDlgEditor(nullptr)
, m_pDlgEdModel(nullptr)
@@ -140,8 +139,6 @@ AccessibleDialogWindow::~AccessibleDialogWindow()
if ( m_pDlgEdModel )
EndListening( *m_pDlgEdModel );
delete getExternalLock();
}

View File

@@ -25,6 +25,7 @@
#include <comphelper/accessiblecomponenthelper.hxx>
#include <cppuhelper/implbase3.hxx>
#include <vcl/vclptr.hxx>
#include <toolkit/helper/externallock.hxx>
namespace vcl { class Window; }
@@ -46,7 +47,8 @@ typedef ::cppu::ImplHelper3<
css::lang::XServiceInfo,
css::beans::XPropertyChangeListener > AccessibleDialogControlShape_BASE;
class AccessibleDialogControlShape : public comphelper::OAccessibleExtendedComponentHelper,
class AccessibleDialogControlShape : private BaseVCLExternalSolarLock,
public comphelper::OAccessibleExtendedComponentHelper,
public AccessibleDialogControlShape_BASE
{
friend class AccessibleDialogWindow;

View File

@@ -27,6 +27,7 @@
#include <svl/lstner.hxx>
#include <tools/link.hxx>
#include <vcl/vclptr.hxx>
#include <toolkit/helper/externallock.hxx>
class VclSimpleEvent;
class VclWindowEvent;
@@ -51,7 +52,8 @@ typedef ::cppu::ImplHelper3 <
css::accessibility::XAccessibleSelection,
css::lang::XServiceInfo > AccessibleDialogWindow_BASE;
class AccessibleDialogWindow : public comphelper::OAccessibleExtendedComponentHelper,
class AccessibleDialogWindow : private BaseVCLExternalSolarLock,
public comphelper::OAccessibleExtendedComponentHelper,
public AccessibleDialogWindow_BASE,
public SfxListener
{

View File

@@ -30,6 +30,8 @@
#include <cppuhelper/implbase1.hxx>
#include <comphelper/accimplaccess.hxx>
#include <comphelper/accessiblecomponenthelper.hxx>
#include <toolkit/helper/externallock.hxx>
#include <tools/link.hxx>
#include <vcl/vclptr.hxx>
@@ -51,7 +53,8 @@ typedef ::cppu::ImplHelper1<
css::lang::XServiceInfo > VCLXAccessibleComponent_BASE;
class TOOLKIT_DLLPUBLIC VCLXAccessibleComponent
:public comphelper::OAccessibleExtendedComponentHelper
:private BaseVCLExternalSolarLock
,public comphelper::OAccessibleExtendedComponentHelper
,public ::comphelper::OAccessibleImplementationAccess
,public VCLXAccessibleComponent_BASE
{

View File

@@ -27,6 +27,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <vcl/vclptr.hxx>
#include <toolkit/helper/externallock.hxx>
namespace vcl { class Window; }
@@ -48,7 +49,8 @@ namespace toolkit
is being disposed.</p>
*/
class OAccessibleControlContext
:public ::comphelper::OAccessibleImplementationAccess
:private BaseVCLExternalSolarLock
,public ::comphelper::OAccessibleImplementationAccess
,public OAccessibleControlContext_Base
,public OAccessibleControlContext_IBase
{

View File

@@ -229,7 +229,7 @@ PoEntry::PoEntry(
OString sMsgCtxt =
rGroupId + "\n" +
(rLocalId.isEmpty() ? OString( "" ) : rLocalId + "\n") +
(rLocalId.isEmpty() ? OString() : rLocalId + "\n") +
rResType;
switch(eType){
case TTEXT:
@@ -243,7 +243,7 @@ PoEntry::PoEntry(
m_pGenPo->setMsgCtxt(sMsgCtxt);
m_pGenPo->setMsgId(rText);
m_pGenPo->setExtractCom(
( !rHelpText.isEmpty() ? rHelpText + "\n" : OString( "" )) +
( !rHelpText.isEmpty() ? rHelpText + "\n" : OString()) +
genKeyId( m_pGenPo->getReference() + rGroupId + rLocalId + rResType + rText ) );
m_bIsInitialized = true;
}

View File

@@ -25,6 +25,9 @@
#include <cppuhelper/implbase2.hxx>
#include <tools/link.hxx>
#include <toolkit/helper/externallock.hxx>
#include <vcl/vclptr.hxx>
#include <vector>
@@ -46,7 +49,8 @@ typedef ::cppu::ImplHelper2<
css::accessibility::XAccessible,
css::lang::XServiceInfo > VCLXAccessibleHeaderBarItem_BASE;
class VCLXAccessibleHeaderBarItem : public comphelper::OAccessibleExtendedComponentHelper,
class VCLXAccessibleHeaderBarItem : private BaseVCLExternalSolarLock,
public comphelper::OAccessibleExtendedComponentHelper,
public VCLXAccessibleHeaderBarItem_BASE
{
private:

View File

@@ -47,7 +47,7 @@ using namespace ::comphelper;
VCLXAccessibleHeaderBarItem::VCLXAccessibleHeaderBarItem( HeaderBar* pHeadBar, sal_Int32 _nIndexInParent )
:OAccessibleExtendedComponentHelper( new VCLExternalSolarLock )
:OAccessibleExtendedComponentHelper( &m_aLock )
,m_pHeadBar( pHeadBar )
,m_nIndexInParent(_nIndexInParent + 1)
@@ -56,7 +56,6 @@ VCLXAccessibleHeaderBarItem::VCLXAccessibleHeaderBarItem( HeaderBar* pHeadBar
VCLXAccessibleHeaderBarItem::~VCLXAccessibleHeaderBarItem()
{
delete getExternalLock();
}
void VCLXAccessibleHeaderBarItem::FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet )

View File

@@ -26,7 +26,6 @@
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <toolkit/helper/externallock.hxx>
#include <toolkit/helper/convert.hxx>
#include <osl/interlck.h>
#include <svx/dialmgr.hxx>
@@ -42,7 +41,7 @@ namespace svx
using namespace ::com::sun::star::accessibility;
SvxShowCharSetVirtualAcc::SvxShowCharSetVirtualAcc( SvxShowCharSet* pParent ) : OAccessibleComponentHelper(new VCLExternalSolarLock)
SvxShowCharSetVirtualAcc::SvxShowCharSetVirtualAcc( SvxShowCharSet* pParent ) : OAccessibleComponentHelper(&m_aLock)
,mpParent( pParent )
{
osl_atomic_increment(&m_refCount);
@@ -56,7 +55,6 @@ SvxShowCharSetVirtualAcc::SvxShowCharSetVirtualAcc( SvxShowCharSet* pParent ) :
SvxShowCharSetVirtualAcc::~SvxShowCharSetVirtualAcc()
{
ensureDisposed();
delete getExternalLock();
}
IMPLEMENT_FORWARD_XINTERFACE2( SvxShowCharSetVirtualAcc, OAccessibleComponentHelper, OAccessibleHelper_Base_2 )
@@ -255,7 +253,7 @@ uno::Reference< css::accessibility::XAccessible > SvxShowCharSetItem::GetAccessi
SvxShowCharSetAcc::SvxShowCharSetAcc( SvxShowCharSetVirtualAcc* _pParent ) : OAccessibleSelectionHelper(new VCLExternalSolarLock)
SvxShowCharSetAcc::SvxShowCharSetAcc( SvxShowCharSetVirtualAcc* _pParent ) : OAccessibleSelectionHelper(&m_aLock)
,m_pParent( _pParent )
{
osl_atomic_increment(&m_refCount);
@@ -269,7 +267,6 @@ SvxShowCharSetAcc::SvxShowCharSetAcc( SvxShowCharSetVirtualAcc* _pParent ) : OAc
SvxShowCharSetAcc::~SvxShowCharSetAcc()
{
ensureDisposed();
delete getExternalLock();
}
void SAL_CALL SvxShowCharSetAcc::disposing()
@@ -561,7 +558,7 @@ sal_Int32 SAL_CALL SvxShowCharSetAcc::getAccessibleColumn( sal_Int32 nChildIndex
}
SvxShowCharSetItemAcc::SvxShowCharSetItemAcc( SvxShowCharSetItem* pParent ) : OAccessibleComponentHelper(new VCLExternalSolarLock)
SvxShowCharSetItemAcc::SvxShowCharSetItemAcc( SvxShowCharSetItem* pParent ) : OAccessibleComponentHelper(&m_aLock)
,mpParent( pParent )
{
OSL_ENSURE(pParent,"NO parent supplied!");
@@ -576,7 +573,6 @@ SvxShowCharSetItemAcc::SvxShowCharSetItemAcc( SvxShowCharSetItem* pParent ) : OA
SvxShowCharSetItemAcc::~SvxShowCharSetItemAcc()
{
ensureDisposed();
delete getExternalLock();
}
IMPLEMENT_FORWARD_XINTERFACE2( SvxShowCharSetItemAcc, OAccessibleComponentHelper, OAccessibleHelper_Base_3 )

View File

@@ -25,6 +25,7 @@
#include <comphelper/accessibleselectionhelper.hxx>
#include <com/sun/star/accessibility/XAccessibleAction.hpp>
#include <com/sun/star/accessibility/XAccessibleTable.hpp>
#include <toolkit/helper/externallock.hxx>
#include <vector>
class SvxShowCharSet;
@@ -38,7 +39,8 @@ namespace svx
/** The class SvxShowCharSetVirtualAcc is used as a virtual class which contains the table and the scrollbar.
In the vcl control, the table and the scrollbar exists in one class. This is not feasible for the accessibility api.
*/
class SvxShowCharSetVirtualAcc : public ::comphelper::OAccessibleComponentHelper,
class SvxShowCharSetVirtualAcc : private BaseVCLExternalSolarLock,
public ::comphelper::OAccessibleComponentHelper,
public OAccessibleHelper_Base_2
{
VclPtr<SvxShowCharSet> mpParent; // the vcl control
@@ -120,7 +122,8 @@ namespace svx
/** The table implementation of the vcl control.
*/
class SvxShowCharSetAcc : public ::comphelper::OAccessibleSelectionHelper,
class SvxShowCharSetAcc : private BaseVCLExternalSolarLock,
public ::comphelper::OAccessibleSelectionHelper,
public OAccessibleHelper_Base
{
::std::vector< css::uno::Reference< css::accessibility::XAccessible > > m_aChildren;
@@ -209,7 +212,8 @@ namespace svx
/** The child implementation of the table.
*/
class SvxShowCharSetItemAcc : public ::comphelper::OAccessibleComponentHelper,
class SvxShowCharSetItemAcc : private BaseVCLExternalSolarLock,
public ::comphelper::OAccessibleComponentHelper,
public OAccessibleHelper_Base_3
{
private:

View File

@@ -25,7 +25,6 @@
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <cppuhelper/supportsservice.hxx>
#include <toolkit/awt/vclxaccessiblecomponent.hxx>
#include <toolkit/helper/externallock.hxx>
#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/helper/convert.hxx>
#include <toolkit/awt/vclxfont.hxx>
@@ -44,7 +43,7 @@ using namespace ::com::sun::star;
using namespace ::comphelper;
VCLXAccessibleComponent::VCLXAccessibleComponent( VCLXWindow* pVCLXWindow )
: OAccessibleExtendedComponentHelper( new VCLExternalSolarLock )
: OAccessibleExtendedComponentHelper( &m_aLock )
, OAccessibleImplementationAccess( )
{
m_xVCLXWindow = pVCLXWindow;
@@ -80,14 +79,6 @@ VCLXAccessibleComponent::~VCLXAccessibleComponent()
{
ensureDisposed();
DisconnectEvents();
delete getExternalLock();
// This is not completely safe. If we assume that the base class dtor calls some method which
// uses this lock, the we crash. However, as the base class' dtor does not have a chance to call _out_
// virtual methods, this is no problem as long as the base class is safe, i.e. does not use the external
// lock from within it's dtor. At the moment, we _know_ the base class is safe in this respect, so
// let's assume it keeps this way.
// @see OAccessibleContextHelper::OAccessibleContextHelper( IMutex* )
}
IMPLEMENT_FORWARD_XINTERFACE3( VCLXAccessibleComponent, OAccessibleExtendedComponentHelper, OAccessibleImplementationAccess, VCLXAccessibleComponent_BASE )

View File

@@ -26,7 +26,6 @@
#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>
@@ -46,7 +45,7 @@ namespace toolkit
OAccessibleControlContext::OAccessibleControlContext()
: OAccessibleControlContext_Base(new VCLExternalSolarLock)
: OAccessibleControlContext_Base(&m_aLock)
{
// nothing to do here, we have a late ctor
}