summaryrefslogtreecommitdiffstats
path: root/hwpfilter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-31 14:46:38 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2017-12-05 08:17:11 -0500
commit9ca19666511b1d44ba554a70cbbc0c8e2db844c6 (patch)
tree39a0bd694d2f1cf5d5a67082b85717e5bb2cbef0 /hwpfilter
parentconvert ScChartGlue to scoped enum (diff)
downloadcore-9ca19666511b1d44ba554a70cbbc0c8e2db844c6.tar.gz
core-9ca19666511b1d44ba554a70cbbc0c8e2db844c6.zip
loplugin:useuniqueptr extend to check local vars
just the simple and obvious case for now, of a local var being allocated and deleted inside a single local block, and the delete happening at the end of the block Reviewed-on: https://gerrit.libreoffice.org/33749 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 2489000d3fd66319a8355fd4e37cfdfda47296d0) Change-Id: I3a7a094da543debdcd2374737c2ecff91d644625 (cherry picked from commit e540ccfb5eb43bd4a3d6920074dce8436720ba8e)
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/hwpreader.cxx4
1 files changed, 1 insertions, 3 deletions
diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index 44af35646132..f72687dd2642 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -3707,12 +3707,10 @@ void HwpReader::makeFormula(TxtBox * hbox)
}
mybuf[l] = '\0';
- Formula *form = new Formula(mybuf);
+ std::unique_ptr<Formula> form( new Formula(mybuf) );
form->setDocumentHandler(m_rxDocumentHandler);
form->setAttributeListImpl(mxList.get());
form->parse();
-
- delete form;
}
/**