[Libreoffice-commits] core.git: lotuswordpro/source

Noel Grandin noel.grandin at collabora.co.uk
Mon Mar 5 06:30:47 UTC 2018


 lotuswordpro/source/filter/lwpcharborderoverride.cxx |   10 ++++------
 lotuswordpro/source/filter/lwpcharborderoverride.hxx |    4 ++--
 2 files changed, 6 insertions(+), 8 deletions(-)

New commits:
commit c8ea4b910b9d96dc27163909237e3ba668027cd3
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Mar 1 10:25:06 2018 +0200

    loplugin:useuniqueptr in LwpCharacterBorderOverride
    
    Change-Id: I449c8739f3df112062b2bd52a72469eb1faf22fc
    Reviewed-on: https://gerrit.libreoffice.org/50717
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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;
 


More information about the Libreoffice-commits mailing list