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; ...@@ -230,9 +230,9 @@ class SwUndoInsLayFormat;
class SwUndoInserts : public SwUndo, public SwUndRng, private SwUndoSaveContent class SwUndoInserts : public SwUndo, public SwUndRng, private SwUndoSaveContent
{ {
SwTextFormatColl *pTextFormatColl, *pLastNdColl; SwTextFormatColl *pTextFormatColl, *pLastNdColl;
std::vector<SwFrameFormat*>* pFrameFormats; std::unique_ptr<std::vector<SwFrameFormat*>> pFrameFormats;
std::vector< std::shared_ptr<SwUndoInsLayFormat> > m_FlyUndos; std::vector< std::shared_ptr<SwUndoInsLayFormat> > m_FlyUndos;
SwRedlineData* pRedlData; std::unique_ptr<SwRedlineData> pRedlData;
bool bSttWasTextNd; bool bSttWasTextNd;
protected: protected:
sal_uLong nNdDiff; sal_uLong nNdDiff;
......
...@@ -65,7 +65,7 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam ) ...@@ -65,7 +65,7 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam )
nSttNode == pAPos->nNode.GetIndex() ) nSttNode == pAPos->nNode.GetIndex() )
{ {
if( !pFrameFormats ) if( !pFrameFormats )
pFrameFormats = new std::vector<SwFrameFormat*>; pFrameFormats.reset( new std::vector<SwFrameFormat*> );
pFrameFormats->push_back( pFormat ); pFrameFormats->push_back( pFormat );
} }
} }
...@@ -73,7 +73,7 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam ) ...@@ -73,7 +73,7 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam )
// consider Redline // consider Redline
if( pDoc->getIDocumentRedlineAccess().IsRedlineOn() ) 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() ); SetRedlineFlags( pDoc->getIDocumentRedlineAccess().GetRedlineFlags() );
} }
} }
...@@ -141,8 +141,7 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, bool bScanFlys, ...@@ -141,8 +141,7 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, bool bScanFlys,
pFrameFormats->erase( it ); pFrameFormats->erase( it );
} }
} }
delete pFrameFormats; pFrameFormats.reset();
pFrameFormats = nullptr;
} }
} }
...@@ -156,8 +155,8 @@ SwUndoInserts::~SwUndoInserts() ...@@ -156,8 +155,8 @@ SwUndoInserts::~SwUndoInserts()
rUNds.GetEndOfExtras().GetIndex() - m_pUndoNodeIndex->GetIndex()); rUNds.GetEndOfExtras().GetIndex() - m_pUndoNodeIndex->GetIndex());
m_pUndoNodeIndex.reset(); m_pUndoNodeIndex.reset();
} }
delete pFrameFormats; pFrameFormats.reset();
delete pRedlData; pRedlData.reset();
} }
// Undo Insert operation // 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