diff --git a/lotuswordpro/inc/xfilter/xfframestyle.hxx b/lotuswordpro/inc/xfilter/xfframestyle.hxx index 11db8a900896..6fa40fe0bca0 100644 --- a/lotuswordpro/inc/xfilter/xfframestyle.hxx +++ b/lotuswordpro/inc/xfilter/xfframestyle.hxx @@ -66,6 +66,7 @@ #include #include #include +#include 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 m_pBorders; + std::unique_ptr m_pColumns; + std::unique_ptr m_pShadow; + std::unique_ptr m_pBGImage; XFColor m_aBackColor; bool m_bProtectContent; bool m_bProtectSize; diff --git a/lotuswordpro/source/filter/xfilter/xfframestyle.cxx b/lotuswordpro/source/filter/xfilter/xfframestyle.cxx index 1127633f8ae4..f40ee4651540 100644 --- a/lotuswordpro/source/filter/xfilter/xfframestyle.cxx +++ b/lotuswordpro/source/filter/xfilter/xfframestyle.cxx @@ -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()