Kaydet (Commit) 807d5f11 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SwUndoSaveSection

Change-Id: I0d4efde9ffa3a026052303eda4fe4dbbd48b22bc
Reviewed-on: https://gerrit.libreoffice.org/57306
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst b1a15e7f
......@@ -186,7 +186,7 @@ public:
class SwUndoSaveSection : private SwUndoSaveContent
{
std::unique_ptr<SwNodeIndex> m_pMovedStart;
SwRedlineSaveDatas* pRedlSaveData;
std::unique_ptr<SwRedlineSaveDatas> pRedlSaveData;
sal_uLong nMvLen; // Index into UndoNodes-Array.
sal_uLong nStartPos;
......
......@@ -1195,7 +1195,7 @@ SwUndoSaveSection::~SwUndoSaveSection()
m_pMovedStart.reset();
}
delete pRedlSaveData;
pRedlSaveData.reset();
}
void SwUndoSaveSection::SaveSection( const SwNodeIndex& rSttIdx )
......@@ -1219,11 +1219,10 @@ void SwUndoSaveSection::SaveSection(
SwDoc::CorrAbs( aSttIdx, aEndIdx, SwPosition( aMvStt ), true );
}
pRedlSaveData = new SwRedlineSaveDatas;
pRedlSaveData.reset( new SwRedlineSaveDatas );
if( !SwUndo::FillSaveData( aPam, *pRedlSaveData ))
{
delete pRedlSaveData;
pRedlSaveData = nullptr;
pRedlSaveData.reset();
}
nStartPos = rRange.aStart.GetIndex();
......@@ -1278,8 +1277,7 @@ void SwUndoSaveSection::RestoreSection( SwDoc* pDoc, const SwNodeIndex& rInsPos
if( pRedlSaveData )
{
SwUndo::SetSaveData( *pDoc, *pRedlSaveData );
delete pRedlSaveData;
pRedlSaveData = nullptr;
pRedlSaveData.reset();
}
}
}
......
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