diff options
author | Arnold Dumas <arnold@dumas.at> | 2016-08-21 19:56:21 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-08-23 07:42:57 +0000 |
commit | a29a94d71d37575f7ed0b04ee7aa83af697a5efd (patch) | |
tree | 5fd81b8765e5f6cd7eee4dc657b091a0ffb302ae | |
parent | 850964c29c9a11aaafddaac69ffd1ae19f78ead1 (diff) |
tdf#89329: use unique_ptr for pImpl in fmmodel
Change-Id: I631c72caafc31eeff46db6f98d1d09f25f5a8245
Reviewed-on: https://gerrit.libreoffice.org/28281
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r-- | include/svx/fmmodel.hxx | 3 | ||||
-rw-r--r-- | svx/source/form/fmmodel.cxx | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/include/svx/fmmodel.hxx b/include/svx/fmmodel.hxx index ea77ff38486e..d632df6d225c 100644 --- a/include/svx/fmmodel.hxx +++ b/include/svx/fmmodel.hxx @@ -22,6 +22,7 @@ #include <svx/svdmodel.hxx> #include <svx/svxdllapi.h> +#include <memory> class SfxObjectShell; class SfxItemPool; @@ -36,7 +37,7 @@ class SVX_DLLPUBLIC FmFormModel : public SdrModel { private: - FmFormModelImplData* m_pImpl; + std::unique_ptr<FmFormModelImplData> m_pImpl; SfxObjectShell* m_pObjShell; bool m_bOpenInDesignMode : 1; diff --git a/svx/source/form/fmmodel.cxx b/svx/source/form/fmmodel.cxx index b9f2e84a5827..3c7b1b463cab 100644 --- a/svx/source/form/fmmodel.cxx +++ b/svx/source/form/fmmodel.cxx @@ -59,7 +59,7 @@ FmFormModel::FmFormModel(SfxItemPool* pPool, SfxObjectShell* pPers) , m_bOpenInDesignMode(false) , m_bAutoControlFocus(false) { - m_pImpl = new FmFormModelImplData; + m_pImpl.reset( new FmFormModelImplData ); m_pImpl->pUndoEnv = new FmXUndoEnvironment(*this); m_pImpl->pUndoEnv->acquire(); } @@ -71,7 +71,7 @@ FmFormModel::FmFormModel(const OUString& rPath, SfxItemPool* pPool, SfxObjectShe , m_bOpenInDesignMode(false) , m_bAutoControlFocus(false) { - m_pImpl = new FmFormModelImplData; + m_pImpl.reset( new FmFormModelImplData ); m_pImpl->pUndoEnv = new FmXUndoEnvironment(*this); m_pImpl->pUndoEnv->acquire(); } @@ -84,7 +84,7 @@ FmFormModel::FmFormModel(const OUString& rPath, SfxItemPool* pPool, SfxObjectShe , m_bOpenInDesignMode(false) , m_bAutoControlFocus(false) { - m_pImpl = new FmFormModelImplData; + m_pImpl.reset( new FmFormModelImplData ); m_pImpl->pUndoEnv = new FmXUndoEnvironment(*this); m_pImpl->pUndoEnv->acquire(); } @@ -99,8 +99,6 @@ FmFormModel::~FmFormModel() SetMaxUndoActionCount(1); m_pImpl->pUndoEnv->release(); - delete m_pImpl; - } SdrPage* FmFormModel::AllocPage(bool bMasterPage) |