From d72a2899dfd849056c6562bcd08537e1ab52100c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 15 Jan 2018 16:13:27 +0200 Subject: [PATCH] loplugin:useuniqueptr in VCLXWindow Change-Id: Iefec174c7dc3dbd52bdb9f6d7ebe6c8c42c031e9 --- include/toolkit/awt/vclxwindow.hxx | 3 ++- toolkit/source/awt/vclxwindow.cxx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/toolkit/awt/vclxwindow.hxx b/include/toolkit/awt/vclxwindow.hxx index 18cd3f0392ca..27be3e102d32 100644 --- a/include/toolkit/awt/vclxwindow.hxx +++ b/include/toolkit/awt/vclxwindow.hxx @@ -44,6 +44,7 @@ #include #include +#include #include #include @@ -76,7 +77,7 @@ typedef cppu::ImplInheritanceHelper< VCLXDevice, class TOOLKIT_DLLPUBLIC VCLXWindow : public VCLXWindow_Base { private: - VCLXWindowImpl* mpImpl; + std::unique_ptr mpImpl; UnoPropertyArrayHelper *GetPropHelper(); diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 6142b15140a3..7d1a70a23515 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -328,12 +328,12 @@ void ImplInitWindowEvent( css::awt::WindowEvent& rEvent, vcl::Window const * pWi VCLXWindow::VCLXWindow( bool _bWithDefaultProps ) :mpImpl( nullptr ) { - mpImpl = new VCLXWindowImpl( *this, _bWithDefaultProps ); + mpImpl.reset( new VCLXWindowImpl( *this, _bWithDefaultProps ) ); } VCLXWindow::~VCLXWindow() { - delete mpImpl; + mpImpl.reset(); if ( GetWindow() ) {