Kaydet (Commit) 43c085f9 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SwUndoInserts

Change-Id: I678798048b5ff5fc917fd2c37180d977a2a1d606
Reviewed-on: https://gerrit.libreoffice.org/57419
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst fc6c9de5
......@@ -230,9 +230,9 @@ class SwUndoInsLayFormat;
class SwUndoInserts : public SwUndo, public SwUndRng, private SwUndoSaveContent
{
SwTextFormatColl *pTextFormatColl, *pLastNdColl;
std::vector<SwFrameFormat*>* pFrameFormats;
std::unique_ptr<std::vector<SwFrameFormat*>> pFrameFormats;
std::vector< std::shared_ptr<SwUndoInsLayFormat> > m_FlyUndos;
SwRedlineData* pRedlData;
std::unique_ptr<SwRedlineData> pRedlData;
bool bSttWasTextNd;
protected:
sal_uLong nNdDiff;
......
......@@ -65,7 +65,7 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam )
nSttNode == pAPos->nNode.GetIndex() )
{
if( !pFrameFormats )
pFrameFormats = new std::vector<SwFrameFormat*>;
pFrameFormats.reset( new std::vector<SwFrameFormat*> );
pFrameFormats->push_back( pFormat );
}
}
......@@ -73,7 +73,7 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam )
// consider Redline
if( pDoc->getIDocumentRedlineAccess().IsRedlineOn() )
{
pRedlData = new SwRedlineData( nsRedlineType_t::REDLINE_INSERT, pDoc->getIDocumentRedlineAccess().GetRedlineAuthor() );
pRedlData.reset( new SwRedlineData( nsRedlineType_t::REDLINE_INSERT, pDoc->getIDocumentRedlineAccess().GetRedlineAuthor() ) );
SetRedlineFlags( pDoc->getIDocumentRedlineAccess().GetRedlineFlags() );
}
}
......@@ -141,8 +141,7 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, bool bScanFlys,
pFrameFormats->erase( it );
}
}
delete pFrameFormats;
pFrameFormats = nullptr;
pFrameFormats.reset();
}
}
......@@ -156,8 +155,8 @@ SwUndoInserts::~SwUndoInserts()
rUNds.GetEndOfExtras().GetIndex() - m_pUndoNodeIndex->GetIndex());
m_pUndoNodeIndex.reset();
}
delete pFrameFormats;
delete pRedlData;
pFrameFormats.reset();
pRedlData.reset();
}
// Undo Insert operation
......
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