summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-04-08 21:56:50 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-04-09 18:34:26 +0200
commit7cd4b5912363de89c6ded921b6b5940493afc1cf (patch)
treea1558cc5f6bcc44c3f460757466b20569f67d352 /vcl
parent12ed6ad7a0efb55c9b527e6193080426fb8e64f9 (diff)
std::unique[]->std::vector
Change-Id: If1b66f273e412f2206274a903a06bee90a2a6c91 Reviewed-on: https://gerrit.libreoffice.org/36307 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/filter/wmf/enhwmf.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx
index de15d4e6ed7c..02776fa83997 100644
--- a/vcl/source/filter/wmf/enhwmf.cxx
+++ b/vcl/source/filter/wmf/enhwmf.cxx
@@ -603,12 +603,12 @@ void EnhWMFReader::ReadAndDrawPolyPolygon()
return;
// Get number of points in each polygon
- std::unique_ptr<sal_uInt16[]> pnPoints(new sal_uInt16[ nPoly ]);
+ std::vector<sal_uInt16> aPoints(nPoly);
for (sal_uInt32 i = 0; i < nPoly && pWMF->good(); ++i)
{
sal_uInt32 nPoints(0);
pWMF->ReadUInt32( nPoints );
- pnPoints[ i ] = (sal_uInt16)nPoints;
+ aPoints[i] = (sal_uInt16)nPoints;
}
if ( pWMF->good() && ( nGesPoints * (sizeof(T)+sizeof(T)) ) <= ( nEndPos - pWMF->Tell() ) )
{
@@ -616,20 +616,20 @@ void EnhWMFReader::ReadAndDrawPolyPolygon()
tools::PolyPolygon aPolyPoly(nPoly, nPoly);
for (sal_uInt32 i = 0; i < nPoly && pWMF->good(); ++i)
{
- const sal_uInt16 nPointCount(pnPoints[i]);
- std::unique_ptr<Point[]> pPtAry(new Point[nPointCount]);
+ const sal_uInt16 nPointCount(aPoints[i]);
+ std::vector<Point> aPtAry(nPointCount);
for (sal_uInt16 j = 0; j < nPointCount && pWMF->good(); ++j)
{
T nX(0), nY(0);
*pWMF >> nX >> nY;
- pPtAry[ j ] = Point( nX, nY );
+ aPtAry[j] = Point( nX, nY );
++nReadPoints;
}
- aPolyPoly.Insert( tools::Polygon(nPointCount, pPtAry.get()) );
+ aPolyPoly.Insert(tools::Polygon(aPtAry.size(), aPtAry.data()));
}
- pOut->DrawPolyPolygon( aPolyPoly, bRecordPath );
+ pOut->DrawPolyPolygon(aPolyPoly, bRecordPath);
}
OSL_ENSURE(nReadPoints == nGesPoints, "The number Points processed from EMR_POLYPOLYGON is unequal imported number (!)");