summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-08-23 14:57:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-08-24 10:14:54 +0200
commit4fb9d7b69c4fb10107210c2f851040f7c259e413 (patch)
tree16bbdc777514770d4ff227d9d9c5d3eb69058248 /filter
parent66604baf08c47cc0c77ab3b9ee7e77f987c64722 (diff)
loplugin:useuniqueptr in filter
Change-Id: I127b570bb1563dc75b21633019b3640f93715d77 Reviewed-on: https://gerrit.libreoffice.org/41495 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/graphicfilter/idxf/dxf2mtf.cxx2
-rw-r--r--filter/source/graphicfilter/idxf/dxfentrd.cxx10
-rw-r--r--filter/source/graphicfilter/idxf/dxfentrd.hxx2
3 files changed, 6 insertions, 8 deletions
diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
index a30da0c25912..692151d4012b 100644
--- a/filter/source/graphicfilter/idxf/dxf2mtf.cxx
+++ b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
@@ -574,7 +574,7 @@ void DXF2GDIMetaFile::DrawHatchEntity(const DXFHatchEntity & rE, const DXFTransf
{
for ( std::deque<DXFEdgeType*>::size_type i = 0; i < rPathData.aEdges.size(); i++ )
{
- const DXFEdgeType* pEdge = rPathData.aEdges[ i ];
+ const DXFEdgeType* pEdge = rPathData.aEdges[ i ].get();
switch( pEdge->nEdgeType )
{
case 1 :
diff --git a/filter/source/graphicfilter/idxf/dxfentrd.cxx b/filter/source/graphicfilter/idxf/dxfentrd.cxx
index 8c8eb309b4c0..9995ef8270d7 100644
--- a/filter/source/graphicfilter/idxf/dxfentrd.cxx
+++ b/filter/source/graphicfilter/idxf/dxfentrd.cxx
@@ -562,8 +562,6 @@ DXFBoundaryPathData::DXFBoundaryPathData() :
DXFBoundaryPathData::~DXFBoundaryPathData()
{
- for (auto i: aEdges)
- delete i;
}
bool DXFBoundaryPathData::EvaluateGroup( DXFGroupReader & rDGR )
@@ -619,10 +617,10 @@ bool DXFBoundaryPathData::EvaluateGroup( DXFGroupReader & rDGR )
sal_Int32 nEdgeType = rDGR.GetI();
switch( nEdgeType )
{
- case 1 : aEdges.push_back( new DXFEdgeTypeLine() ); break;
- case 2 : aEdges.push_back( new DXFEdgeTypeCircularArc() ); break;
- case 3 : aEdges.push_back( new DXFEdgeTypeEllipticalArc() ); break;
- case 4 : aEdges.push_back( new DXFEdgeTypeSpline() ); break;
+ case 1 : aEdges.emplace_back( new DXFEdgeTypeLine() ); break;
+ case 2 : aEdges.emplace_back( new DXFEdgeTypeCircularArc() ); break;
+ case 3 : aEdges.emplace_back( new DXFEdgeTypeEllipticalArc() ); break;
+ case 4 : aEdges.emplace_back( new DXFEdgeTypeSpline() ); break;
}
}
else if ( aEdges.size() )
diff --git a/filter/source/graphicfilter/idxf/dxfentrd.hxx b/filter/source/graphicfilter/idxf/dxfentrd.hxx
index 85dbd32b2c5e..849ffeca6cd4 100644
--- a/filter/source/graphicfilter/idxf/dxfentrd.hxx
+++ b/filter/source/graphicfilter/idxf/dxfentrd.hxx
@@ -412,7 +412,7 @@ struct DXFBoundaryPathData
sal_Int32 nPointIndex;
std::unique_ptr<DXFVector[]> pP;
- std::deque<DXFEdgeType*> aEdges;
+ std::deque<std::unique_ptr<DXFEdgeType>> aEdges;
DXFBoundaryPathData();
~DXFBoundaryPathData();