diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-26 14:11:43 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-28 09:47:20 +0200 |
commit | 81cf79d1af42fc9fb1f5500bcc3f55cce1548bab (patch) | |
tree | 22a0d066f369e57889c3e64bb0593b6a88e0061c /sw | |
parent | 36fca319d8c49147f0362a61956138e9c5292ed3 (diff) |
loplugin:useuniqueptr in SwTable::NewInsertCol
Change-Id: If22b13087ab193ed37ca092c2b252579d5ac5d0e
Reviewed-on: https://gerrit.libreoffice.org/61003
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/table/swnewtable.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx index e9398fd42414..f407a0eec839 100644 --- a/sw/source/core/table/swnewtable.cxx +++ b/sw/source/core/table/swnewtable.cxx @@ -734,10 +734,10 @@ bool SwTable::NewInsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, nLastRowSpan = nRowSpan; } const SvxBoxItem& aSelBoxItem = pBoxFrameFormat->GetBox(); - SvxBoxItem* pNoRightBorder = nullptr; + std::unique_ptr<SvxBoxItem> pNoRightBorder; if( aSelBoxItem.GetRight() ) { - pNoRightBorder = new SvxBoxItem( aSelBoxItem ); + pNoRightBorder.reset( new SvxBoxItem( aSelBoxItem )); pNoRightBorder->SetLine( nullptr, SvxBoxItemLine::RIGHT ); } for( sal_uInt16 j = 0; j < nCnt; ++j ) @@ -762,7 +762,6 @@ bool SwTable::NewInsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, SwFrameFormat* pFrameFormat = pBox->ClaimFrameFormat(); pFrameFormat->SetFormatAttr( *pNoRightBorder ); } - delete pNoRightBorder; } aFndBox.MakeFrames( *this ); |