diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-13 16:16:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-15 11:27:20 +0200 |
commit | 18e20676024baecaf5719139f80f053f5f1e784a (patch) | |
tree | 54e7d15b178ee373c0c72e153d9b1a427963d889 /sd/source | |
parent | 82a7c54ad8b9b193e767fcafb5316d3f05e21001 (diff) |
loplugin:useuniqueptr in OverlayObjectList
Change-Id: I641d93e54504c27bcc49bae8edf6286c0a9a471f
Reviewed-on: https://gerrit.libreoffice.org/59024
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/animations/motionpathtag.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/annotations/annotationtag.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/view/viewoverlaymanager.cxx | 7 |
3 files changed, 9 insertions, 10 deletions
diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx index 2e5bb8cb52de..0a6a5ca6e94b 100644 --- a/sd/source/ui/animations/motionpathtag.cxx +++ b/sd/source/ui/animations/motionpathtag.cxx @@ -288,10 +288,10 @@ void SdPathHdl::CreateB2dIAObject() { const sdr::contact::ViewContact& rVC = mpPathObj->GetViewContact(); const drawinglayer::primitive2d::Primitive2DContainer aSequence = rVC.getViewIndependentPrimitive2DContainer(); - sdr::overlay::OverlayObject* pNew = new sdr::overlay::OverlayPrimitive2DSequenceObject(aSequence); + std::unique_ptr<sdr::overlay::OverlayObject> pNew(new sdr::overlay::OverlayPrimitive2DSequenceObject(aSequence)); xManager->add(*pNew); - maOverlayGroup.append(pNew); + maOverlayGroup.append(std::move(pNew)); } } } diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx index 2572ea40b0b2..99e37fd59c8a 100644 --- a/sd/source/ui/annotations/annotationtag.cxx +++ b/sd/source/ui/annotations/annotationtag.cxx @@ -210,22 +210,22 @@ void AnnotationHdl::CreateB2dIAObject() rtl::Reference< sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager(); if(rPaintWindow.OutputToWindow() && xManager.is() ) { - sdr::overlay::OverlayObject* pOverlayObject = nullptr; + std::unique_ptr<sdr::overlay::OverlayObject> pOverlayObject; // animate focused handles if(bFocused) { const sal_uInt64 nBlinkTime = rStyleSettings.GetCursorBlinkTime(); - pOverlayObject = new sdr::overlay::OverlayAnimatedBitmapEx(aPosition, aBitmapEx, aBitmapEx2, nBlinkTime, 0, 0, 0, 0 ); + pOverlayObject.reset(new sdr::overlay::OverlayAnimatedBitmapEx(aPosition, aBitmapEx, aBitmapEx2, nBlinkTime, 0, 0, 0, 0 )); } else { - pOverlayObject = new sdr::overlay::OverlayBitmapEx( aPosition, aBitmapEx, 0, 0 ); + pOverlayObject.reset(new sdr::overlay::OverlayBitmapEx( aPosition, aBitmapEx, 0, 0 )); } xManager->add(*pOverlayObject); - maOverlayGroup.append(pOverlayObject); + maOverlayGroup.append(std::move(pOverlayObject)); } } } diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx index c65380d83d7d..0e3b48ca369a 100644 --- a/sd/source/ui/view/viewoverlaymanager.cxx +++ b/sd/source/ui/view/viewoverlaymanager.cxx @@ -245,11 +245,10 @@ void ImageButtonHdl::CreateB2dIAObject() rtl::Reference< sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager(); if(rPaintWindow.OutputToWindow() && xManager.is() ) { - sdr::overlay::OverlayObject* pOverlayObject = nullptr; - - pOverlayObject = new sdr::overlay::OverlayBitmapEx( aPosition, aBitmapEx, 0, 0 ); + std::unique_ptr<sdr::overlay::OverlayObject> pOverlayObject( + new sdr::overlay::OverlayBitmapEx( aPosition, aBitmapEx, 0, 0 )); xManager->add(*pOverlayObject); - maOverlayGroup.append(pOverlayObject); + maOverlayGroup.append(std::move(pOverlayObject)); } } } |