diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-13 11:26:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-14 09:26:21 +0200 |
commit | 52fe7d3196465bd7d4c7e3b4cecda66a7ef0b8ad (patch) | |
tree | 604c621b1cd74c0a3a1af750dada3e13bbf68714 /sw | |
parent | 96ac9e4bf913043e89461e6259a403edc93d56e4 (diff) |
loplugin:useuniqueptr in SwTextNode::MakeNewTextNode
Change-Id: I524375af95b988e53838b87c00be5fbaf2895a84
Reviewed-on: https://gerrit.libreoffice.org/60456
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 859f33e5f30c..886e3b8ce5e6 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -2583,16 +2583,16 @@ SwTextNode* SwTextNode::MakeNewTextNode( const SwNodeIndex& rPos, bool bNext, bool bChgFollow ) { // ignore hard PageBreak/PageDesc/ColumnBreak from Auto-Set - SwAttrSet* pNewAttrSet = nullptr; + std::unique_ptr<SwAttrSet> pNewAttrSet; // #i75353# bool bClearHardSetNumRuleWhenFormatCollChanges( false ); if( HasSwAttrSet() ) { - pNewAttrSet = new SwAttrSet( *GetpSwAttrSet() ); + pNewAttrSet.reset(new SwAttrSet( *GetpSwAttrSet() )); const SfxItemSet* pTmpSet = GetpSwAttrSet(); if (bNext) // successor doesn't inherit breaks! - pTmpSet = pNewAttrSet; + pTmpSet = pNewAttrSet.get(); // !bNext: remove PageBreaks/PageDesc/ColBreak from this bool bRemoveFromCache = false; @@ -2658,9 +2658,9 @@ SwTextNode* SwTextNode::MakeNewTextNode( const SwNodeIndex& rPos, bool bNext, SwTextFormatColl* pColl = GetTextColl(); - SwTextNode *pNode = new SwTextNode( rPos, pColl, pNewAttrSet ); + SwTextNode *pNode = new SwTextNode( rPos, pColl, pNewAttrSet.get() ); - delete pNewAttrSet; + pNewAttrSet.reset(); const SwNumRule* pRule = GetNumRule(); if( pRule && pRule == pNode->GetNumRule() && rNds.IsDocNodes() ) |