summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-04-06 16:02:24 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-04-06 16:02:24 +0200
commit724ddb9177fd38c80f60d3d957d7be4be813c069 (patch)
treefd145e0b1c9e531480007e698bb6c65d1ca1c23d /chart2
parent169467cc795021f95faa4f627c0802fbec312312 (diff)
loplugin:useuniqueptr
Change-Id: I33aafc7351c5fdc2c677d0be123f666211255ccb
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/main/ChartTransferable.cxx8
1 files changed, 6 insertions, 2 deletions
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 <sal/config.h>
+
+#include <memory>
+
#include "ChartTransferable.hxx"
+#include <o3tl/make_unique.hxx>
#include <sot/exchange.hxx>
#include <sot/storage.hxx>
#include <unotools/streamwrap.hxx>
@@ -43,7 +48,7 @@ ChartTransferable::ChartTransferable( SdrModel* pDrawModel, SdrObject* pSelected
:m_pMarkedObjModel( nullptr )
,m_bDrawing( bDrawing )
{
- SdrExchangeView * pExchgView( new SdrView( pDrawModel ));
+ std::unique_ptr<SdrExchangeView> pExchgView(o3tl::make_unique<SdrView>( 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()