diff options
-rw-r--r-- | sw/inc/undobj.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/undo/untblk.cxx | 11 |
2 files changed, 7 insertions, 8 deletions
diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index 70be965c3f14..2e84ff9c1d6e 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -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; diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx index d00210353875..a419e7399280 100644 --- a/sw/source/core/undo/untblk.cxx +++ b/sw/source/core/undo/untblk.cxx @@ -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 |