summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-20 13:43:25 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-23 07:56:34 +0200
commit9c6bdac80b9f61d224a239317f2558ddd7e1744d (patch)
tree0a5a2f13efaf8011695ff3a9e104bb1b42a4756a
parent32f4f3b52ad491ab83a67dfe57ea4f27d66b39a7 (diff)
use rtl::Reference in SubmissionPropertyHandler
rather than manual acquire/release Change-Id: I3276361153591a3af8c6b00b478365b2700dedf5
-rw-r--r--extensions/source/propctrlr/submissionhandler.cxx13
-rw-r--r--extensions/source/propctrlr/submissionhandler.hxx5
2 files changed, 8 insertions, 10 deletions
diff --git a/extensions/source/propctrlr/submissionhandler.cxx b/extensions/source/propctrlr/submissionhandler.cxx
index f523cc7ad7f6..ed0b5d39a1d8 100644
--- a/extensions/source/propctrlr/submissionhandler.cxx
+++ b/extensions/source/propctrlr/submissionhandler.cxx
@@ -93,7 +93,6 @@ namespace pcr
SubmissionPropertyHandler::SubmissionPropertyHandler( const Reference< XComponentContext >& _rxContext )
:EditPropertyHandler_Base( _rxContext )
,OPropertyChangeListener( m_aMutex )
- ,m_pPropChangeMultiplexer( nullptr )
{
}
@@ -236,11 +235,10 @@ namespace pcr
void SubmissionPropertyHandler::onNewComponent()
{
- if ( m_pPropChangeMultiplexer )
+ if ( m_xPropChangeMultiplexer.is() )
{
- m_pPropChangeMultiplexer->dispose();
- m_pPropChangeMultiplexer->release();
- m_pPropChangeMultiplexer = nullptr;
+ m_xPropChangeMultiplexer->dispose();
+ m_xPropChangeMultiplexer.clear();
}
EditPropertyHandler_Base::onNewComponent();
@@ -254,9 +252,8 @@ namespace pcr
{
m_pHelper.reset( new SubmissionHelper( m_aMutex, m_xComponent, xDocument ) );
- m_pPropChangeMultiplexer = new OPropertyChangeMultiplexer( this, m_xComponent );
- m_pPropChangeMultiplexer->acquire();
- m_pPropChangeMultiplexer->addProperty( PROPERTY_BUTTONTYPE );
+ m_xPropChangeMultiplexer = new OPropertyChangeMultiplexer( this, m_xComponent );
+ m_xPropChangeMultiplexer->addProperty( PROPERTY_BUTTONTYPE );
}
}
diff --git a/extensions/source/propctrlr/submissionhandler.hxx b/extensions/source/propctrlr/submissionhandler.hxx
index 63bcbb34fdd0..f0408e4d2c8b 100644
--- a/extensions/source/propctrlr/submissionhandler.hxx
+++ b/extensions/source/propctrlr/submissionhandler.hxx
@@ -25,6 +25,7 @@
#include <com/sun/star/xforms/XSubmission.hpp>
#include <comphelper/propmultiplex.hxx>
+#include <rtl/ref.hxx>
namespace comphelper
{
@@ -68,8 +69,8 @@ namespace pcr
class SubmissionPropertyHandler : public EditPropertyHandler_Base, public ::comphelper::OPropertyChangeListener
{
private:
- ::std::unique_ptr< SubmissionHelper > m_pHelper;
- ::comphelper::OPropertyChangeMultiplexer* m_pPropChangeMultiplexer;
+ ::std::unique_ptr< SubmissionHelper > m_pHelper;
+ rtl::Reference<::comphelper::OPropertyChangeMultiplexer> m_xPropChangeMultiplexer;
public:
explicit SubmissionPropertyHandler(