diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-01 18:02:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-02 08:27:39 +0200 |
commit | a1ce78b03d37ff845e404aeb224e9cf1092011ce (patch) | |
tree | d36b740a5e685d811d9e24b1ec8a39de9a9baae2 | |
parent | b6025e6cffe2024fefebd161ea739188b4b4fdaf (diff) |
loplugin:useuniqueptr in E3dView
Change-Id: I2945d810a05f0f9d44ac17c20f5a82e05bd4981e
Reviewed-on: https://gerrit.libreoffice.org/53712
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/svx/view3d.hxx | 3 | ||||
-rw-r--r-- | svx/source/engine3d/view3d.cxx | 8 |
2 files changed, 4 insertions, 7 deletions
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 () |