diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-01 18:00:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-02 08:27:17 +0200 |
commit | b6025e6cffe2024fefebd161ea739188b4b4fdaf (patch) | |
tree | 30aa7eb74852ce982721c52da797cc20717d2c07 /svx | |
parent | e43764452e3e2a8b0acb197d6eff2cb9fc76772a (diff) |
loplugin:useuniqueptr in GalleryTransferable
Change-Id: Iad9ca26bb94fb1d499d3ce028b2289c11c1771fa
Reviewed-on: https://gerrit.libreoffice.org/53711
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/gallery2/galmisc.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx index 5cc0006b9c7e..94abe00ce6b5 100644 --- a/svx/source/gallery2/galmisc.cxx +++ b/svx/source/gallery2/galmisc.cxx @@ -403,7 +403,7 @@ void GalleryTransferable::InitData( bool bLazy ) Graphic aGraphic; if( mpTheme->GetGraphic( mnObjectPos, aGraphic ) ) - mpGraphicObject = new GraphicObject( aGraphic ); + mpGraphicObject.reset(new GraphicObject( aGraphic )); } if( !mxModelStream.is() ) @@ -427,12 +427,11 @@ void GalleryTransferable::InitData( bool bLazy ) { if( !mpURL ) { - mpURL = new INetURLObject; + mpURL.reset(new INetURLObject); if( !mpTheme->GetURL( mnObjectPos, *mpURL ) ) { - delete mpURL; - mpURL = nullptr; + mpURL.reset(); } } @@ -441,7 +440,7 @@ void GalleryTransferable::InitData( bool bLazy ) Graphic aGraphic; if( mpTheme->GetGraphic( mnObjectPos, aGraphic ) ) - mpGraphicObject = new GraphicObject( aGraphic ); + mpGraphicObject.reset(new GraphicObject( aGraphic )); } } break; @@ -544,10 +543,8 @@ void GalleryTransferable::DragFinished( sal_Int8 nDropAction ) void GalleryTransferable::ObjectReleased() { mxModelStream.clear(); - delete mpGraphicObject; - mpGraphicObject = nullptr; - delete mpURL; - mpURL = nullptr; + mpGraphicObject.reset(); + mpURL.reset(); } void GalleryTransferable::StartDrag( vcl::Window* pWindow, sal_Int8 nDragSourceActions ) |