summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-04-25 17:28:43 +0200
committerMichael Stahl <mstahl@redhat.com>2012-05-09 08:52:58 +0200
commitb9f344eff6fd17f7d9b4d4585999cf18927707f3 (patch)
tree6cdac17a2460e2d82a854ca5905f72ac941e4351 /sw
parentcd9283aca3af5cdce0660eaf80e477efbf2b1f12 (diff)
Convert SV_DECL_PTRARR_DEL(SwUndoSaveSections) to boost::ptr_vector
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/undo/untbl.cxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 9abcb404e417..314a5bbd756c 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -87,8 +87,10 @@ extern void ClearFEShellTabCols();
typedef SfxItemSet* SfxItemSetPtr;
SV_DECL_PTRARR_DEL( SfxItemSets, SfxItemSetPtr, 10 )
-typedef SwUndoSaveSection* SwUndoSaveSectionPtr;
-SV_DECL_PTRARR_DEL( SwUndoSaveSections, SwUndoSaveSectionPtr, 0 )
+class SwUndoSaveSections : public boost::ptr_vector<SwUndoSaveSection> {
+public:
+ SwUndoSaveSections(size_type n) : boost::ptr_vector<SwUndoSaveSection>(n) {}
+};
class SwUndoMoves : public boost::ptr_vector<SwUndoMove> {};
@@ -220,7 +222,6 @@ struct SwTblToTxtSave
};
SV_IMPL_PTRARR( SfxItemSets, SfxItemSetPtr )
-SV_IMPL_PTRARR( SwUndoSaveSections, SwUndoSaveSectionPtr )
sal_uInt16 aSave_BoxCntntSet[] = {
RES_CHRATR_COLOR, RES_CHRATR_CROSSEDOUT,
@@ -1736,7 +1737,7 @@ void SwUndoTblNdsChg::SaveSection( SwStartNode* pSttNd )
SwUndoSaveSection* pSave = new SwUndoSaveSection;
pSave->SaveSection( pSttNd->GetDoc(), SwNodeIndex( *pSttNd ));
- pDelSects->Insert( pSave, pDelSects->Count() );
+ pDelSects->push_back( pSave );
nSttNode = pTblNd->GetIndex();
}
@@ -1768,9 +1769,9 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
SwTableBoxes& rLnBoxes = pCpyBox->GetUpper()->GetTabBoxes();
// die Sections wieder herstellen
- for( sal_uInt16 n = pDelSects->Count(); n; )
+ for( sal_uInt16 n = pDelSects->size(); n; )
{
- SwUndoSaveSection* pSave = (*pDelSects)[ --n ];
+ SwUndoSaveSection* pSave = &(*pDelSects)[ --n ];
pSave->RestoreSection( &rDoc, &aIdx, SwTableBoxStartNode );
if( pSave->GetHistory() )
pSave->GetHistory()->Rollback( &rDoc );
@@ -1778,7 +1779,7 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
pCpyBox->GetUpper() );
rLnBoxes.C40_INSERT( SwTableBox, pBox, rLnBoxes.Count() );
}
- pDelSects->DeleteAndDestroy( 0, pDelSects->Count() );
+ pDelSects->clear();
}
else if( !pNewSttNds->empty() )
{
@@ -1955,9 +1956,7 @@ void SwUndoTblNdsChg::RedoImpl(::sw::UndoRedoContext & rContext)
if( pUndo )
{
- pDelSects->Insert( pUndo->pDelSects.get(), 0 );
- pUndo->pDelSects->Remove( 0, pUndo->pDelSects->Count() );
-
+ pDelSects->transfer( pDelSects->begin(), *pUndo->pDelSects.get() );
delete pUndo;
}
rDoc.GetIDocumentUndoRedo().DoUndo( false );