Kaydet (Commit) 52fe7d31 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SwTextNode::MakeNewTextNode

Change-Id: I524375af95b988e53838b87c00be5fbaf2895a84
Reviewed-on: https://gerrit.libreoffice.org/60456
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 96ac9e4b
......@@ -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() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment