summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-19 13:58:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-20 08:51:08 +0200
commit7d7a5666aea903ad69276a4d65b0df2768d473b8 (patch)
tree87423b0ae64b57ee512603ce0c3c37f3baa66ae0 /extensions
parent46a0ce80326a44bd13e3483106dd0e9bf32a7824 (diff)
use rtl::Reference in FormControlContainer
instead of manual acquire/release Change-Id: Ie0fed7db217adea68aaa09cf9de699d488bf84dd
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/bibliography/formcontrolcontainer.cxx11
-rw-r--r--extensions/source/bibliography/formcontrolcontainer.hxx5
2 files changed, 7 insertions, 9 deletions
diff --git a/extensions/source/bibliography/formcontrolcontainer.cxx b/extensions/source/bibliography/formcontrolcontainer.cxx
index f0dfe3b77741..4da38e35780b 100644
--- a/extensions/source/bibliography/formcontrolcontainer.cxx
+++ b/extensions/source/bibliography/formcontrolcontainer.cxx
@@ -35,7 +35,6 @@ namespace bib
FormControlContainer::FormControlContainer( )
:OLoadListener( m_aMutex )
- ,m_pFormAdapter( nullptr )
{
}
@@ -52,9 +51,8 @@ namespace bib
SAL_WARN_IF( !isFormConnected(), "extensions.biblio", "FormControlContainer::connectForm: not connected!" );
if ( isFormConnected() )
{
- m_pFormAdapter->dispose();
- m_pFormAdapter->release();
- m_pFormAdapter = nullptr;
+ m_xFormAdapter->dispose();
+ m_xFormAdapter.clear();
}
}
@@ -65,9 +63,8 @@ namespace bib
SAL_WARN_IF( !_rxForm.is(), "extensions.biblio", "FormControlContainer::connectForm: invalid form!" );
if ( !isFormConnected() && _rxForm.is() )
{
- m_pFormAdapter = new OLoadListenerAdapter( _rxForm );
- m_pFormAdapter->acquire();
- m_pFormAdapter->Init( this );
+ m_xFormAdapter = new OLoadListenerAdapter( _rxForm );
+ m_xFormAdapter->Init( this );
implSetDesignMode( !m_xForm.is() || !m_xForm->isLoaded() );
}
diff --git a/extensions/source/bibliography/formcontrolcontainer.hxx b/extensions/source/bibliography/formcontrolcontainer.hxx
index a75a528a7c5e..78673eb0fd1d 100644
--- a/extensions/source/bibliography/formcontrolcontainer.hxx
+++ b/extensions/source/bibliography/formcontrolcontainer.hxx
@@ -23,6 +23,7 @@
#include <cppuhelper/basemutex.hxx>
#include "loadlisteneradapter.hxx"
#include <com/sun/star/awt/XControlContainer.hpp>
+#include <rtl/ref.hxx>
namespace bib
@@ -33,7 +34,7 @@ namespace bib
,public ::bib::OLoadListener
{
private:
- OLoadListenerAdapter* m_pFormAdapter;
+ rtl::Reference<OLoadListenerAdapter> m_xFormAdapter;
css::uno::Reference< css::form::XLoadable > m_xForm;
private:
void implSetDesignMode( bool _bDesign );
@@ -42,7 +43,7 @@ namespace bib
FormControlContainer( );
virtual ~FormControlContainer( ) override;
- bool isFormConnected() const { return nullptr != m_pFormAdapter; }
+ bool isFormConnected() const { return m_xFormAdapter.is(); }
void connectForm( const css::uno::Reference< css::form::XLoadable >& _rxForm );
void disconnectForm();