summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-26 14:11:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-28 09:47:20 +0200
commit81cf79d1af42fc9fb1f5500bcc3f55cce1548bab (patch)
tree22a0d066f369e57889c3e64bb0593b6a88e0061c
parentMove TabPage lookup into extra function (diff)
downloadcore-81cf79d1af42fc9fb1f5500bcc3f55cce1548bab.tar.gz
core-81cf79d1af42fc9fb1f5500bcc3f55cce1548bab.zip
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>
-rw-r--r--sw/source/core/table/swnewtable.cxx5
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 );