diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-23 11:23:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-23 13:05:30 +0200 |
commit | 3bcfb690821e73e30731d9c3f33c00103f2d4cba (patch) | |
tree | c4b40c2416217e8d992d0f232c2ed9d1c72406cb /svx | |
parent | 3199cc1ab8c47cbdbf4ac039c523cc398277eec0 (diff) |
use rtl::Reference in SvxShowCharSetVirtualAcc
instead of both raw pointer and uno::Reference
Change-Id: Ib2ca24f24a7c4f0645daefcea3e8bf44c205a85f
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/accessibility/charmapacc.cxx | 24 | ||||
-rw-r--r-- | svx/source/inc/charmapacc.hxx | 9 |
2 files changed, 15 insertions, 18 deletions
diff --git a/svx/source/accessibility/charmapacc.cxx b/svx/source/accessibility/charmapacc.cxx index ac60371cbe80..3d801af3f847 100644 --- a/svx/source/accessibility/charmapacc.cxx +++ b/svx/source/accessibility/charmapacc.cxx @@ -42,7 +42,6 @@ namespace svx SvxShowCharSetVirtualAcc::SvxShowCharSetVirtualAcc( SvxShowCharSet* pParent ) : OAccessibleComponentHelper(new VCLExternalSolarLock()) ,mpParent( pParent ) -,m_pTable(nullptr) { osl_atomic_increment(&m_refCount); { @@ -67,8 +66,8 @@ void SAL_CALL SvxShowCharSetVirtualAcc::fireEvent( const css::uno::Any& _rNewValue ) { - if ( m_pTable ) - m_pTable->fireEvent(_nEventId,_rOldValue,_rNewValue); + if ( m_xTable.is() ) + m_xTable->fireEvent(_nEventId,_rOldValue,_rNewValue); } sal_Int32 SAL_CALL SvxShowCharSetVirtualAcc::getAccessibleChildCount( ) throw (RuntimeException, std::exception) @@ -89,9 +88,9 @@ uno::Reference< css::accessibility::XAccessible > SAL_CALL SvxShowCharSetVirtual if( sal_uInt16(-1) != nItemId ) { - if ( !m_pTable ) - m_pTable = new SvxShowCharSetAcc(this); - xRet = m_pTable; + if ( !m_xTable.is() ) + m_xTable = new SvxShowCharSetAcc(this); + xRet = m_xTable.get(); } else if ( mpParent->getScrollBar().IsVisible() ) { @@ -121,15 +120,14 @@ Reference< XAccessible > SAL_CALL SvxShowCharSetVirtualAcc::getAccessibleChild( return mpParent->getScrollBar().GetAccessible(); else if ( i == 1 ) { - if ( !m_xAcc.is() ) + if ( !m_xTable.is() ) { - m_pTable = new SvxShowCharSetAcc(this); - m_xAcc = m_pTable; + m_xTable = new SvxShowCharSetAcc(this); } } else throw IndexOutOfBoundsException(); - return m_xAcc; + return m_xTable.get(); } Reference< XAccessible > SAL_CALL SvxShowCharSetVirtualAcc::getAccessibleParent( ) throw (RuntimeException, std::exception) @@ -216,9 +214,9 @@ Reference< XAccessibleStateSet > SAL_CALL SvxShowCharSetVirtualAcc::getAccessibl void SAL_CALL SvxShowCharSetVirtualAcc::disposing() { OAccessibleContextHelper::disposing(); - if ( m_pTable ) - m_pTable->dispose(); - m_pTable = nullptr; + if ( m_xTable.is() ) + m_xTable->dispose(); + m_xTable.clear(); } diff --git a/svx/source/inc/charmapacc.hxx b/svx/source/inc/charmapacc.hxx index 3063acb8fcc8..4e0b41de70c0 100644 --- a/svx/source/inc/charmapacc.hxx +++ b/svx/source/inc/charmapacc.hxx @@ -41,9 +41,8 @@ namespace svx class SvxShowCharSetVirtualAcc : public ::comphelper::OAccessibleComponentHelper, public OAccessibleHelper_Base_2 { - VclPtr<SvxShowCharSet> mpParent; // the vcl control - SvxShowCharSetAcc* m_pTable; // the table, which holds the characters shown by the vcl control - css::uno::Reference< css::accessibility::XAccessible > m_xAcc; // the ref to the table + VclPtr<SvxShowCharSet> mpParent; // the vcl control + rtl::Reference<SvxShowCharSetAcc> m_xTable; // the table, which holds the characters shown by the vcl control protected: virtual ~SvxShowCharSetVirtualAcc() override; @@ -84,8 +83,8 @@ namespace svx ); // simple access methods - inline SvxShowCharSetAcc* getTable() const { return m_pTable; } - inline SvxShowCharSet* getCharSetControl() const { return mpParent; } + inline SvxShowCharSetAcc* getTable() const { return m_xTable.get(); } + inline SvxShowCharSet* getCharSetControl() const { return mpParent; } }; |