summaryrefslogtreecommitdiff
path: root/forms/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-20 13:47:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-23 07:56:34 +0200
commitdc3377528186f4f111553530fa0ffd7f64711f64 (patch)
tree330efda000baee32ef171e2342158167d499e89d /forms/source
parent9c6bdac80b9f61d224a239317f2558ddd7e1744d (diff)
use rtl::Reference in ODatabaseForm
rather than manual acquire/release Change-Id: Ic5f013b7e4cafc597c659c61fbf568adccfd806a
Diffstat (limited to 'forms/source')
-rw-r--r--forms/source/component/DatabaseForm.cxx20
-rw-r--r--forms/source/component/DatabaseForm.hxx3
2 files changed, 10 insertions, 13 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index d61c7a70a490..dfa72246951a 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -258,7 +258,6 @@ ODatabaseForm::ODatabaseForm(const Reference<XComponentContext>& _rxContext)
,m_aErrorListeners(m_aMutex)
,m_aResetListeners( *this, m_aMutex )
,m_aPropertyBagHelper( *this )
- ,m_pAggregatePropertyMultiplexer(nullptr)
,m_aParameterManager( m_aMutex, _rxContext )
,m_aFilterManager()
,m_pLoadTimer(nullptr)
@@ -294,7 +293,6 @@ ODatabaseForm::ODatabaseForm( const ODatabaseForm& _cloneSource )
,m_aErrorListeners( m_aMutex )
,m_aResetListeners( *this, m_aMutex )
,m_aPropertyBagHelper( *this )
- ,m_pAggregatePropertyMultiplexer( nullptr )
,m_aParameterManager( m_aMutex, _cloneSource.m_xContext )
,m_aFilterManager()
,m_pLoadTimer( nullptr )
@@ -392,10 +390,9 @@ void ODatabaseForm::impl_construct()
// listen for the properties, important for Parameters
if ( m_xAggregateSet.is() )
{
- m_pAggregatePropertyMultiplexer = new OPropertyChangeMultiplexer(this, m_xAggregateSet, false);
- m_pAggregatePropertyMultiplexer->acquire();
- m_pAggregatePropertyMultiplexer->addProperty(PROPERTY_COMMAND);
- m_pAggregatePropertyMultiplexer->addProperty(PROPERTY_ACTIVE_CONNECTION);
+ m_xAggregatePropertyMultiplexer = new OPropertyChangeMultiplexer(this, m_xAggregateSet, false);
+ m_xAggregatePropertyMultiplexer->addProperty(PROPERTY_COMMAND);
+ m_xAggregatePropertyMultiplexer->addProperty(PROPERTY_ACTIVE_CONNECTION);
}
{
@@ -429,11 +426,10 @@ ODatabaseForm::~ODatabaseForm()
m_aWarnings.setExternalWarnings( nullptr );
- if (m_pAggregatePropertyMultiplexer)
+ if (m_xAggregatePropertyMultiplexer.is())
{
- m_pAggregatePropertyMultiplexer->dispose();
- m_pAggregatePropertyMultiplexer->release();
- m_pAggregatePropertyMultiplexer = nullptr;
+ m_xAggregatePropertyMultiplexer->dispose();
+ m_xAggregatePropertyMultiplexer.clear();
}
}
@@ -1252,8 +1248,8 @@ bool ODatabaseForm::executeRowSet(::osl::ResettableMutexGuard& _rClearForNotifie
void ODatabaseForm::disposing()
{
- if (m_pAggregatePropertyMultiplexer)
- m_pAggregatePropertyMultiplexer->dispose();
+ if (m_xAggregatePropertyMultiplexer.is())
+ m_xAggregatePropertyMultiplexer->dispose();
if (m_bLoaded)
unload();
diff --git a/forms/source/component/DatabaseForm.hxx b/forms/source/component/DatabaseForm.hxx
index 683e51a983cb..f041f5139b7e 100644
--- a/forms/source/component/DatabaseForm.hxx
+++ b/forms/source/component/DatabaseForm.hxx
@@ -73,6 +73,7 @@
#include <cppuhelper/implbase12.hxx>
#include <cppuhelper/implbase4.hxx>
#include <cppuhelper/implbase7.hxx>
+#include <rtl/ref.hxx>
namespace com { namespace sun { namespace star { namespace sdbc {
class SQLException;
@@ -173,7 +174,7 @@ class ODatabaseForm :public OFormComponents
PropertyBagHelper m_aPropertyBagHelper;
::dbtools::WarningsContainer m_aWarnings;
- OPropertyChangeMultiplexer* m_pAggregatePropertyMultiplexer;
+ rtl::Reference<OPropertyChangeMultiplexer> m_xAggregatePropertyMultiplexer;
// Management of the Control Groups
rtl::Reference<OGroupManager> m_pGroupManager;
::dbtools::ParameterManager m_aParameterManager;