diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-12 08:22:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-15 07:28:35 +0100 |
commit | 397d5cbc3c04da7693e2e1f3e99b0d8e431bfff2 (patch) | |
tree | d064789b3a170293ff0f57b7f2b1b1b79159b18b /vcl | |
parent | a2f86708a5740ce9fd2a3a6ab69685d8fb53dd6c (diff) |
loplugin:useuniqueptr in Cursor
Change-Id: I5de300709409311b7a1d451ee1d314596cf2e879
Reviewed-on: https://gerrit.libreoffice.org/47836
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/cursor.cxx | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx index 9f4d4a872d07..bfdfe67464e8 100644 --- a/vcl/source/window/cursor.cxx +++ b/vcl/source/window/cursor.cxx @@ -151,7 +151,7 @@ void vcl::Cursor::ImplDraw() mpData->maPixSize.Width() = pWindow->GetSettings().GetStyleSettings().GetCursorSize(); // calculate output area and display - ImplCursorInvert( mpData ); + ImplCursorInvert( mpData.get() ); mpData->mbCurVisible = true; } } @@ -160,7 +160,7 @@ void vcl::Cursor::ImplRestore() { assert( mpData && mpData->mbCurVisible ); - ImplCursorInvert( mpData ); + ImplCursorInvert( mpData.get() ); mpData->mbCurVisible = false; } @@ -185,7 +185,7 @@ void vcl::Cursor::ImplDoShow( bool bDrawDirect, bool bRestore ) { if ( !mpData ) { - mpData = new ImplCursorData; + mpData.reset( new ImplCursorData ); mpData->mbCurVisible = false; mpData->maTimer.SetInvokeHandler( LINK( this, Cursor, ImplTimerHdl ) ); mpData->maTimer.SetDebugName( "vcl ImplCursorData maTimer" ); @@ -333,13 +333,8 @@ vcl::Cursor::Cursor( const Cursor& rCursor ) : vcl::Cursor::~Cursor() { - if ( mpData ) - { - if ( mpData->mbCurVisible ) - ImplRestore(); - - delete mpData; - } + if (mpData && mpData->mbCurVisible) + ImplRestore(); } void vcl::Cursor::SetStyle( sal_uInt16 nStyle ) |