Kaydet (Commit) 16265a1f authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Use unique_ptr for ImpSdrGDIMetaFileImport::mp*Attr

Change-Id: I8bfe10e46cfaacb329998b11fe507c2302fe2d44
üst 5df3b28a
......@@ -19,6 +19,7 @@
#include "svdfmtf.hxx"
#include <editeng/editdata.hxx>
#include <o3tl/make_unique.hxx>
#include <math.h>
#include <svx/xpoly.hxx>
#include <vcl/svapp.hxx>
......@@ -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<SfxItemSet>(rModel.GetItemPool(), XATTR_LINE_FIRST, XATTR_LINE_LAST, 0, 0);
mpFillAttr = o3tl::make_unique<SfxItemSet>(rModel.GetItemPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST, 0, 0);
mpTextAttr = o3tl::make_unique<SfxItemSet>(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());
......
......@@ -20,6 +20,10 @@
#ifndef INCLUDED_SVX_SOURCE_SVDRAW_SVDFMTF_HXX
#define INCLUDED_SVX_SOURCE_SVDRAW_SVDFMTF_HXX
#include <sal/config.h>
#include <memory>
#include <tools/contnr.hxx>
#include <tools/fract.hxx>
#include <vcl/metaact.hxx>
......@@ -46,9 +50,9 @@ protected:
ScopedVclPtr<VirtualDevice> mpVD;
tools::Rectangle maScaleRect;
size_t mnMapScalingOfs; // from here on, not edited with MapScaling
SfxItemSet* mpLineAttr;
SfxItemSet* mpFillAttr;
SfxItemSet* mpTextAttr;
std::unique_ptr<SfxItemSet> mpLineAttr;
std::unique_ptr<SfxItemSet> mpFillAttr;
std::unique_ptr<SfxItemSet> 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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment