diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-04-02 15:01:10 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-04-02 15:27:10 +0100 |
commit | 4cd4ec2855fd51bb97812e90dc469c55882933f4 (patch) | |
tree | e1df3649b8c18b29db79ebd53bb793be8245e52e /filter/source | |
parent | 9e0bcd809a5ea7b93201172a1ce000d133484d1b (diff) |
convert to std::vector
Change-Id: Icd442975cbc084a67bdd3e7f24113f499981db60
Diffstat (limited to 'filter/source')
-rw-r--r-- | filter/source/graphicfilter/icgm/actimpr.cxx | 16 | ||||
-rw-r--r-- | filter/source/graphicfilter/icgm/outact.hxx | 4 |
2 files changed, 9 insertions, 11 deletions
diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx b/filter/source/graphicfilter/icgm/actimpr.cxx index 66ff8df07ba9..fea8420bf8c8 100644 --- a/filter/source/graphicfilter/icgm/actimpr.cxx +++ b/filter/source/graphicfilter/icgm/actimpr.cxx @@ -60,8 +60,8 @@ CGMImpressOutAct::CGMImpressOutAct( CGM& rCGM, const uno::Reference< frame::XMod mnCurrentPage = 0; mnGroupActCount = mnGroupLevel = 0; mpGroupLevel = new sal_uInt32[CGM_OUTACT_MAX_GROUP_LEVEL] (); - mpPoints = new Point[ 0x2000 ]; - mpFlags = new PolyFlags[ 0x2000 ]; + maPoints.resize(0x2000); + maFlags.resize(0x2000); mnIndex = 0; mpGradient = nullptr; @@ -91,8 +91,6 @@ CGMImpressOutAct::CGMImpressOutAct( CGM& rCGM, const uno::Reference< frame::XMod CGMImpressOutAct::~CGMImpressOutAct() { - delete[] mpPoints; - delete[] mpFlags; delete[] mpGroupLevel; delete mpGradient; } @@ -916,7 +914,7 @@ void CGMImpressOutAct::NewRegion() { if ( mnIndex > 2 ) { - tools::Polygon aPolygon( mnIndex, mpPoints, mpFlags ); + tools::Polygon aPolygon(mnIndex, maPoints.data(), maFlags.data()); maPolyPolygon.Insert( aPolygon ); } mnIndex = 0; @@ -940,16 +938,16 @@ void CGMImpressOutAct::RegPolyLine( tools::Polygon& rPolygon, bool bReverse ) { for ( sal_uInt16 i = 0; i < nPoints; i++ ) { - mpPoints[ mnIndex + i ] = rPolygon.GetPoint( nPoints - i - 1 ); - mpFlags[ mnIndex + i ] = rPolygon.GetFlags( nPoints - i - 1 ); + maPoints[ mnIndex + i ] = rPolygon.GetPoint( nPoints - i - 1 ); + maFlags[ mnIndex + i ] = rPolygon.GetFlags( nPoints - i - 1 ); } } else { for ( sal_uInt16 i = 0; i < nPoints; i++ ) { - mpPoints[ mnIndex + i ] = rPolygon.GetPoint( i ); - mpFlags[ mnIndex + i ] = rPolygon.GetFlags( i ); + maPoints[ mnIndex + i ] = rPolygon.GetPoint( i ); + maFlags[ mnIndex + i ] = rPolygon.GetFlags( i ); } } mnIndex = mnIndex + nPoints; diff --git a/filter/source/graphicfilter/icgm/outact.hxx b/filter/source/graphicfilter/icgm/outact.hxx index a83d3b199635..8b8b62f61ccc 100644 --- a/filter/source/graphicfilter/icgm/outact.hxx +++ b/filter/source/graphicfilter/icgm/outact.hxx @@ -46,8 +46,8 @@ class CGMImpressOutAct sal_uInt32* mpGroupLevel; sal_uInt16 mnIndex; // figure - PolyFlags* mpFlags; - Point* mpPoints; + std::vector<PolyFlags> maFlags; + std::vector<Point> maPoints; tools::PolyPolygon maPolyPolygon; css::awt::Gradient* mpGradient; |