include/svx/dlgctrl.hxx       |    4 ++--
 svx/source/dialog/dlgctrl.cxx |   12 +++++-------
 2 files changed, 7 insertions(+), 9 deletions(-)

New commits:
commit 05a1ca8e7c86a9928696e6bc5599dbf51b4d7c47
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Thu May 31 11:05:24 2018 +0200

    loplugin:useuniqueptr in SvxPreviewBase
    
    Change-Id: I777da1279f1a8c6d6f5ac80e4d72a733d55794ef
    Reviewed-on: https://gerrit.libreoffice.org/55231
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx
index 4712937ff4ec..d8be686c2bea 100644
--- a/include/svx/dlgctrl.hxx
+++ b/include/svx/dlgctrl.hxx
@@ -350,7 +350,7 @@ class SdrModel;
 class SAL_WARN_UNUSED SAL_DLLPUBLIC_RTTI SvxPreviewBase : public Control
 {
 private:
-    SdrModel*             mpModel;
+    std::unique_ptr<SdrModel> mpModel;
     VclPtr<VirtualDevice> mpBufferDevice;
 
 protected:
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index a5a93dde36c6..b6d9f52709ad 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -1806,7 +1806,7 @@ SvxPreviewBase::~SvxPreviewBase()
 
 void SvxPreviewBase::dispose()
 {
-    delete mpModel;
+    mpModel.reset();
     mpBufferDevice.disposeAndClear();
     Control::dispose();
 }
commit 4f2d47bb9a0a66ed37b5364fbdf4cfe902864c5a
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Thu May 31 10:57:53 2018 +0200

    loplugin:useuniqueptr in RectCtl
    
    Change-Id: I8d0e4decdd607479e9cc9491d6dae769622a6c26
    Reviewed-on: https://gerrit.libreoffice.org/55230
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx
index 55bf1848755c..4712937ff4ec 100644
--- a/include/svx/dlgctrl.hxx
+++ b/include/svx/dlgctrl.hxx
@@ -165,7 +165,7 @@ protected:
     Point aPtLB, aPtMB, aPtRB;
     Point aPtNew;
     RectPoint eRP, eDefRP;
-    BitmapEx* pBitmap;
+    std::unique_ptr<BitmapEx> pBitmap;
     CTL_STATE m_nState;
 
     bool mbCompleteDisable : 1;
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index 16f6eed39600..a5a93dde36c6 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -650,8 +650,7 @@ void RectCtl::SetControlSettings(RectPoint eRpt, sal_uInt16 
nBorder)
 
 RectCtl::~RectCtl()
 {
-    delete pBitmap;
-
+    pBitmap.reset();
     pAccContext.clear();
 }
 
@@ -682,12 +681,12 @@ void RectCtl::Resize_Impl()
 
 void RectCtl::InitRectBitmap()
 {
-    delete pBitmap;
+    pBitmap.reset();
 
     const StyleSettings& rStyles = 
Application::GetSettings().GetStyleSettings();
     svtools::ColorConfig aColorConfig;
 
-    pBitmap = new BitmapEx(RID_SVXCTRL_RECTBTNS);
+    pBitmap.reset(new BitmapEx(RID_SVXCTRL_RECTBTNS));
 
     // set bitmap-colors
     Color aColorAry1[7];
@@ -729,8 +728,7 @@ void RectCtl::InitRectBitmap()
 
 void RectCtl::StyleUpdated()
 {
-    delete pBitmap;
-    pBitmap = nullptr; // forces new creating of bitmap
+    pBitmap.reset(); // forces new creating of bitmap
     CustomWidgetController::StyleUpdated();
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to