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

loplugin:useuniqueptr in LwpCharacterBorderOverride

Change-Id: I449c8739f3df112062b2bd52a72469eb1faf22fc
Reviewed-on: https://gerrit.libreoffice.org/50717Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 4eca6654
......@@ -80,16 +80,14 @@ LwpCharacterBorderOverride::LwpCharacterBorderOverride(LwpCharacterBorderOverrid
, m_nAboveWidth(rOther.m_nAboveWidth)
, m_nBelowWidth(rOther.m_nBelowWidth)
{
std::unique_ptr<LwpBorderStuff> pBorderStuff(::clone(rOther.m_pBorderStuff));
std::unique_ptr<LwpMargins> pMargins(::clone(rOther.m_pMargins));
m_pBorderStuff = pBorderStuff.release();
m_pMargins = pMargins.release();
std::unique_ptr<LwpBorderStuff> pBorderStuff(::clone(rOther.m_pBorderStuff.get()));
std::unique_ptr<LwpMargins> pMargins(::clone(rOther.m_pMargins.get()));
m_pBorderStuff = std::move(pBorderStuff);
m_pMargins = std::move(pMargins);
}
LwpCharacterBorderOverride::~LwpCharacterBorderOverride()
{
delete m_pBorderStuff;
delete m_pMargins;
}
LwpCharacterBorderOverride* LwpCharacterBorderOverride::clone() const
......
......@@ -80,8 +80,8 @@ private:
LwpCharacterBorderOverride(LwpCharacterBorderOverride const& rOther);
LwpCharacterBorderOverride& operator=(LwpCharacterBorderOverride const& rOther) = delete;
LwpBorderStuff* m_pBorderStuff;
LwpMargins* m_pMargins;
std::unique_ptr<LwpBorderStuff> m_pBorderStuff;
std::unique_ptr<LwpMargins> m_pMargins;
sal_Int32 m_nAboveWidth;
sal_Int32 m_nBelowWidth;
......
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