Kaydet (Commit) fa0f8161 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in WW8PLCFx_FactoidBook

Change-Id: I1ae19c5d0673be4bbc9786539f1e1996e4b4784c
Reviewed-on: https://gerrit.libreoffice.org/58571
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 63d9e2dd
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment