diff options
author | Noel Grandin <noel@peralex.com> | 2012-04-26 17:40:06 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-05-09 08:53:00 +0200 |
commit | 25d018c0382625c424b80b124c9a8c39c28c2afc (patch) | |
tree | a75700dd24b6d08fc356b1a799e66daec72d99ad | |
parent | de4d4eb650358f14022389dabe975deffed1b96b (diff) |
Convert SV_DECL_PTRARR(SwUndoSortList) to std::vector
-rw-r--r-- | sw/source/core/inc/UndoSort.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/undo/unsort.cxx | 13 |
2 files changed, 9 insertions, 6 deletions
diff --git a/sw/source/core/inc/UndoSort.hxx b/sw/source/core/inc/UndoSort.hxx index 03407472e1f1..9591db691dd3 100644 --- a/sw/source/core/inc/UndoSort.hxx +++ b/sw/source/core/inc/UndoSort.hxx @@ -68,7 +68,7 @@ struct SwSortUndoElement }; SV_DECL_PTRARR_DEL(SwSortList, SwSortUndoElement*, 10) -SV_DECL_PTRARR(SwUndoSortList, SwNodeIndex*, 10) +typedef std::vector<SwNodeIndex*> SwUndoSortList; class SwUndoSort : public SwUndo, private SwUndRng { diff --git a/sw/source/core/undo/unsort.cxx b/sw/source/core/undo/unsort.cxx index b75b0514bea2..23bfa3478cc7 100644 --- a/sw/source/core/undo/unsort.cxx +++ b/sw/source/core/undo/unsort.cxx @@ -48,7 +48,6 @@ SV_IMPL_PTRARR(SwSortList, SwSortUndoElement*) -SV_IMPL_PTRARR(SwUndoSortList, SwNodeIndex*) SwSortUndoElement::~SwSortUndoElement() @@ -151,7 +150,7 @@ void SwUndoSort::UndoImpl(::sw::UndoRedoContext & rContext) { SwNodeIndex* pIdx = new SwNodeIndex( rDoc.GetNodes(), aSortList[ii]->SORT_TXT_TBL.TXT.nTarget ); - aIdxList.C40_INSERT(SwNodeIndex, pIdx, i ); + aIdxList.insert( aIdxList.begin() + i, pIdx ); break; } @@ -163,7 +162,9 @@ void SwUndoSort::UndoImpl(::sw::UndoRedoContext & rContext) IDocumentContentOperations::DOC_MOVEDEFAULT); } // Indixes loeschen - aIdxList.DeleteAndDestroy(0, aIdxList.Count()); + for(SwUndoSortList::const_iterator it = aIdxList.begin(); it != aIdxList.end(); ++it) + delete *it; + aIdxList.clear(); SetPaM(rPam, true); } } @@ -226,7 +227,7 @@ void SwUndoSort::RedoImpl(::sw::UndoRedoContext & rContext) { // aktuelle Pos ist die Ausgangslage SwNodeIndex* pIdx = new SwNodeIndex( rDoc.GetNodes(), aSortList[i]->SORT_TXT_TBL.TXT.nSource); - aIdxList.C40_INSERT( SwNodeIndex, pIdx, i ); + aIdxList.insert( aIdxList.begin() + i, pIdx ); } for(i=0; i < aSortList.Count(); ++i) @@ -237,7 +238,9 @@ void SwUndoSort::RedoImpl(::sw::UndoRedoContext & rContext) IDocumentContentOperations::DOC_MOVEDEFAULT); } // Indixes loeschen - aIdxList.DeleteAndDestroy(0, aIdxList.Count()); + for(SwUndoSortList::const_iterator it = aIdxList.begin(); it != aIdxList.end(); ++it) + delete *it; + aIdxList.clear(); SetPaM(rPam, true); SwTxtNode const*const pTNd = rPam.GetNode()->GetTxtNode(); if( pTNd ) |