[Libreoffice-commits] core.git: include/svx svx/source

Noel Grandin noel.grandin at collabora.co.uk
Mon Feb 5 11:05:19 UTC 2018


 include/svx/e3dsceneupdater.hxx         |    3 ++-
 svx/source/engine3d/e3dsceneupdater.cxx |    7 ++-----
 2 files changed, 4 insertions(+), 6 deletions(-)

New commits:
commit b05a3198f6c1d4713a871c46610dd48bf3979e8a
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Jan 30 10:25:15 2018 +0200

    loplugin:useuniqueptr in E3DModifySceneSnapRectUpdater
    
    Change-Id: Ied2cdfa314f86ff3a25cecd5c13c03d3428966f0
    Reviewed-on: https://gerrit.libreoffice.org/49207
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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: */


More information about the Libreoffice-commits mailing list