filter/source/graphicfilter/idxf/dxf2mtf.cxx | 2 +- filter/source/graphicfilter/idxf/dxfentrd.cxx | 10 ++++------ filter/source/graphicfilter/idxf/dxfentrd.hxx | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-)
New commits: commit 4fb9d7b69c4fb10107210c2f851040f7c259e413 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Wed Aug 23 14:57:41 2017 +0200 loplugin:useuniqueptr in filter Change-Id: I127b570bb1563dc75b21633019b3640f93715d77 Reviewed-on: https://gerrit.libreoffice.org/41495 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> 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(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits