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

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


 lotuswordpro/source/filter/lwppiece.hxx |   26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

New commits:
commit 6eab752bdf7c8f9c743d20fed29fd60cb4e241f6
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Mar 1 10:26:52 2018 +0200

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

diff --git a/lotuswordpro/source/filter/lwppiece.hxx b/lotuswordpro/source/filter/lwppiece.hxx
index 1ca1bcdd4848..1aaa7453d272 100644
--- a/lotuswordpro/source/filter/lwppiece.hxx
+++ b/lotuswordpro/source/filter/lwppiece.hxx
@@ -92,16 +92,14 @@ public:
 
     LwpOverride* GetOverride()
     {
-        return m_pOverride;
+        return m_pOverride.get();
     }
 protected:
     virtual ~LwpVirtualPiece() override
     {
-        if( m_pOverride )
-            delete m_pOverride;
     }
 
-    LwpOverride     *m_pOverride;
+    std::unique_ptr<LwpOverride>  m_pOverride;
 };
 
 class LwpParaBorderPiece : public LwpVirtualPiece
@@ -109,7 +107,7 @@ class LwpParaBorderPiece : public LwpVirtualPiece
 public:
     LwpParaBorderPiece(LwpObjectHeader const & objHdr, LwpSvStream* pStrm):LwpVirtualPiece(objHdr, pStrm)
     {
-        m_pOverride = new LwpParaBorderOverride();
+        m_pOverride.reset(new LwpParaBorderOverride());
     }
 
 private:
@@ -121,7 +119,7 @@ class LwpBreaksPiece : public LwpVirtualPiece
 public:
     LwpBreaksPiece(LwpObjectHeader const & objHdr, LwpSvStream* pStrm):LwpVirtualPiece(objHdr, pStrm)
     {
-        m_pOverride = new LwpBreaksOverride();
+        m_pOverride.reset(new LwpBreaksOverride());
     }
 
 private:
@@ -133,7 +131,7 @@ class LwpNumberingPiece : public LwpVirtualPiece
 public:
     LwpNumberingPiece(LwpObjectHeader const & objHdr, LwpSvStream* pStrm):LwpVirtualPiece(objHdr, pStrm)
     {
-        m_pOverride = new LwpNumberingOverride();
+        m_pOverride.reset(new LwpNumberingOverride());
     }
 
 private:
@@ -145,7 +143,7 @@ class LwpTabPiece : public LwpVirtualPiece
 public:
     LwpTabPiece(LwpObjectHeader const & objHdr, LwpSvStream* pStrm):LwpVirtualPiece(objHdr, pStrm)
     {
-        m_pOverride = new LwpTabOverride();
+        m_pOverride.reset(new LwpTabOverride());
     }
 
 private:
@@ -157,7 +155,7 @@ class LwpBackgroundPiece : public LwpVirtualPiece
 public:
     LwpBackgroundPiece(LwpObjectHeader const & objHdr, LwpSvStream* pStrm):LwpVirtualPiece(objHdr, pStrm)
     {
-        m_pOverride = new LwpBackgroundOverride();
+        m_pOverride.reset(new LwpBackgroundOverride());
     }
 
 private:
@@ -169,7 +167,7 @@ class LwpAlignmentPiece : public LwpVirtualPiece
 public:
     LwpAlignmentPiece(LwpObjectHeader const & objHdr, LwpSvStream* pStrm):LwpVirtualPiece(objHdr, pStrm)
     {
-        m_pOverride = new LwpAlignmentOverride();
+        m_pOverride.reset(new LwpAlignmentOverride());
     }
 
 private:
@@ -181,7 +179,7 @@ class LwpIndentPiece : public LwpVirtualPiece
 public:
     LwpIndentPiece(LwpObjectHeader const & objHdr, LwpSvStream* pStrm):LwpVirtualPiece(objHdr, pStrm)
     {
-        m_pOverride = new LwpIndentOverride();
+        m_pOverride.reset(new LwpIndentOverride());
     }
 
 private:
@@ -193,7 +191,7 @@ class LwpSpacingPiece : public LwpVirtualPiece
 public:
     LwpSpacingPiece(LwpObjectHeader const & objHdr, LwpSvStream* pStrm):LwpVirtualPiece(objHdr, pStrm)
     {
-        m_pOverride = new LwpSpacingOverride();
+        m_pOverride.reset(new LwpSpacingOverride());
     }
 
 private:
@@ -205,7 +203,7 @@ class LwpAmikakePiece : public LwpVirtualPiece
 public:
     LwpAmikakePiece(LwpObjectHeader const & objHdr, LwpSvStream* pStrm):LwpVirtualPiece(objHdr, pStrm)
     {
-        m_pOverride = new LwpAmikakeOverride();
+        m_pOverride.reset(new LwpAmikakeOverride());
     }
 
 private:
@@ -217,7 +215,7 @@ class LwpCharacterBorderPiece : public LwpVirtualPiece
 public:
     LwpCharacterBorderPiece(LwpObjectHeader const & objHdr, LwpSvStream* pStrm):LwpVirtualPiece(objHdr, pStrm)
     {
-        m_pOverride = new LwpCharacterBorderOverride();
+        m_pOverride.reset(new LwpCharacterBorderOverride());
     }
 
 private:


More information about the Libreoffice-commits mailing list