[Libreoffice-commits] core.git: extensions/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Oct 17 08:59:09 UTC 2017


 extensions/source/bibliography/datman.cxx |   14 +++++---------
 extensions/source/bibliography/datman.hxx |    2 +-
 2 files changed, 6 insertions(+), 10 deletions(-)

New commits:
commit 899a656870f916e97944f2d74977177cb1032f33
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Oct 17 09:08:45 2017 +0200

    use rtl::Reference in BibDataManager
    
    instead of manual reference counting
    
    Change-Id: Ia8fd5487fb8d25d6725dd36b74aab57272aba911
    Reviewed-on: https://gerrit.libreoffice.org/43447
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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;


More information about the Libreoffice-commits mailing list