sd/source/ui/func/fudspord.cxx |    9 ++-------
 sd/source/ui/inc/fudspord.hxx  |    2 +-
 2 files changed, 3 insertions(+), 8 deletions(-)

New commits:
commit 51061839bf4edad9ded432afb1561287a56525e4
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Fri Jun 22 14:07:14 2018 +0200

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

diff --git a/sd/source/ui/func/fudspord.cxx b/sd/source/ui/func/fudspord.cxx
index e867c2fe6ed4..163125587546 100644
--- a/sd/source/ui/func/fudspord.cxx
+++ b/sd/source/ui/func/fudspord.cxx
@@ -41,16 +41,11 @@ FuDisplayOrder::FuDisplayOrder( ViewShell* pViewSh, 
::sd::Window* pWin, ::sd::Vi
 
 FuDisplayOrder::~FuDisplayOrder()
 {
-    implClearOverlay();
 }
 
 void FuDisplayOrder::implClearOverlay()
 {
-    if(mpOverlay)
-    {
-        delete mpOverlay;
-        mpOverlay = nullptr;
-    }
+    mpOverlay.reset();
 }
 
 rtl::Reference<FuPoor> FuDisplayOrder::Create( ViewShell* pViewSh, 
::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq )
@@ -81,7 +76,7 @@ bool FuDisplayOrder::MouseMove(const MouseEvent& rMEvt)
             implClearOverlay();
 
             // create new one
-            mpOverlay = new SdrDropMarkerOverlay(*mpView, *pPickObj);
+            mpOverlay.reset( new SdrDropMarkerOverlay(*mpView, *pPickObj) );
 
             // remember referenced object
             mpRefObj = pPickObj;
diff --git a/sd/source/ui/inc/fudspord.hxx b/sd/source/ui/inc/fudspord.hxx
index 65ae23b86a71..38534115b31b 100644
--- a/sd/source/ui/inc/fudspord.hxx
+++ b/sd/source/ui/inc/fudspord.hxx
@@ -49,7 +49,7 @@ private:
 
     Pointer                 maPtr;
     SdrObject*              mpRefObj;
-    SdrDropMarkerOverlay*   mpOverlay;
+    std::unique_ptr<SdrDropMarkerOverlay> mpOverlay;
 
     FuDisplayOrder (
         ViewShell* pViewSh,
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to