diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-01 10:52:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-05 07:32:50 +0100 |
commit | 7d782a4b8b70a8846f78d71632f679f80f9208a5 (patch) | |
tree | 5903f1422f0b14012ee935f529267e90af6ae0b2 /lotuswordpro | |
parent | 9a3e2ce7e0fc87d3ef3e05144460540e3b0d0075 (diff) |
loplugin:useuniqueptr in LwpSpacingOverride
Change-Id: I1f71c1e35c49b99c9fde1fe43fc9f5717158355e
Reviewed-on: https://gerrit.libreoffice.org/50737
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/inc/lwpoverride.hxx | 16 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwpoverride.cxx | 16 |
2 files changed, 12 insertions, 20 deletions
diff --git a/lotuswordpro/inc/lwpoverride.hxx b/lotuswordpro/inc/lwpoverride.hxx index c5f616a15dad..19d059616b87 100644 --- a/lotuswordpro/inc/lwpoverride.hxx +++ b/lotuswordpro/inc/lwpoverride.hxx @@ -356,19 +356,19 @@ public: void Override(LwpSpacingOverride* other); - LwpSpacingCommonOverride* GetSpacing(){return m_pSpacing;} - LwpSpacingCommonOverride* GetAboveLineSpacing(){return m_pAboveLineSpacing;} - LwpSpacingCommonOverride* GetAboveSpacing(){return m_pParaSpacingAbove;} - LwpSpacingCommonOverride* GetBelowSpacing(){return m_pParaSpacingBelow;} + LwpSpacingCommonOverride* GetSpacing(){return m_pSpacing.get();} + LwpSpacingCommonOverride* GetAboveLineSpacing(){return m_pAboveLineSpacing.get();} + LwpSpacingCommonOverride* GetAboveSpacing(){return m_pParaSpacingAbove.get();} + LwpSpacingCommonOverride* GetBelowSpacing(){return m_pParaSpacingBelow.get();} private: LwpSpacingOverride(LwpSpacingOverride const& rOther); LwpSpacingOverride& operator=(LwpSpacingOverride const& rOther) = delete; - LwpSpacingCommonOverride* m_pSpacing; - LwpSpacingCommonOverride* m_pAboveLineSpacing; - LwpSpacingCommonOverride* m_pParaSpacingAbove; - LwpSpacingCommonOverride* m_pParaSpacingBelow; + std::unique_ptr<LwpSpacingCommonOverride> m_pSpacing; + std::unique_ptr<LwpSpacingCommonOverride> m_pAboveLineSpacing; + std::unique_ptr<LwpSpacingCommonOverride> m_pParaSpacingAbove; + std::unique_ptr<LwpSpacingCommonOverride> m_pParaSpacingBelow; }; class LwpIndentOverride final : public LwpOverride diff --git a/lotuswordpro/source/filter/lwpoverride.cxx b/lotuswordpro/source/filter/lwpoverride.cxx index 5c4a1002aebc..fff586d6f4f9 100644 --- a/lotuswordpro/source/filter/lwpoverride.cxx +++ b/lotuswordpro/source/filter/lwpoverride.cxx @@ -359,10 +359,6 @@ m_pParaSpacingBelow(new LwpSpacingCommonOverride) LwpSpacingOverride::~LwpSpacingOverride() { - delete m_pSpacing; - delete m_pAboveLineSpacing; - delete m_pParaSpacingAbove; - delete m_pParaSpacingBelow; } LwpSpacingOverride::LwpSpacingOverride(LwpSpacingOverride const& rOther) @@ -372,14 +368,10 @@ LwpSpacingOverride::LwpSpacingOverride(LwpSpacingOverride const& rOther) , m_pParaSpacingAbove(nullptr) , m_pParaSpacingBelow(nullptr) { - std::unique_ptr<LwpSpacingCommonOverride> pSpacing(::clone(rOther.m_pSpacing)); - std::unique_ptr<LwpSpacingCommonOverride> pAboveLineSpacing(::clone(rOther.m_pAboveLineSpacing)); - std::unique_ptr<LwpSpacingCommonOverride> pParaSpacingAbove(::clone(rOther.m_pParaSpacingAbove)); - std::unique_ptr<LwpSpacingCommonOverride> pParaSpacingBelow(::clone(rOther.m_pParaSpacingBelow)); - m_pSpacing = pSpacing.release(); - m_pAboveLineSpacing = pAboveLineSpacing.release(); - m_pParaSpacingAbove = pParaSpacingAbove.release(); - m_pParaSpacingBelow = pParaSpacingBelow.release(); + m_pSpacing.reset( ::clone(rOther.m_pSpacing.get()) ); + m_pAboveLineSpacing.reset( ::clone(rOther.m_pAboveLineSpacing.get()) ); + m_pParaSpacingAbove.reset( ::clone(rOther.m_pParaSpacingAbove.get()) ); + m_pParaSpacingBelow.reset( ::clone(rOther.m_pParaSpacingBelow.get()) ); } LwpSpacingOverride* LwpSpacingOverride::clone() const |