summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/paintfrm.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-01-09 15:38:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-01-11 10:20:11 +0100
commit152e2e6943adf46f12c04cf76dc435e48c1f1c74 (patch)
tree152eb4397fd1b8ab4c9f60fdb3f70392ebd25e42 /sw/source/core/layout/paintfrm.cxx
parent3d14462e233571ac8a77ab0484069e6cc944f320 (diff)
use unique_ptr in sw
Change-Id: I471875142391e537a4301dfe42beb8f8803ff46b Reviewed-on: https://gerrit.libreoffice.org/66036 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/layout/paintfrm.cxx')
-rw-r--r--sw/source/core/layout/paintfrm.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 815497059439..671916cf4194 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -6214,12 +6214,12 @@ void SwFrame::PaintSwFrameBackground( const SwRect &rRect, const SwPageFrame *pP
if ( aRect.HasArea() )
{
- SvxBrushItem* pNewItem = nullptr;
+ std::unique_ptr<SvxBrushItem> pNewItem;
if( pCol )
{
- pNewItem = new SvxBrushItem( *pCol, RES_BACKGROUND );
- pItem = pNewItem;
+ pNewItem.reset(new SvxBrushItem( *pCol, RES_BACKGROUND ));
+ pItem = pNewItem.get();
aFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(*pCol));
}
@@ -6287,8 +6287,6 @@ void SwFrame::PaintSwFrameBackground( const SwRect &rRect, const SwPageFrame *pP
bConsiderBackgroundTransparency );
}
}
- if( pCol )
- delete pNewItem;
}
}
else