diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-30 11:27:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-05 07:56:13 +0100 |
commit | 4573a50b477404b0d17c1c32c2ccb6b9503a0a0d (patch) | |
tree | 00a55ef56f88bae730dfc62dfd463bb79d86d934 /svx/source | |
parent | 9b0ee7d25fd405153fa783cbc0b1658368a22355 (diff) |
loplugin:useuniqueptr in ViewObjectContact
Change-Id: I69721e71f5351276d43d04107058eeb14d4925aa
Reviewed-on: https://gerrit.libreoffice.org/49213
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/sdr/contact/viewobjectcontact.cxx | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx index 324dc67bf091..e0d52153e525 100644 --- a/svx/source/sdr/contact/viewobjectcontact.cxx +++ b/svx/source/sdr/contact/viewobjectcontact.cxx @@ -178,11 +178,7 @@ ViewObjectContact::~ViewObjectContact() } // delete PrimitiveAnimation - if(mpPrimitiveAnimation) - { - delete mpPrimitiveAnimation; - mpPrimitiveAnimation = nullptr; - } + mpPrimitiveAnimation.reset(); // take care of remembered ObjectContact. Remove from // OC first. The VC removal (below) CAN trigger a StopGettingViewed() @@ -288,11 +284,7 @@ void ViewObjectContact::ActionChildInserted(ViewContact& rChild) void ViewObjectContact::checkForPrimitive2DAnimations() { // remove old one - if(mpPrimitiveAnimation) - { - delete mpPrimitiveAnimation; - mpPrimitiveAnimation = nullptr; - } + mpPrimitiveAnimation.reset(); // check for animated primitives if(!mxPrimitive2DSequence.empty()) @@ -309,7 +301,7 @@ void ViewObjectContact::checkForPrimitive2DAnimations() if(!aAnimatedExtractor.getPrimitive2DSequence().empty()) { // derived primitiveList is animated, setup new PrimitiveAnimation - mpPrimitiveAnimation = new sdr::animation::PrimitiveAnimation(*this, aAnimatedExtractor.getPrimitive2DSequence()); + mpPrimitiveAnimation.reset( new sdr::animation::PrimitiveAnimation(*this, aAnimatedExtractor.getPrimitive2DSequence()) ); } } } |