[Libreoffice-commits] core.git: sd/source
Noel Grandin
noel.grandin at collabora.co.uk
Mon Jun 25 12:07:13 UTC 2018
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.grandin at 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.grandin at 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,
More information about the Libreoffice-commits
mailing list