diff options
-rw-r--r-- | lotuswordpro/source/filter/lwppiece.hxx | 26 |
1 files changed, 12 insertions, 14 deletions
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: |