summaryrefslogtreecommitdiff
path: root/lotuswordpro/source/filter/xfilter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-01 11:35:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-05 07:34:19 +0100
commit8683fbd30161ef9b7e6f28be339a63b092698896 (patch)
tree178c734f115c554d597eab265974290ea5c3de2b /lotuswordpro/source/filter/xfilter
parent202aba9a07610b0f70e4daa13a2629f31dc29b62 (diff)
loplugin:useuniqueptr in XFParaStyle
Change-Id: I883c54698022d07dbcb72e66b1108178cf27a5ae Reviewed-on: https://gerrit.libreoffice.org/50751 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lotuswordpro/source/filter/xfilter')
-rw-r--r--lotuswordpro/source/filter/xfilter/xfparastyle.cxx26
1 files changed, 9 insertions, 17 deletions
diff --git a/lotuswordpro/source/filter/xfilter/xfparastyle.cxx b/lotuswordpro/source/filter/xfilter/xfparastyle.cxx
index 97ac01022f80..9336e5374c55 100644
--- a/lotuswordpro/source/filter/xfilter/xfparastyle.cxx
+++ b/lotuswordpro/source/filter/xfilter/xfparastyle.cxx
@@ -104,14 +104,10 @@ XFParaStyle::XFParaStyle(const XFParaStyle& other)
, m_bNumberRight(other.m_bNumberRight)
{
if( other.m_pBorders )
- m_pBorders = new XFBorders(*other.m_pBorders);
- else
- m_pBorders = nullptr;
+ m_pBorders.reset( new XFBorders(*other.m_pBorders) );
if( other.m_pBGImage )
- m_pBGImage = new XFBGImage(*other.m_pBGImage);
- else
- m_pBGImage = nullptr;
+ m_pBGImage.reset( new XFBGImage(*other.m_pBGImage) );
for (size_t i = 0; i < other.m_aTabs.GetCount(); ++i)
{
@@ -134,7 +130,7 @@ XFParaStyle& XFParaStyle::operator=(const XFParaStyle& other)
if (this != &other)
{
// first , clean member
- delete m_pBGImage;
+ m_pBGImage.reset();
m_aTabs.Reset();
m_strParentStyleName = other.m_strParentStyleName;
@@ -151,14 +147,14 @@ XFParaStyle& XFParaStyle::operator=(const XFParaStyle& other)
m_pFont = other.m_pFont;
if( other.m_pBorders )
- m_pBorders = new XFBorders(*other.m_pBorders);
+ m_pBorders.reset( new XFBorders(*other.m_pBorders) );
else
- m_pBorders = nullptr;
+ m_pBorders.reset();
m_aBackColor = other.m_aBackColor;
if( other.m_pBGImage )
- m_pBGImage = new XFBGImage(*other.m_pBGImage);
+ m_pBGImage.reset( new XFBGImage(*other.m_pBGImage) );
else
- m_pBGImage = nullptr;
+ m_pBGImage.reset();
m_aShadow = other.m_aShadow;
m_aMargin = other.m_aMargin;
@@ -186,8 +182,6 @@ XFParaStyle& XFParaStyle::operator=(const XFParaStyle& other)
XFParaStyle::~XFParaStyle()
{
- delete m_pBorders;
- delete m_pBGImage;
}
enumXFStyle XFParaStyle::GetStyleFamily()
@@ -232,14 +226,12 @@ void XFParaStyle::SetBackColor(XFColor const & color)
void XFParaStyle::SetBackImage(XFBGImage *image)
{
- delete m_pBGImage;
- m_pBGImage = image;
+ m_pBGImage.reset( image );
}
void XFParaStyle::SetBorders(XFBorders *pBorders)
{
- delete m_pBorders;
- m_pBorders = pBorders;
+ m_pBorders.reset( pBorders );
}
void XFParaStyle::SetDropCap(sal_Int16 nLength,