diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-24 13:40:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-29 17:03:59 +0200 |
commit | be2188598ef038f3e110f0a528ae682c93f2a6fd (patch) | |
tree | 344e64368ed4383ee515e7fe52dc041ef1a65b7f /svtools/source | |
parent | 979293ca138ccfb22ff1282b9055ae18b775fed8 (diff) |
loplugin:useuniqueptr in Ruler
Change-Id: Iad5ca0c3744b7598af827e66855f4be108757bd9
Reviewed-on: https://gerrit.libreoffice.org/53594
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools/source')
-rw-r--r-- | svtools/source/control/ruler.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index eb34a0204c22..a4d81f1e9adc 100644 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -181,7 +181,7 @@ void Ruler::ImplInit( WinBits nWinBits ) mbAutoWinWidth = true; // EditWinWidth == RulerWidth mbActive = true; // Is ruler active mnUpdateFlags = 0; // What needs to be updated - mpData = mpSaveData; // Pointer to normal data + mpData = mpSaveData.get(); // Pointer to normal data meExtraType = RulerExtra::DontKnow; // What is in extra field meDragType = RulerType::DontKnow; // Which element is dragged @@ -257,10 +257,8 @@ void Ruler::dispose() { if ( mnUpdateEvtId ) Application::RemoveUserEvent( mnUpdateEvtId ); - delete mpSaveData; - mpSaveData = nullptr; - delete mpDragData; - mpDragData = nullptr; + mpSaveData.reset(); + mpDragData.reset(); mxAccContext.clear(); Window::dispose(); } @@ -1758,7 +1756,7 @@ bool Ruler::ImplStartDrag( RulerSelection const * pHitTest, sal_uInt16 nModifier mnDragSize = pHitTest->mnDragSize; mnDragModifier = nModifier; *mpDragData = *mpSaveData; - mpData = mpDragData; + mpData = mpDragData.get(); // call handler if (StartDrag()) @@ -1778,7 +1776,7 @@ bool Ruler::ImplStartDrag( RulerSelection const * pHitTest, sal_uInt16 nModifier mnDragAryPos = 0; mnDragSize = RulerDragSize::Move; mnDragModifier = 0; - mpData = mpSaveData; + mpData = mpSaveData.get(); } return false; @@ -1867,7 +1865,7 @@ void Ruler::ImplEndDrag() else *mpSaveData = *mpDragData; - mpData = mpSaveData; + mpData = mpSaveData.get(); mbDrag = false; // call handler |