diff options
11 files changed, 27 insertions, 37 deletions
diff --git a/accessibility/inc/extended/accessibletabbarbase.hxx b/accessibility/inc/extended/accessibletabbarbase.hxx index 78162bf8f43e..d2d6ab83cc3c 100644 --- a/accessibility/inc/extended/accessibletabbarbase.hxx +++ b/accessibility/inc/extended/accessibletabbarbase.hxx @@ -23,6 +23,7 @@ #include <comphelper/accessiblecomponenthelper.hxx> #include <tools/link.hxx> #include <vcl/vclptr.hxx> +#include <toolkit/helper/externallock.hxx> class TabBar; class VCLExternalSolarLock; @@ -33,7 +34,8 @@ class VclWindowEvent; namespace accessibility { -class AccessibleTabBarBase : public comphelper::OAccessibleExtendedComponentHelper +class AccessibleTabBarBase : private BaseVCLExternalSolarLock, + public comphelper::OAccessibleExtendedComponentHelper { public: explicit AccessibleTabBarBase( TabBar* pTabBar ); @@ -52,7 +54,6 @@ private: void ClearTabBarPointer(); protected: - VCLExternalSolarLock* m_pExternalLock; VclPtr<TabBar> m_pTabBar; }; diff --git a/accessibility/inc/standard/accessiblemenubasecomponent.hxx b/accessibility/inc/standard/accessiblemenubasecomponent.hxx index 43039facbbee..ba401354f810 100644 --- a/accessibility/inc/standard/accessiblemenubasecomponent.hxx +++ b/accessibility/inc/standard/accessiblemenubasecomponent.hxx @@ -27,13 +27,13 @@ #include <cppuhelper/implbase2.hxx> #include <tools/link.hxx> #include <vcl/vclptr.hxx> +#include <toolkit/helper/externallock.hxx> #include <vector> class Menu; class VclSimpleEvent; class VclMenuEvent; -class VCLExternalSolarLock; namespace utl { class AccessibleStateSetHelper; @@ -46,7 +46,8 @@ typedef ::cppu::ImplHelper2< css::accessibility::XAccessible, css::lang::XServiceInfo > OAccessibleMenuBaseComponent_BASE; -class OAccessibleMenuBaseComponent : public comphelper::OAccessibleExtendedComponentHelper, +class OAccessibleMenuBaseComponent : private BaseVCLExternalSolarLock, + public comphelper::OAccessibleExtendedComponentHelper, public OAccessibleMenuBaseComponent_BASE { friend class OAccessibleMenuItemComponent; diff --git a/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx b/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx index 5fb0813a44f8..163fd663f5b6 100644 --- a/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx +++ b/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx @@ -25,9 +25,9 @@ #include <comphelper/accessibletexthelper.hxx> #include <cppuhelper/implbase2.hxx> #include <vcl/vclptr.hxx> +#include <toolkit/helper/externallock.hxx> class StatusBar; -class VCLExternalSolarLock; namespace utl { class AccessibleStateSetHelper; @@ -43,13 +43,13 @@ typedef ::cppu::ImplHelper2< css::accessibility::XAccessible, css::lang::XServiceInfo > VCLXAccessibleStatusBarItem_BASE; -class VCLXAccessibleStatusBarItem : public AccessibleTextHelper_BASE, +class VCLXAccessibleStatusBarItem : private BaseVCLExternalSolarLock, + public AccessibleTextHelper_BASE, public VCLXAccessibleStatusBarItem_BASE { friend class VCLXAccessibleStatusBar; private: - VCLExternalSolarLock* m_pExternalLock; VclPtr<StatusBar> m_pStatusBar; sal_uInt16 m_nItemId; OUString m_sItemName; diff --git a/accessibility/inc/standard/vclxaccessibletabpage.hxx b/accessibility/inc/standard/vclxaccessibletabpage.hxx index d5153b11f630..830e45d64808 100644 --- a/accessibility/inc/standard/vclxaccessibletabpage.hxx +++ b/accessibility/inc/standard/vclxaccessibletabpage.hxx @@ -25,10 +25,10 @@ #include <comphelper/accessibletexthelper.hxx> #include <cppuhelper/implbase2.hxx> #include <vcl/vclptr.hxx> +#include <toolkit/helper/externallock.hxx> class TabControl; -class VCLExternalSolarLock; namespace utl { class AccessibleStateSetHelper; @@ -44,13 +44,13 @@ typedef ::cppu::ImplHelper2< css::accessibility::XAccessible, css::lang::XServiceInfo > VCLXAccessibleTabPage_BASE; -class VCLXAccessibleTabPage : public AccessibleTextHelper_BASE, +class VCLXAccessibleTabPage : private BaseVCLExternalSolarLock, + public AccessibleTextHelper_BASE, public VCLXAccessibleTabPage_BASE { friend class VCLXAccessibleTabControl; private: - VCLExternalSolarLock* m_pExternalLock; VclPtr<TabControl> m_pTabControl; sal_uInt16 m_nPageId; bool m_bFocused; diff --git a/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx b/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx index 9abaaecc88cf..47bb3c387e93 100644 --- a/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx +++ b/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx @@ -31,6 +31,8 @@ #include <cppuhelper/implbase4.hxx> #include <comphelper/accessibletexthelper.hxx> #include <vcl/vclptr.hxx> +#include <toolkit/helper/externallock.hxx> + class ToolBox; @@ -40,15 +42,13 @@ typedef ::cppu::ImplHelper4 < css::accessibility::XAccessible, css::accessibility::XAccessibleValue, css::lang::XServiceInfo > VCLXAccessibleToolBoxItem_BASE; -class VCLExternalSolarLock; - -class VCLXAccessibleToolBoxItem : public AccessibleTextHelper_BASE, +class VCLXAccessibleToolBoxItem : private BaseVCLExternalSolarLock, + public AccessibleTextHelper_BASE, public VCLXAccessibleToolBoxItem_BASE { private: OUString m_sOldName; VclPtr<ToolBox> m_pToolBox; - VCLExternalSolarLock* m_pExternalLock; sal_Int32 m_nIndexInParent; sal_Int16 m_nRole; sal_uInt16 m_nItemId; diff --git a/accessibility/source/extended/accessibletabbarbase.cxx b/accessibility/source/extended/accessibletabbarbase.cxx index ba7e129f5c8b..fcdc854df87c 100644 --- a/accessibility/source/extended/accessibletabbarbase.cxx +++ b/accessibility/source/extended/accessibletabbarbase.cxx @@ -30,17 +30,15 @@ namespace accessibility AccessibleTabBarBase::AccessibleTabBarBase( TabBar* pTabBar ) : - OAccessibleExtendedComponentHelper( new VCLExternalSolarLock ), + OAccessibleExtendedComponentHelper( &m_aLock ), m_pTabBar( nullptr ) { - m_pExternalLock = static_cast< VCLExternalSolarLock* >( getExternalLock() ); SetTabBarPointer( pTabBar ); } AccessibleTabBarBase::~AccessibleTabBarBase() { ClearTabBarPointer(); - DELETEZ( m_pExternalLock ); } IMPL_LINK( AccessibleTabBarBase, WindowEventListener, VclWindowEvent&, rEvent, void ) diff --git a/accessibility/source/standard/accessiblemenubasecomponent.cxx b/accessibility/source/standard/accessiblemenubasecomponent.cxx index 3ee3a95a4a07..eef7d2123a66 100644 --- a/accessibility/source/standard/accessiblemenubasecomponent.cxx +++ b/accessibility/source/standard/accessiblemenubasecomponent.cxx @@ -44,7 +44,7 @@ using namespace ::comphelper; OAccessibleMenuBaseComponent::OAccessibleMenuBaseComponent( Menu* pMenu ) - :OAccessibleExtendedComponentHelper( new VCLExternalSolarLock ) + :OAccessibleExtendedComponentHelper( &m_aLock ) ,m_pMenu( pMenu ) ,m_bEnabled( false ) ,m_bFocused( false ) @@ -52,8 +52,6 @@ OAccessibleMenuBaseComponent::OAccessibleMenuBaseComponent( Menu* pMenu ) ,m_bSelected( false ) ,m_bChecked( false ) { - m_pExternalLock = static_cast< VCLExternalSolarLock* >( getExternalLock() ); - if ( m_pMenu ) { m_aAccessibleChildren.assign( m_pMenu->GetItemCount(), Reference< XAccessible >() ); @@ -66,9 +64,6 @@ OAccessibleMenuBaseComponent::~OAccessibleMenuBaseComponent() { if ( m_pMenu ) m_pMenu->RemoveEventListener( LINK( this, OAccessibleMenuBaseComponent, MenuEventListener ) ); - - delete m_pExternalLock; - m_pExternalLock = nullptr; } diff --git a/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx b/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx index 7ebf8dbc2e29..8bad32538912 100644 --- a/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx +++ b/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx @@ -49,11 +49,10 @@ using namespace ::comphelper; VCLXAccessibleStatusBarItem::VCLXAccessibleStatusBarItem( StatusBar* pStatusBar, sal_uInt16 nItemId ) - :AccessibleTextHelper_BASE( new VCLExternalSolarLock ) + :AccessibleTextHelper_BASE( &m_aLock ) ,m_pStatusBar( pStatusBar ) ,m_nItemId( nItemId ) { - m_pExternalLock = static_cast< VCLExternalSolarLock* >( getExternalLock() ); m_sItemName = GetItemName(); m_sItemText = GetItemText(); @@ -63,8 +62,6 @@ VCLXAccessibleStatusBarItem::VCLXAccessibleStatusBarItem( StatusBar* pStatusBar, VCLXAccessibleStatusBarItem::~VCLXAccessibleStatusBarItem() { - delete m_pExternalLock; - m_pExternalLock = nullptr; } diff --git a/accessibility/source/standard/vclxaccessibletabpage.cxx b/accessibility/source/standard/vclxaccessibletabpage.cxx index 7e33f49785cc..7ac0d145661a 100644 --- a/accessibility/source/standard/vclxaccessibletabpage.cxx +++ b/accessibility/source/standard/vclxaccessibletabpage.cxx @@ -49,11 +49,10 @@ using namespace ::comphelper; VCLXAccessibleTabPage::VCLXAccessibleTabPage( TabControl* pTabControl, sal_uInt16 nPageId ) - :AccessibleTextHelper_BASE( new VCLExternalSolarLock ) + :AccessibleTextHelper_BASE( &m_aLock ) ,m_pTabControl( pTabControl ) ,m_nPageId( nPageId ) { - m_pExternalLock = static_cast< VCLExternalSolarLock* >( getExternalLock() ); m_bFocused = IsFocused(); m_bSelected = IsSelected(); m_sPageText = GetPageText(); @@ -62,8 +61,6 @@ VCLXAccessibleTabPage::VCLXAccessibleTabPage( TabControl* pTabControl, sal_uInt1 VCLXAccessibleTabPage::~VCLXAccessibleTabPage() { - delete m_pExternalLock; - m_pExternalLock = nullptr; } diff --git a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx index a38b9fe59f09..7d925de69f2c 100644 --- a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx +++ b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx @@ -60,8 +60,7 @@ using namespace ::comphelper; // Ctor() and Dtor() VCLXAccessibleToolBoxItem::VCLXAccessibleToolBoxItem( ToolBox* _pToolBox, sal_Int32 _nPos ) : - - AccessibleTextHelper_BASE( new VCLExternalSolarLock ), + AccessibleTextHelper_BASE( &m_aLock ), m_pToolBox ( _pToolBox ), m_nIndexInParent( _nPos ), @@ -72,8 +71,6 @@ VCLXAccessibleToolBoxItem::VCLXAccessibleToolBoxItem( ToolBox* _pToolBox, sal_In m_bIndeterminate( false ) { - m_pExternalLock = static_cast< VCLExternalSolarLock* >( getExternalLock( ) ); - OSL_ENSURE( m_pToolBox, "invalid toolbox" ); m_nItemId = m_pToolBox->GetItemId( m_nIndexInParent ); m_sOldName = GetText(); @@ -119,8 +116,6 @@ VCLXAccessibleToolBoxItem::VCLXAccessibleToolBoxItem( ToolBox* _pToolBox, sal_In VCLXAccessibleToolBoxItem::~VCLXAccessibleToolBoxItem() { - delete m_pExternalLock; - m_pExternalLock = nullptr; } OUString VCLXAccessibleToolBoxItem::GetText() diff --git a/include/toolkit/helper/externallock.hxx b/include/toolkit/helper/externallock.hxx index 6299395077ae..ddac625e73bf 100644 --- a/include/toolkit/helper/externallock.hxx +++ b/include/toolkit/helper/externallock.hxx @@ -33,6 +33,12 @@ public: virtual void release() override; }; +class BaseVCLExternalSolarLock +{ +protected: + mutable VCLExternalSolarLock m_aLock; +}; + #endif // INCLUDED_TOOLKIT_HELPER_EXTERNALLOCK_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |