summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-08-03 15:56:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-06 08:49:07 +0200
commitfa0f81614f456ed61a73dd3c8b7d1a534badfff5 (patch)
tree9de0ca95f83215e3475a2f465f9517072d2b1943 /sw
parent63d9e2dd97f18ed70b1fd1e8094ff5f74e63f520 (diff)
loplugin:useuniqueptr in WW8PLCFx_FactoidBook
Change-Id: I1ae19c5d0673be4bbc9786539f1e1996e4b4784c Reviewed-on: https://gerrit.libreoffice.org/58571 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx7
-rw-r--r--sw/source/filter/ww8/ww8scan.hxx2
2 files changed, 3 insertions, 6 deletions
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 50d1438093f1..0a022fba94d2 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -4668,13 +4668,12 @@ WW8PLCFx_FactoidBook::WW8PLCFx_FactoidBook(SvStream* pTableSt, const WW8Fib& rFi
{
if (!rFib.m_fcPlcfBkfFactoid || !rFib.m_lcbPlcfBkfFactoid || !rFib.m_fcPlcfBklFactoid || !rFib.m_lcbPlcfBklFactoid)
{
- m_pBook[0] = m_pBook[1] = nullptr;
m_nIMax = 0;
}
else
{
- m_pBook[0] = new WW8PLCFspecial(pTableSt, rFib.m_fcPlcfBkfFactoid, rFib.m_lcbPlcfBkfFactoid, 6);
- m_pBook[1] = new WW8PLCFspecial(pTableSt, rFib.m_fcPlcfBklFactoid, rFib.m_lcbPlcfBklFactoid, 4);
+ m_pBook[0].reset(new WW8PLCFspecial(pTableSt, rFib.m_fcPlcfBkfFactoid, rFib.m_lcbPlcfBkfFactoid, 6));
+ m_pBook[1].reset(new WW8PLCFspecial(pTableSt, rFib.m_fcPlcfBklFactoid, rFib.m_lcbPlcfBklFactoid, 4));
m_nIMax = m_pBook[0]->GetIMax();
if (m_pBook[1]->GetIMax() < m_nIMax)
@@ -4684,8 +4683,6 @@ WW8PLCFx_FactoidBook::WW8PLCFx_FactoidBook(SvStream* pTableSt, const WW8Fib& rFi
WW8PLCFx_FactoidBook::~WW8PLCFx_FactoidBook()
{
- delete m_pBook[1];
- delete m_pBook[0];
}
sal_uInt32 WW8PLCFx_FactoidBook::GetIdx() const
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index 9d371a867879..779828794cc8 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -820,7 +820,7 @@ class WW8PLCFx_FactoidBook : public WW8PLCFx
{
private:
/// Start and end positions.
- WW8PLCFspecial* m_pBook[2];
+ std::unique_ptr<WW8PLCFspecial> m_pBook[2];
/// Number of factoid marks
sal_Int32 m_nIMax;
bool m_bIsEnd;