[Libreoffice-commits] core.git: include/svx svx/source

Arnold Dumas arnold at dumas.at
Tue Aug 23 07:43:22 UTC 2016


 include/svx/fmmodel.hxx     |    3 ++-
 svx/source/form/fmmodel.cxx |    8 +++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

New commits:
commit a29a94d71d37575f7ed0b04ee7aa83af697a5efd
Author: Arnold Dumas <arnold at dumas.at>
Date:   Sun Aug 21 19:56:21 2016 +0200

    tdf#89329: use unique_ptr for pImpl in fmmodel
    
    Change-Id: I631c72caafc31eeff46db6f98d1d09f25f5a8245
    Reviewed-on: https://gerrit.libreoffice.org/28281
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
    Tested-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/include/svx/fmmodel.hxx b/include/svx/fmmodel.hxx
index ea77ff3..d632df6 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 b9f2e84..3c7b1b4 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)


More information about the Libreoffice-commits mailing list