summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2017-08-29 10:35:57 +0900
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-08-29 10:29:43 +0200
commit8514f192c9e385550b336e57997c9e0dbd3a9bc3 (patch)
tree987daa0324c1b17b907f5a76e9f8c98a7d4b27b2 /svx
parentc1629e680c62107df9582c1bd04c9e0c3273e726 (diff)
svx: FmXFormView owns m_pWatchStoredList
so simplify code with std::unique_ptr. Change-Id: I640bcbde4a59a239b33229168fd48cac29a3fc4d Reviewed-on: https://gerrit.libreoffice.org/41663 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/form/fmvwimp.cxx9
-rw-r--r--svx/source/inc/fmvwimp.hxx4
2 files changed, 5 insertions, 8 deletions
diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx
index 6cfe4314aac4..5ec7438bfb25 100644
--- a/svx/source/form/fmvwimp.cxx
+++ b/svx/source/form/fmvwimp.cxx
@@ -397,7 +397,6 @@ FmXFormView::FmXFormView(FmFormView* _pView )
,m_nErrorMessageEvent( nullptr )
,m_nAutoFocusEvent( nullptr )
,m_nControlWizardEvent( nullptr )
- ,m_pWatchStoredList( nullptr )
,m_bFirstActivation( true )
,m_isTabOrderUpdateSuspended( false )
{
@@ -455,9 +454,6 @@ FmXFormView::~FmXFormView()
}
cancelEvents();
-
- delete m_pWatchStoredList;
- m_pWatchStoredList = nullptr;
}
// EventListener
@@ -1735,8 +1731,7 @@ void FmXFormView::stopMarkListWatching()
if ( m_pWatchStoredList )
{
m_pWatchStoredList->EndListeningAll();
- delete m_pWatchStoredList;
- m_pWatchStoredList = nullptr;
+ m_pWatchStoredList.reset();
}
}
@@ -1749,7 +1744,7 @@ void FmXFormView::startMarkListWatching()
DBG_ASSERT( pModel != nullptr, "FmXFormView::startMarkListWatching: shell has no model!" );
if (pModel)
{
- m_pWatchStoredList = new ObjectRemoveListener( this );
+ m_pWatchStoredList.reset(new ObjectRemoveListener( this ));
m_pWatchStoredList->StartListening( *static_cast< SfxBroadcaster* >( pModel ) );
}
}
diff --git a/svx/source/inc/fmvwimp.hxx b/svx/source/inc/fmvwimp.hxx
index 4f028144851a..7eb299d12a05 100644
--- a/svx/source/inc/fmvwimp.hxx
+++ b/svx/source/inc/fmvwimp.hxx
@@ -22,6 +22,7 @@
#include <sal/config.h>
#include <map>
+#include <memory>
#include "svx/svdmark.hxx"
#include "fmdocumentclassification.hxx"
@@ -171,7 +172,8 @@ class FmXFormView : public ::cppu::WeakImplHelper<
// list of selected objects, used for restoration when switching from Alive to DesignMode
SdrMarkList m_aMark;
- ObjectRemoveListener* m_pWatchStoredList;
+ std::unique_ptr<ObjectRemoveListener>
+ m_pWatchStoredList;
bool m_bFirstActivation;
bool m_isTabOrderUpdateSuspended;