summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-24 15:23:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-29 18:22:10 +0200
commit6676d32077d74ec03dfe736c081e41b4b2059c5c (patch)
treeb934a13ec394abf2b7b23056379c37f2f695f7e4 /drawinglayer
parent9a2f5100711232da048f82c80f65913be32ba831 (diff)
loplugin:useuniqueptr in Executor
Change-Id: I3b21b4438f5762aa9960a121ba5826f47d6e9c68 Reviewed-on: https://gerrit.libreoffice.org/53603 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/primitive2d/sceneprimitive2d.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index 46e25920c769..35024d9bc684 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -386,16 +386,16 @@ namespace drawinglayer
class Executor : public comphelper::ThreadTask
{
private:
- processor3d::ZBufferProcessor3D* mpZBufferProcessor3D;
+ std::unique_ptr<processor3d::ZBufferProcessor3D> mpZBufferProcessor3D;
const primitive3d::Primitive3DContainer& mrChildren3D;
public:
explicit Executor(
std::shared_ptr<comphelper::ThreadTaskTag> const & rTag,
- processor3d::ZBufferProcessor3D* pZBufferProcessor3D,
+ std::unique_ptr<processor3d::ZBufferProcessor3D> pZBufferProcessor3D,
const primitive3d::Primitive3DContainer& rChildren3D)
: comphelper::ThreadTask(rTag),
- mpZBufferProcessor3D(pZBufferProcessor3D),
+ mpZBufferProcessor3D(std::move(pZBufferProcessor3D)),
mrChildren3D(rChildren3D)
{
}
@@ -404,7 +404,7 @@ namespace drawinglayer
{
mpZBufferProcessor3D->process(mrChildren3D);
mpZBufferProcessor3D->finish();
- delete mpZBufferProcessor3D;
+ mpZBufferProcessor3D.reset();
}
};
@@ -413,7 +413,7 @@ namespace drawinglayer
for(sal_Int32 a(0); a < nThreadCount; a++)
{
- processor3d::ZBufferProcessor3D* pNewZBufferProcessor3D = new processor3d::ZBufferProcessor3D(
+ std::unique_ptr<processor3d::ZBufferProcessor3D> pNewZBufferProcessor3D(new processor3d::ZBufferProcessor3D(
aViewInformation3D,
getSdrSceneAttribute(),
getSdrLightingAttribute(),
@@ -423,8 +423,8 @@ namespace drawinglayer
fFullViewSizeY,
aBZPixelRaster,
nLinesPerThread * a,
- a + 1 == nThreadCount ? aBZPixelRaster.getHeight() : nLinesPerThread * (a + 1));
- Executor* pExecutor = new Executor(aTag, pNewZBufferProcessor3D, getChildren3D());
+ a + 1 == nThreadCount ? aBZPixelRaster.getHeight() : nLinesPerThread * (a + 1)));
+ Executor* pExecutor = new Executor(aTag, std::move(pNewZBufferProcessor3D), getChildren3D());
rThreadPool.pushTask(pExecutor);
}