diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-21 16:42:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-28 08:49:45 +0200 |
commit | 326c094ecfb496555b02234a751ab525cea6db55 (patch) | |
tree | 00eb04e3f1fcb952e602e62234cffd48617940eb /sd | |
parent | loplugin:useuniqueptr in AccessibleDrawDocumentView (diff) | |
download | core-326c094ecfb496555b02234a751ab525cea6db55.tar.gz core-326c094ecfb496555b02234a751ab525cea6db55.zip |
loplugin:useuniqueptr in MotionPathTag
Change-Id: I1f63cf02a99018fbac1bf07b9afe6d7347a973d9
Reviewed-on: https://gerrit.libreoffice.org/54861
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/animations/motionpathtag.cxx | 14 | ||||
-rw-r--r-- | sd/source/ui/animations/motionpathtag.hxx | 2 |
2 files changed, 6 insertions, 10 deletions
diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx index 64b22607ef38..ab24218ce38e 100644 --- a/sd/source/ui/animations/motionpathtag.cxx +++ b/sd/source/ui/animations/motionpathtag.cxx @@ -341,7 +341,7 @@ MotionPathTag::MotionPathTag( CustomAnimationPane& rPane, ::sd::View& rView, con mpPathObj->SetMergedItem(XLineTransparenceItem(50)); - mpMark = new SdrMark( mpPathObj, mrView.GetSdrPageView() ); + mpMark.reset(new SdrMark( mpPathObj, mrView.GetSdrPageView() )); mpPathObj->AddListener( *this ); @@ -778,7 +778,7 @@ bool MotionPathTag::MarkPoint(SdrHdl& rHdl, bool bUnmark ) SmartHdl* pSmartHdl = dynamic_cast< SmartHdl* >( &rHdl ); if( pSmartHdl && pSmartHdl->getTag().get() == this ) { - if (mrView.MarkPointHelper(&rHdl,mpMark,bUnmark)) + if (mrView.MarkPointHelper(&rHdl,mpMark.get(),bUnmark)) { mrView.MarkListHasChanged(); bRet=true; @@ -807,7 +807,7 @@ bool MotionPathTag::MarkPoints(const ::tools::Rectangle* pRect, bool bUnmark ) Point aPos(pHdl->GetPos()); if( pRect==nullptr || pRect->IsInside(aPos)) { - if( mrView.MarkPointHelper(pHdl,mpMark,bUnmark) ) + if( mrView.MarkPointHelper(pHdl,mpMark.get(),bUnmark) ) bChgd=true; } } @@ -854,7 +854,7 @@ void MotionPathTag::CheckPossibilities() bool bSegmFuz(false); basegfx::B2VectorContinuity eSmooth = basegfx::B2VectorContinuity::NONE; - mrView.CheckPolyPossibilitiesHelper( mpMark, b1stSmooth, b1stSegm, bCurve, bSmoothFuz, bSegmFuz, eSmooth ); + mrView.CheckPolyPossibilitiesHelper( mpMark.get(), b1stSmooth, b1stSegm, bCurve, bSmoothFuz, bSegmFuz, eSmooth ); } } } @@ -987,11 +987,7 @@ void MotionPathTag::disposing() SdrObject::Free(pTemp); } - if( mpMark ) - { - delete mpMark; - mpMark = nullptr; - } + mpMark.reset(); SmartTag::disposing(); } diff --git a/sd/source/ui/animations/motionpathtag.hxx b/sd/source/ui/animations/motionpathtag.hxx index 0e785cece1e2..3158f95c2d8b 100644 --- a/sd/source/ui/animations/motionpathtag.hxx +++ b/sd/source/ui/animations/motionpathtag.hxx @@ -106,7 +106,7 @@ private: css::uno::Reference< css::drawing::XShape > mxOrigin; SdrPathObj* mpPathObj; css::awt::Point maOriginPos; - SdrMark* mpMark; + std::unique_ptr<SdrMark> mpMark; OUString msLastPath; bool mbInUpdatePath; }; |