diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-02-21 20:03:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-02-22 08:08:27 +0100 |
commit | 21d76782b39cf83130985d27138f61308f572151 (patch) | |
tree | 8b5250e037a834eb6ad14271089985105c5ec42d /drawinglayer/source/primitive3d | |
parent | 795ac4b5b6ba2c55ca73859fbc9bd4116120fe29 (diff) |
loplugin:refcounting in drawinglayer
Change-Id: Ia7bf3a4811a47180ce2a92852a01b613ff16279a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111288
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer/source/primitive3d')
-rw-r--r-- | drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx | 15 | ||||
-rw-r--r-- | drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx | 3 |
2 files changed, 7 insertions, 11 deletions
diff --git a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx index 177d829ef4fc..ff00b91050f6 100644 --- a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx @@ -318,8 +318,7 @@ namespace drawinglayer::primitive3d { const basegfx::B3DPolygon& aPartPolygon(aSphere.getB3DPolygon(a)); const basegfx::B3DPolyPolygon aPartPolyPolygon(aPartPolygon); - BasePrimitive3D* pNew = new PolyPolygonMaterialPrimitive3D(aPartPolyPolygon, rMaterial, false); - aResultVector.push_back(pNew); + aResultVector.push_back(new PolyPolygonMaterialPrimitive3D(aPartPolyPolygon, rMaterial, false)); } } else @@ -466,8 +465,7 @@ namespace drawinglayer::primitive3d if(aNewPolygon.count()) { const basegfx::B3DPolyPolygon aNewPolyPolygon(aNewPolygon); - BasePrimitive3D* pNew = new PolyPolygonMaterialPrimitive3D(aNewPolyPolygon, rMaterial, false); - aResultVector.push_back(pNew); + aResultVector.push_back(new PolyPolygonMaterialPrimitive3D(aNewPolyPolygon, rMaterial, false)); } if(bMiter && aMiterPolygon.count()) @@ -480,8 +478,7 @@ namespace drawinglayer::primitive3d // create primitive const basegfx::B3DPolyPolygon aMiterPolyPolygon(aMiterPolygon); - BasePrimitive3D* pNew = new PolyPolygonMaterialPrimitive3D(aMiterPolyPolygon, rMaterial, false); - aResultVector.push_back(pNew); + aResultVector.push_back(new PolyPolygonMaterialPrimitive3D(aMiterPolyPolygon, rMaterial, false)); } // prepare next step @@ -615,8 +612,7 @@ using namespace com::sun::star; aSequence = getLineCapSegments(nSegments, aMaterial); } - TransformPrimitive3D* pNewTransformedA = new TransformPrimitive3D(aCapTrans, aSequence); - aResultVector.push_back(pNewTransformedA); + aResultVector.push_back(new TransformPrimitive3D(aCapTrans, aSequence)); } else { @@ -717,8 +713,7 @@ using namespace com::sun::star; else { // create hairline - PolygonHairlinePrimitive3D* pNew = new PolygonHairlinePrimitive3D(getB3DPolygon(), getBColor()); - aResultVector.push_back(pNew); + aResultVector.push_back(new PolygonHairlinePrimitive3D(getB3DPolygon(), getBColor())); } } diff --git a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx index 826583b1404c..e8d197e1a1e9 100644 --- a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx +++ b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx @@ -36,6 +36,7 @@ #include <drawinglayer/attribute/sdrfillattribute.hxx> #include <drawinglayer/attribute/sdrshadowattribute.hxx> #include <primitive3d/hiddengeometryprimitive3d.hxx> +#include <rtl/ref.hxx> namespace drawinglayer::primitive3d @@ -197,7 +198,7 @@ namespace drawinglayer::primitive3d { bool bModulate(css::drawing::TextureMode_MODULATE == aSdr3DObjectAttribute.getTextureMode()); bool bFilter(aSdr3DObjectAttribute.getTextureFilter()); - BasePrimitive3D* pNewTexturePrimitive3D = nullptr; + rtl::Reference<BasePrimitive3D> pNewTexturePrimitive3D; if(!rFill.getGradient().isDefault()) { |