diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-01 10:25:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-05 07:30:24 +0100 |
commit | c8ea4b910b9d96dc27163909237e3ba668027cd3 (patch) | |
tree | a670c9b850c542993706e1b3d2d7c7ef8f418740 /lotuswordpro | |
parent | 4eca66541bbe77767f29138f6d0265229d61173d (diff) |
loplugin:useuniqueptr in LwpCharacterBorderOverride
Change-Id: I449c8739f3df112062b2bd52a72469eb1faf22fc
Reviewed-on: https://gerrit.libreoffice.org/50717
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwpcharborderoverride.cxx | 10 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwpcharborderoverride.hxx | 4 |
2 files changed, 6 insertions, 8 deletions
diff --git a/lotuswordpro/source/filter/lwpcharborderoverride.cxx b/lotuswordpro/source/filter/lwpcharborderoverride.cxx index e8dabf5c0d64..fdd0736d9ea9 100644 --- a/lotuswordpro/source/filter/lwpcharborderoverride.cxx +++ b/lotuswordpro/source/filter/lwpcharborderoverride.cxx @@ -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 diff --git a/lotuswordpro/source/filter/lwpcharborderoverride.hxx b/lotuswordpro/source/filter/lwpcharborderoverride.hxx index 132e9b2b95b0..478ceed456d8 100644 --- a/lotuswordpro/source/filter/lwpcharborderoverride.hxx +++ b/lotuswordpro/source/filter/lwpcharborderoverride.hxx @@ -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; |