Kaydet (Commit) 202aba9a authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in XFHeaderStyle

Change-Id: Id1e29fde9d6dfcd3c816967272c80ace85d515cc
Reviewed-on: https://gerrit.libreoffice.org/50750Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst c0c42c56
......@@ -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;
};
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment