diff options
-rw-r--r-- | include/svx/scene3d.hxx | 3 | ||||
-rw-r--r-- | svx/source/engine3d/scene3d.cxx | 8 |
2 files changed, 4 insertions, 7 deletions
diff --git a/include/svx/scene3d.hxx b/include/svx/scene3d.hxx index c3412eeeef64..57c79e7e1bec 100644 --- a/include/svx/scene3d.hxx +++ b/include/svx/scene3d.hxx @@ -24,6 +24,7 @@ #include <tools/b3dtrans.hxx> #include <svx/svxdllapi.h> #include <svx/obj3d.hxx> +#include <memory> namespace sdr { namespace properties { class BaseProperties; @@ -70,7 +71,7 @@ protected: B3dCamera aCameraSet; Camera3D aCamera; - Imp3DDepthRemapper* mp3DDepthRemapper; + mutable std::unique_ptr<Imp3DDepthRemapper> mp3DDepthRemapper; // Flag to determine if only selected objects should be drawn bool bDrawOnlySelected : 1; diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx index 5992fbae38b6..b3c9a401e3c4 100644 --- a/svx/source/engine3d/scene3d.cxx +++ b/svx/source/engine3d/scene3d.cxx @@ -233,11 +233,7 @@ basegfx::B2DPolyPolygon E3dScene::TakeXorPoly() const void E3dScene::ImpCleanup3DDepthMapper() { - if(mp3DDepthRemapper) - { - delete mp3DDepthRemapper; - mp3DDepthRemapper = nullptr; - } + mp3DDepthRemapper.reset(); } sal_uInt32 E3dScene::RemapOrdNum(sal_uInt32 nNewOrdNum) const @@ -248,7 +244,7 @@ sal_uInt32 E3dScene::RemapOrdNum(sal_uInt32 nNewOrdNum) const if(nObjCount > 1) { - const_cast<E3dScene*>(this)->mp3DDepthRemapper = new Imp3DDepthRemapper(*this); + mp3DDepthRemapper.reset(new Imp3DDepthRemapper(*this)); } } |