diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-10-12 12:38:54 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-10-12 13:59:53 +0200 |
commit | 9ebfe82edc3cb12cb3d8574b1fefd2d2c6809970 (patch) | |
tree | 692037ae57b7f834b460d2438b5ba2419e38252d /sw/source | |
parent | 3d94310d065ff20a72d081d58bafec19eb0f05bf (diff) |
sw: replace boost::ptr_vector with std::vector<std::unique_ptr>
Change-Id: Ib0a0d596ce262783b8850d4d9c0142391cc59284
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/inc/UndoTable.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/undo/untbl.cxx | 17 |
2 files changed, 10 insertions, 9 deletions
diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx index d35d15fd2954..58a320dd2b50 100644 --- a/sw/source/core/inc/UndoTable.hxx +++ b/sw/source/core/inc/UndoTable.hxx @@ -220,7 +220,7 @@ class SwUndoTableMerge : public SwUndo, private SwUndRng _SaveTable* pSaveTable; std::set<sal_uLong> m_Boxes; std::vector<sal_uLong> aNewSttNds; - SwUndoMoves* pMoves; + SwUndoMoves* m_pMoves; SwHistory* pHistory; public: diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index bdf46eae537a..b69f7a3637a4 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -88,7 +88,7 @@ public: explicit SwUndoSaveSections(size_type n) : boost::ptr_vector<SwUndoSaveSection>(n) {} }; -class SwUndoMoves : public boost::ptr_vector<SwUndoMove> {}; +class SwUndoMoves : public std::vector<std::unique_ptr<SwUndoMove>> {}; struct SwTableToTextSave; class SwTableToTextSaves : public boost::ptr_vector<SwTableToTextSave> { @@ -1927,19 +1927,20 @@ void SwUndoTableNdsChg::RedoImpl(::sw::UndoRedoContext & rContext) } SwUndoTableMerge::SwUndoTableMerge( const SwPaM& rTableSel ) - : SwUndo( UNDO_TABLE_MERGE ), SwUndRng( rTableSel ), pHistory( 0 ) + : SwUndo( UNDO_TABLE_MERGE ), SwUndRng( rTableSel ) + , m_pMoves(new SwUndoMoves) + , pHistory(nullptr) { const SwTableNode* pTableNd = rTableSel.GetNode().FindTableNode(); OSL_ENSURE( pTableNd, "Where is the TableNode?" ); pSaveTable = new _SaveTable( pTableNd->GetTable() ); - pMoves = new SwUndoMoves; nTableNode = pTableNd->GetIndex(); } SwUndoTableMerge::~SwUndoTableMerge() { delete pSaveTable; - delete pMoves; + delete m_pMoves; delete pHistory; } @@ -2003,11 +2004,11 @@ CHECKTABLE(pTableNd->GetTable()) *pBox->GetSttNd()->EndOfSectionNode() ), pColl ); // this was the separator -> restore moved ones - for( size_t i = pMoves->size(); i; ) + for (size_t i = m_pMoves->size(); i; ) { SwTextNode* pTextNd = 0; sal_Int32 nDelPos = 0; - SwUndoMove* pUndo = &(*pMoves)[ --i ]; + SwUndoMove *const pUndo = (*m_pMoves)[ --i ].get(); if( !pUndo->IsMoveRange() ) { pTextNd = rDoc.GetNodes()[ pUndo->GetDestSttNode() ]->GetTextNode(); @@ -2097,7 +2098,7 @@ void SwUndoTableMerge::RedoImpl(::sw::UndoRedoContext & rContext) void SwUndoTableMerge::MoveBoxContent( SwDoc* pDoc, SwNodeRange& rRg, SwNodeIndex& rPos ) { SwNodeIndex aTmp( rRg.aStart, -1 ), aTmp2( rPos, -1 ); - SwUndoMove* pUndo = new SwUndoMove( pDoc, rRg, rPos ); + std::unique_ptr<SwUndoMove> pUndo(new SwUndoMove( pDoc, rRg, rPos )); ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); pDoc->getIDocumentContentOperations().MoveNodeRange( rRg, rPos, pSaveTable->IsNewModel() ? SwMoveFlags::NO_DELFRMS : @@ -2106,7 +2107,7 @@ void SwUndoTableMerge::MoveBoxContent( SwDoc* pDoc, SwNodeRange& rRg, SwNodeInde ++aTmp2; pUndo->SetDestRange( aTmp2, rPos, aTmp ); - pMoves->push_back( pUndo ); + m_pMoves->push_back(std::move(pUndo)); } void SwUndoTableMerge::SetSelBoxes( const SwSelBoxes& rBoxes ) |