From 16265a1f84f0ac7c16beee6a3591653eaaa90323 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 13 Jun 2017 11:27:48 +0200 Subject: Use unique_ptr for ImpSdrGDIMetaFileImport::mp*Attr Change-Id: I8bfe10e46cfaacb329998b11fe507c2302fe2d44 --- svx/source/svdraw/svdfmtf.cxx | 14 ++++---------- svx/source/svdraw/svdfmtf.hxx | 11 +++++++---- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index 104e0bb47892..9b08878962ef 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -19,6 +19,7 @@ #include "svdfmtf.hxx" #include +#include #include #include #include @@ -109,19 +110,12 @@ ImpSdrGDIMetaFileImport::ImpSdrGDIMetaFileImport( mpVD->SetLineColor(); mpVD->SetFillColor(); maOldLineColor.SetRed( mpVD->GetLineColor().GetRed() + 1 ); - mpLineAttr = new SfxItemSet(rModel.GetItemPool(), XATTR_LINE_FIRST, XATTR_LINE_LAST, 0, 0); - mpFillAttr = new SfxItemSet(rModel.GetItemPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST, 0, 0); - mpTextAttr = new SfxItemSet(rModel.GetItemPool(), EE_ITEMS_START, EE_ITEMS_END, 0, 0); + mpLineAttr = o3tl::make_unique(rModel.GetItemPool(), XATTR_LINE_FIRST, XATTR_LINE_LAST, 0, 0); + mpFillAttr = o3tl::make_unique(rModel.GetItemPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST, 0, 0); + mpTextAttr = o3tl::make_unique(rModel.GetItemPool(), EE_ITEMS_START, EE_ITEMS_END, 0, 0); checkClip(); } -ImpSdrGDIMetaFileImport::~ImpSdrGDIMetaFileImport() -{ - delete mpLineAttr; - delete mpFillAttr; - delete mpTextAttr; -} - void ImpSdrGDIMetaFileImport::DoLoopActions(GDIMetaFile& rMtf, SvdProgressInfo* pProgrInfo, sal_uInt32* pActionsToReport) { const sal_uLong nCount(rMtf.GetActionSize()); diff --git a/svx/source/svdraw/svdfmtf.hxx b/svx/source/svdraw/svdfmtf.hxx index 25621d7ac7cf..7b3d0d12315a 100644 --- a/svx/source/svdraw/svdfmtf.hxx +++ b/svx/source/svdraw/svdfmtf.hxx @@ -20,6 +20,10 @@ #ifndef INCLUDED_SVX_SOURCE_SVDRAW_SVDFMTF_HXX #define INCLUDED_SVX_SOURCE_SVDRAW_SVDFMTF_HXX +#include + +#include + #include #include #include @@ -46,9 +50,9 @@ protected: ScopedVclPtr mpVD; tools::Rectangle maScaleRect; size_t mnMapScalingOfs; // from here on, not edited with MapScaling - SfxItemSet* mpLineAttr; - SfxItemSet* mpFillAttr; - SfxItemSet* mpTextAttr; + std::unique_ptr mpLineAttr; + std::unique_ptr mpFillAttr; + std::unique_ptr mpTextAttr; SdrModel* mpModel; SdrLayerID mnLayer; Color maOldLineColor; @@ -159,7 +163,6 @@ public: SdrModel& rModel, SdrLayerID nLay, const tools::Rectangle& rRect); - ~ImpSdrGDIMetaFileImport(); size_t DoImport( const GDIMetaFile& rMtf, -- cgit