diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-01 11:20:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-05 07:34:08 +0100 |
commit | 202aba9a07610b0f70e4daa13a2629f31dc29b62 (patch) | |
tree | 0d6202be303786cc2d85e93baac38d983e947c38 | |
parent | c0c42c56159d1d1185702cb0c400e460727dc168 (diff) |
loplugin:useuniqueptr in XFHeaderStyle
Change-Id: Id1e29fde9d6dfcd3c816967272c80ace85d515cc
Reviewed-on: https://gerrit.libreoffice.org/50750
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | lotuswordpro/inc/xfilter/xfheaderstyle.hxx | 7 | ||||
-rw-r--r-- | lotuswordpro/source/filter/xfilter/xfheaderstyle.cxx | 18 |
2 files changed, 9 insertions, 16 deletions
diff --git a/lotuswordpro/inc/xfilter/xfheaderstyle.hxx b/lotuswordpro/inc/xfilter/xfheaderstyle.hxx index 16795bcf56d1..3207694bcb51 100644 --- a/lotuswordpro/inc/xfilter/xfheaderstyle.hxx +++ b/lotuswordpro/inc/xfilter/xfheaderstyle.hxx @@ -65,6 +65,7 @@ #include <xfilter/xfborders.hxx> #include <xfilter/xfpadding.hxx> #include <xfilter/xfshadow.hxx> +#include <memory> /** * @brief @@ -124,10 +125,10 @@ protected: double m_fHeight; double m_fMinHeight; XFMargins m_aMargin; - XFShadow* m_pShadow; + std::unique_ptr<XFShadow> m_pShadow; XFPadding m_aPadding; - XFBorders *m_pBorders; - XFBGImage *m_pBGImage; + std::unique_ptr<XFBorders> m_pBorders; + std::unique_ptr<XFBGImage> m_pBGImage; XFColor m_aBackColor; }; diff --git a/lotuswordpro/source/filter/xfilter/xfheaderstyle.cxx b/lotuswordpro/source/filter/xfilter/xfheaderstyle.cxx index 29ad6cf4566e..d2afc95ecc67 100644 --- a/lotuswordpro/source/filter/xfilter/xfheaderstyle.cxx +++ b/lotuswordpro/source/filter/xfilter/xfheaderstyle.cxx @@ -66,16 +66,10 @@ XFHeaderStyle::XFHeaderStyle(bool isFooter) m_bDynamicSpace = true; m_fHeight = -1; m_fMinHeight = -1; - m_pBorders = nullptr; - m_pShadow = nullptr; - m_pBGImage = nullptr; } XFHeaderStyle::~XFHeaderStyle() { - delete m_pBorders; - delete m_pBGImage; - delete m_pShadow; } void XFHeaderStyle::SetMargins(double left, double right, double bottom) @@ -104,21 +98,19 @@ void XFHeaderStyle::SetMinHeight(double minHeight) void XFHeaderStyle::SetShadow(XFShadow *pShadow) { - if( m_pShadow && (pShadow != m_pShadow) ) - delete m_pShadow; - m_pShadow = pShadow; + if( pShadow == m_pShadow.get() ) + return; + m_pShadow.reset( pShadow ); } void XFHeaderStyle::SetBorders(XFBorders *pBorders) { - delete m_pBorders; - m_pBorders = pBorders; + m_pBorders.reset(pBorders); } void XFHeaderStyle::SetBackImage(XFBGImage *image) { - delete m_pBGImage; - m_pBGImage = image; + m_pBGImage.reset( image ); } void XFHeaderStyle::SetBackColor(XFColor color) |