diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-16 12:23:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-23 08:14:32 +0200 |
commit | 3acdd48382476e7bf79512762a4ecb872a18cdb8 (patch) | |
tree | 87c9e05839047b434cb4e116003afab35d5607be /vcl | |
parent | 3148fdfe21a626307fc60fef1451b1c501686504 (diff) |
loplugin:useuniqueptr in ImplWheelWindow
Change-Id: I064ebced6e7840c4f9a179c312743385892e552a
Reviewed-on: https://gerrit.libreoffice.org/53228
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/scrwnd.hxx | 2 | ||||
-rw-r--r-- | vcl/source/window/scrwnd.cxx | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/vcl/inc/scrwnd.hxx b/vcl/inc/scrwnd.hxx index de6e1320b1e5..779f9f8937dd 100644 --- a/vcl/inc/scrwnd.hxx +++ b/vcl/inc/scrwnd.hxx @@ -46,7 +46,7 @@ private: std::vector<Image> maImgList; Point maLastMousePos; Point maCenter; - Timer* mpTimer; + std::unique_ptr<Timer> mpTimer; sal_uInt64 mnRepaintTime; sal_uInt64 mnTimeout; WheelMode mnWheelMode; diff --git a/vcl/source/window/scrwnd.cxx b/vcl/source/window/scrwnd.cxx index 5650e8462074..0f4e932f87ff 100644 --- a/vcl/source/window/scrwnd.cxx +++ b/vcl/source/window/scrwnd.cxx @@ -71,7 +71,7 @@ ImplWheelWindow::ImplWheelWindow( vcl::Window* pParent ) : ImplSetWheelMode( WheelMode::V ); // init timer - mpTimer = new Timer("WheelWindowTimer"); + mpTimer.reset(new Timer("WheelWindowTimer")); mpTimer->SetInvokeHandler( LINK( this, ImplWheelWindow, ImplScrollHdl ) ); mpTimer->SetTimeout( mnTimeout ); mpTimer->Start(); @@ -87,9 +87,7 @@ ImplWheelWindow::~ImplWheelWindow() void ImplWheelWindow::dispose() { ImplStop(); - delete mpTimer; - mpTimer = nullptr; - + mpTimer.reset(); FloatingWindow::dispose(); } |