diff options
-rw-r--r-- | extensions/source/bibliography/formcontrolcontainer.cxx | 11 | ||||
-rw-r--r-- | extensions/source/bibliography/formcontrolcontainer.hxx | 5 |
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(); |