diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-14 10:43:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-15 06:57:58 +0100 |
commit | 11f85d828a16b1beee5c476bd4d8d21c3e450592 (patch) | |
tree | 03adbd6630f76ee2199a33b2e935f75b9dea8198 /sw/source/filter/ww8/ww8par6.cxx | |
parent | 9c6cd998aeb7061f38ec1334e160d002008dd66b (diff) |
use unique_ptr in SwWW8ImplReader::ConstructApo
Change-Id: I104168fbbd04f81d500bc9d63d4328aee0a11f24
Reviewed-on: https://gerrit.libreoffice.org/66318
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/ww8/ww8par6.cxx')
-rw-r--r-- | sw/source/filter/ww8/ww8par6.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index a178f5c788d0..2b12c2619a1b 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -2364,14 +2364,13 @@ SwTwips SwWW8ImplReader::MoveOutsideFly(SwFrameFormat *pFlyFormat, return nRetWidth; } -WW8FlyPara *SwWW8ImplReader::ConstructApo(const ApoTestResults &rApo, +std::unique_ptr<WW8FlyPara> SwWW8ImplReader::ConstructApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos) { - WW8FlyPara *pRet = nullptr; OSL_ENSURE(rApo.HasFrame() || pTabPos, "If no frame found, *MUST* be in a table"); - pRet = new WW8FlyPara(m_bVer67, rApo.mpStyleApo); + std::unique_ptr<WW8FlyPara> pRet(new WW8FlyPara(m_bVer67, rApo.mpStyleApo)); // find APO parameter and test for bGrafApo if (rApo.HasFrame()) @@ -2381,8 +2380,7 @@ WW8FlyPara *SwWW8ImplReader::ConstructApo(const ApoTestResults &rApo, if (pRet->IsEmpty()) { - delete pRet; - pRet = nullptr; + pRet.reset(); } return pRet; } @@ -2418,7 +2416,7 @@ bool SwWW8ImplReader::IsDropCap() bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos) { - m_xWFlyPara.reset(ConstructApo(rApo, pTabPos)); + m_xWFlyPara = ConstructApo(rApo, pTabPos); if (!m_xWFlyPara) return false; |