From 724ddb9177fd38c80f60d3d957d7be4be813c069 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 6 Apr 2017 16:02:24 +0200 Subject: loplugin:useuniqueptr Change-Id: I33aafc7351c5fdc2c677d0be123f666211255ccb --- chart2/source/controller/main/ChartTransferable.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'chart2') diff --git a/chart2/source/controller/main/ChartTransferable.cxx b/chart2/source/controller/main/ChartTransferable.cxx index b427669a459c..e5d1e1f4cb55 100644 --- a/chart2/source/controller/main/ChartTransferable.cxx +++ b/chart2/source/controller/main/ChartTransferable.cxx @@ -17,8 +17,13 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + +#include + #include "ChartTransferable.hxx" +#include #include #include #include @@ -43,7 +48,7 @@ ChartTransferable::ChartTransferable( SdrModel* pDrawModel, SdrObject* pSelected :m_pMarkedObjModel( nullptr ) ,m_bDrawing( bDrawing ) { - SdrExchangeView * pExchgView( new SdrView( pDrawModel )); + std::unique_ptr pExchgView(o3tl::make_unique( pDrawModel )); SdrPageView* pPv = pExchgView->ShowSdrPage( pDrawModel->GetPage( 0 )); if( pSelectedObj ) pExchgView->MarkObj( pSelectedObj, pPv ); @@ -55,7 +60,6 @@ ChartTransferable::ChartTransferable( SdrModel* pDrawModel, SdrObject* pSelected { m_pMarkedObjModel = pExchgView->GetMarkedObjModel(); } - delete pExchgView; } ChartTransferable::~ChartTransferable() -- cgit