diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-31 15:40:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-12 08:43:48 +0200 |
commit | e4e4d5713e248f02faf7aa6199b11e152973de8e (patch) | |
tree | 836dffa89d0a966e41b1af8270db74b9590def22 /drawinglayer | |
parent | d4eabd5da8ea3b5ac40659c22cde19b26b3c002b (diff) |
clang-tidy readability-delete-null-pointer
which in turn triggered some loplugin:useuniqueptr
Change-Id: I0c38561fc9b68dac44e8cf58c8aa1f582196cc64
Reviewed-on: https://gerrit.libreoffice.org/38281
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer')
3 files changed, 3 insertions, 16 deletions
diff --git a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx index 750d4d8977e3..3f901f61069a 100644 --- a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx @@ -442,10 +442,6 @@ namespace drawinglayer SdrExtrudePrimitive3D::~SdrExtrudePrimitive3D() { - if(mpLastRLGViewInformation) - { - delete mpLastRLGViewInformation; - } } bool SdrExtrudePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const @@ -493,8 +489,7 @@ namespace drawinglayer // new one and clear current decompositiopn SdrExtrudePrimitive3D* pThat = const_cast< SdrExtrudePrimitive3D* >(this); pThat->setBuffered3DDecomposition(Primitive3DContainer()); - delete pThat->mpLastRLGViewInformation; - pThat->mpLastRLGViewInformation = new geometry::ViewInformation3D(rViewInformation); + pThat->mpLastRLGViewInformation.reset( new geometry::ViewInformation3D(rViewInformation) ); } } diff --git a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx index 0bffc5801b01..4f38141846ac 100644 --- a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx @@ -302,10 +302,6 @@ namespace drawinglayer SdrLathePrimitive3D::~SdrLathePrimitive3D() { - if(mpLastRLGViewInformation) - { - delete mpLastRLGViewInformation; - } } bool SdrLathePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const @@ -355,8 +351,7 @@ namespace drawinglayer // new one and clear current decompositiopn SdrLathePrimitive3D* pThat = const_cast< SdrLathePrimitive3D* >(this); pThat->setBuffered3DDecomposition(Primitive3DContainer()); - delete pThat->mpLastRLGViewInformation; - pThat->mpLastRLGViewInformation = new geometry::ViewInformation3D(rViewInformation); + pThat->mpLastRLGViewInformation.reset( new geometry::ViewInformation3D(rViewInformation) ); } } diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx index 8b95d90659b2..1ce54a3bfe36 100644 --- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx +++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx @@ -618,10 +618,7 @@ namespace drawinglayer ZBufferProcessor3D::~ZBufferProcessor3D() { - if(mpZBufferRasterConverter3D) - { - delete mpZBufferRasterConverter3D; - } + delete mpZBufferRasterConverter3D; if(mpRasterPrimitive3Ds) { |