[Libreoffice-commits] core.git: include/svx svx/source
Noel Grandin
noel.grandin at collabora.co.uk
Wed May 2 06:28:02 UTC 2018
include/svx/view3d.hxx | 3 ++-
svx/source/engine3d/view3d.cxx | 8 ++------
2 files changed, 4 insertions(+), 7 deletions(-)
New commits:
commit a1ce78b03d37ff845e404aeb224e9cf1092011ce
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue May 1 18:02:44 2018 +0200
loplugin:useuniqueptr in E3dView
Change-Id: I2945d810a05f0f9d44ac17c20f5a82e05bd4981e
Reviewed-on: https://gerrit.libreoffice.org/53712
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/svx/view3d.hxx b/include/svx/view3d.hxx
index be4381c21351..33a19fa79061 100644
--- a/include/svx/view3d.hxx
+++ b/include/svx/view3d.hxx
@@ -25,6 +25,7 @@
#include <svx/deflt3d.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <svx/svxdllapi.h>
+#include <memory>
/*
* Forward declarations
@@ -49,7 +50,7 @@ protected:
E3dDragConstraint eDragConstraint;
// Migrate selections
- Impl3DMirrorConstructOverlay* mpMirrorOverlay;
+ std::unique_ptr<Impl3DMirrorConstructOverlay> mpMirrorOverlay;
void InitView();
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index eddba2dd0e55..c45a7f995649 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -1395,7 +1395,7 @@ void E3dView::Start3DCreation()
// Show mirror polygon IMMEDIATELY
const SdrHdlList &aHdlList = GetHdlList();
- mpMirrorOverlay = new Impl3DMirrorConstructOverlay(*this);
+ mpMirrorOverlay.reset(new Impl3DMirrorConstructOverlay(*this));
mpMirrorOverlay->SetMirrorAxis(aHdlList.GetHdl(SdrHdlKind::Ref1)->GetPos(), aHdlList.GetHdl(SdrHdlKind::Ref2)->GetPos());
}
@@ -1485,11 +1485,7 @@ E3dView::~E3dView ()
void E3dView::ResetCreationActive ()
{
- if(mpMirrorOverlay)
- {
- delete mpMirrorOverlay;
- mpMirrorOverlay = nullptr;
- }
+ mpMirrorOverlay.reset();
}
void E3dView::InitView ()
More information about the Libreoffice-commits
mailing list