summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-30 13:47:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-31 07:33:40 +0100
commit2a8f860a7199585ad8ae61cfacdc39f2ac3afdb8 (patch)
treead5103186c2f975fc2064162ba862f61a87edf62 /filter
parent7b8e5bbfb5819ee6fec544792c14e91bc6075d29 (diff)
loplugin:useuniqueptr in PPTTextObj::PPTTextObj
Change-Id: Ib150ecf2dbcc0e3be1d7b1d4daba6065605597ee Reviewed-on: https://gerrit.libreoffice.org/62660 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/msfilter/svdfppt.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 581788294902..ac8728cd424f 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -6730,7 +6730,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
// now will search for possible textextensions such as date/time fields
// or ParaTabStops and append them on this textobj
rIn.Seek( nFilePos );
- ::std::vector< PPTFieldEntry* > FieldList;
+ ::std::vector< std::unique_ptr<PPTFieldEntry> > FieldList;
auto nEndRecPos = DffPropSet::SanitizeEndPos(rIn, aClientTextBoxHd.GetRecEndFilePos());
while (rIn.Tell() < nEndRecPos)
{
@@ -6906,22 +6906,22 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
if (xEntry)
{
// sorting fields ( hi >> lo )
- ::std::vector< PPTFieldEntry* >::iterator it = FieldList.begin();
+ auto it = FieldList.begin();
for( ; it != FieldList.end(); ++it ) {
if ( (*it)->nPos < xEntry->nPos ) {
break;
}
}
if ( it != FieldList.end() ) {
- FieldList.insert(it, xEntry.release());
+ FieldList.insert(it, std::move(xEntry));
} else {
- FieldList.push_back(xEntry.release());
+ FieldList.push_back( std::move(xEntry));
}
}
}
if ( !FieldList.empty() )
{
- ::std::vector< PPTFieldEntry* >::iterator FE = FieldList.begin();
+ auto FE = FieldList.begin();
auto& aCharPropList = aStyleTextPropReader.aCharPropList;
sal_Int32 i = nParagraphs - 1;
@@ -7068,9 +7068,6 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
}
n--;
}
- for(PPTFieldEntry* j : FieldList) {
- delete j;
- }
}
mxImplTextObj->maParagraphList.resize( nParagraphs );
for (size_t nCurCharPos = 0, nCurPos = 0;