summaryrefslogtreecommitdiffstats
path: root/hwpfilter/source/hwpread.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-11-15 16:23:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-11-16 07:55:00 +0100
commit121303615054568c204def97872343d2014af4a0 (patch)
tree233ba5de1ddb4d890310d0648c31b13a1c561f00 /hwpfilter/source/hwpread.cxx
parentuse implict conversion operator in TypedWhichId (diff)
downloadcore-121303615054568c204def97872343d2014af4a0.tar.gz
core-121303615054568c204def97872343d2014af4a0.zip
loplugin:useuniqueptr in hwpfilter
Change-Id: If6e8dfcec2842a329229e5c57417ca3f00ef74b3 Reviewed-on: https://gerrit.libreoffice.org/44763 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'hwpfilter/source/hwpread.cxx')
-rw-r--r--hwpfilter/source/hwpread.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx
index 46f278574da9..149c4f239301 100644
--- a/hwpfilter/source/hwpread.cxx
+++ b/hwpfilter/source/hwpread.cxx
@@ -311,7 +311,7 @@ bool TxtBox::Read(HWPFile & hwpf)
if (!pArr) {
return hwpf.SetState(HWP_InvalidFileFormat);
}
- Table *tbl = new Table;
+ std::unique_ptr<Table> tbl(new Table);
for( ii = 0 ; ii < ncell; ii++)
{
tbl->columns.insert(cell[ii].x);
@@ -351,11 +351,11 @@ bool TxtBox::Read(HWPFile & hwpf)
}
}
for( ii = 0 ; ii < ncell ; ii++ ){
- tbl->cells.push_back(pArr[ii]);
+ tbl->cells.emplace_back(pArr[ii]);
}
tbl->box = this;
- hwpf.AddTable(tbl);
- m_pTable = tbl;
+ m_pTable = tbl.get();
+ hwpf.AddTable(std::move(tbl));
delete[] pArr;
}
else