diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-30 10:25:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-05 12:04:55 +0100 |
commit | b05a3198f6c1d4713a871c46610dd48bf3979e8a (patch) | |
tree | e4ba068c776c783e16beb6250cc5037860b71532 | |
parent | 5c7b954935369cbbd22a6f43be63ac7c0ddbbfdc (diff) |
loplugin:useuniqueptr in E3DModifySceneSnapRectUpdater
Change-Id: Ied2cdfa314f86ff3a25cecd5c13c03d3428966f0
Reviewed-on: https://gerrit.libreoffice.org/49207
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/svx/e3dsceneupdater.hxx | 3 | ||||
-rw-r--r-- | svx/source/engine3d/e3dsceneupdater.cxx | 7 |
2 files changed, 4 insertions, 6 deletions
diff --git a/include/svx/e3dsceneupdater.hxx b/include/svx/e3dsceneupdater.hxx index ce51518ee689..ad01d667b4f5 100644 --- a/include/svx/e3dsceneupdater.hxx +++ b/include/svx/e3dsceneupdater.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SVX_E3DSCENEUPDATER_HXX #include <svx/svxdllapi.h> +#include <memory> class SdrObject; class E3dScene; @@ -53,7 +54,7 @@ class SVX_DLLPUBLIC E3DModifySceneSnapRectUpdater // the 3d transformation stack at the time of construction, valid when // mpScene is not zero - drawinglayer::geometry::ViewInformation3D* mpViewInformation3D; + std::unique_ptr<drawinglayer::geometry::ViewInformation3D> mpViewInformation3D; public: // the constructor evaluates and sets the members at construction time diff --git a/svx/source/engine3d/e3dsceneupdater.cxx b/svx/source/engine3d/e3dsceneupdater.cxx index a77e7badd5a6..bc696daebafb 100644 --- a/svx/source/engine3d/e3dsceneupdater.cxx +++ b/svx/source/engine3d/e3dsceneupdater.cxx @@ -51,7 +51,7 @@ E3DModifySceneSnapRectUpdater::E3DModifySceneSnapRectUpdater(const SdrObject* pO else { // secure current 3D transformation stack - mpViewInformation3D = new drawinglayer::geometry::ViewInformation3D(rVCScene.getViewInformation3D(aAllContentRange)); + mpViewInformation3D.reset( new drawinglayer::geometry::ViewInformation3D(rVCScene.getViewInformation3D(aAllContentRange)) ); } } } @@ -83,8 +83,7 @@ E3DModifySceneSnapRectUpdater::~E3DModifySceneSnapRectUpdater() mpViewInformation3D->getDeviceToView(), mpViewInformation3D->getViewTime(), mpViewInformation3D->getExtendedInformationSequence()); - delete mpViewInformation3D; - mpViewInformation3D = pNew; + mpViewInformation3D.reset(pNew); } // transform content range to scene-relative coordinates using old 3d transformation stack @@ -111,8 +110,6 @@ E3DModifySceneSnapRectUpdater::~E3DModifySceneSnapRectUpdater() } } } - - delete mpViewInformation3D; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |