diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-17 09:08:45 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-17 10:58:46 +0200 |
commit | 899a656870f916e97944f2d74977177cb1032f33 (patch) | |
tree | c24df9b5cc9ababd3088795cff11387d417a7923 /extensions | |
parent | 843dca2f4d5436f5abbc031df95a86eaae395feb (diff) |
use rtl::Reference in BibDataManager
instead of manual reference counting
Change-Id: Ia8fd5487fb8d25d6725dd36b74aab57272aba911
Reviewed-on: https://gerrit.libreoffice.org/43447
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/bibliography/datman.cxx | 14 | ||||
-rw-r--r-- | extensions/source/bibliography/datman.hxx | 2 |
2 files changed, 6 insertions, 10 deletions
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index 9e2dd31805e8..5afbd5f33590 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -607,7 +607,6 @@ OUString const gViewSize("theViewSize"); BibDataManager::BibDataManager() :BibDataManager_Base( GetMutex() ) - ,m_pInterceptorHelper( nullptr ) ,m_aLoadListeners(m_aMutex) ,pBibView( nullptr ) ,pToolbar(nullptr) @@ -633,11 +632,10 @@ BibDataManager::~BibDataManager() xConnection->dispose(); m_xForm = nullptr; } - if( m_pInterceptorHelper ) + if( m_xInterceptorHelper.is() ) { - m_pInterceptorHelper->ReleaseInterceptor(); - m_pInterceptorHelper->release(); - m_pInterceptorHelper = nullptr; + m_xInterceptorHelper->ReleaseInterceptor(); + m_xInterceptorHelper.clear(); } } @@ -1590,12 +1588,10 @@ uno::Reference< form::runtime::XFormController > const & BibDataManager::GetForm void BibDataManager::RegisterInterceptor( ::bib::BibBeamer* pBibBeamer) { - DBG_ASSERT( !m_pInterceptorHelper, "BibDataManager::RegisterInterceptor: called twice!" ); + DBG_ASSERT( !m_xInterceptorHelper.is(), "BibDataManager::RegisterInterceptor: called twice!" ); if( pBibBeamer ) - m_pInterceptorHelper = new BibInterceptorHelper( pBibBeamer, m_xFormDispatch); - if( m_pInterceptorHelper ) - m_pInterceptorHelper->acquire(); + m_xInterceptorHelper = new BibInterceptorHelper( pBibBeamer, m_xFormDispatch); } diff --git a/extensions/source/bibliography/datman.hxx b/extensions/source/bibliography/datman.hxx index f988e29f9fad..139c0b7dd9ff 100644 --- a/extensions/source/bibliography/datman.hxx +++ b/extensions/source/bibliography/datman.hxx @@ -86,7 +86,7 @@ private: css::uno::Reference< css::sdb::XSingleSelectQueryComposer > m_xParser; css::uno::Reference< css::form::runtime::XFormController > m_xFormCtrl; css::uno::Reference< css::frame::XDispatch > m_xFormDispatch; - BibInterceptorHelper* m_pInterceptorHelper; + rtl::Reference<BibInterceptorHelper> m_xInterceptorHelper; OUString aActiveDataTable; OUString aDataSourceURL; |