Kaydet (Commit) 5ee24060 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in XFFrameStyle

Change-Id: I812c9fc7ab297e962994265e69feb80f82adc49a
Reviewed-on: https://gerrit.libreoffice.org/50752Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 8683fbd3
......@@ -66,6 +66,7 @@
#include <xfilter/xfmargins.hxx>
#include <xfilter/xfcolor.hxx>
#include <xfilter/xfpadding.hxx>
#include <memory>
class XFBorders;
class XFColumns;
......@@ -151,10 +152,10 @@ protected:
enumXFWrap m_eWrap;
XFPadding m_aPad;
XFMargins m_aMargins;
XFBorders *m_pBorders;
XFColumns *m_pColumns;
XFShadow *m_pShadow;
XFBGImage *m_pBGImage;
std::unique_ptr<XFBorders> m_pBorders;
std::unique_ptr<XFColumns> m_pColumns;
std::unique_ptr<XFShadow> m_pShadow;
std::unique_ptr<XFBGImage> m_pBGImage;
XFColor m_aBackColor;
bool m_bProtectContent;
bool m_bProtectSize;
......
......@@ -65,10 +65,6 @@
XFFrameStyle::XFFrameStyle()
: m_eWrap(enumXFWrapNone)
, m_pBorders(nullptr)
, m_pColumns(nullptr)
, m_pShadow(nullptr)
, m_pBGImage(nullptr)
, m_bProtectContent(false)
, m_bProtectSize(false)
, m_bProtectPos(false)
......@@ -82,34 +78,26 @@ XFFrameStyle::XFFrameStyle()
XFFrameStyle::~XFFrameStyle()
{
delete m_pBorders;
delete m_pColumns;
delete m_pShadow;
delete m_pBGImage;
}
void XFFrameStyle::SetBorders(XFBorders *pBorders)
{
delete m_pBorders;
m_pBorders = pBorders;
m_pBorders.reset(pBorders);
}
void XFFrameStyle::SetColumns(XFColumns *pColumns)
{
delete m_pColumns;
m_pColumns = pColumns;
m_pColumns.reset(pColumns);
}
void XFFrameStyle::SetShadow(XFShadow *pShadow)
{
delete m_pShadow;
m_pShadow = pShadow;
m_pShadow.reset(pShadow);
}
void XFFrameStyle::SetBackImage(XFBGImage *image)
{
delete m_pBGImage;
m_pBGImage = image;
m_pBGImage.reset(image);
}
enumXFStyle XFFrameStyle::GetStyleFamily()
......
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