diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-22 14:14:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-25 14:08:58 +0200 |
commit | cdd233d01c860d4628b627d00a94c3bbdcee85cd (patch) | |
tree | a59a96cf0fe68b275d2513cfe95d5d2b56f1080d | |
parent | 51061839bf4edad9ded432afb1561287a56525e4 (diff) |
loplugin:useuniqueptr in sd::Ruler
Change-Id: Ic1f213b039b9c3e1cedc041d3e136eb09496570d
Reviewed-on: https://gerrit.libreoffice.org/56338
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sd/source/ui/inc/Ruler.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/sdruler.cxx | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sd/source/ui/inc/Ruler.hxx b/sd/source/ui/inc/Ruler.hxx index 56cb4c930196..45d800458493 100644 --- a/sd/source/ui/inc/Ruler.hxx +++ b/sd/source/ui/inc/Ruler.hxx @@ -51,7 +51,7 @@ public: private: DrawViewShell* pDrViewShell; - RulerCtrlItem* pCtrlItem; + std::unique_ptr<RulerCtrlItem> pCtrlItem; bool bHorz; virtual void MouseButtonDown(const MouseEvent& rMEvt) override; diff --git a/sd/source/ui/view/sdruler.cxx b/sd/source/ui/view/sdruler.cxx index 56e2a4f52df2..8bd4a9bb4e7c 100644 --- a/sd/source/ui/view/sdruler.cxx +++ b/sd/source/ui/view/sdruler.cxx @@ -73,7 +73,7 @@ Ruler::Ruler( DrawViewShell& rViewSh, vcl::Window* pParent, ::sd::Window* pWin, , pDrViewShell(&rViewSh) { rBindings.EnterRegistrations(); - pCtrlItem = new RulerCtrlItem(*this, rBindings); + pCtrlItem.reset( new RulerCtrlItem(*this, rBindings) ); rBindings.LeaveRegistrations(); if ( nWinStyle & WB_HSCROLL ) @@ -97,7 +97,7 @@ void Ruler::dispose() { SfxBindings& rBindings = pCtrlItem->GetBindings(); rBindings.EnterRegistrations(); - DELETEZ( pCtrlItem ); + pCtrlItem.reset(); rBindings.LeaveRegistrations(); SvxRuler::dispose(); } |