Kaydet (Commit) b9f344ef authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Stahl

Convert SV_DECL_PTRARR_DEL(SwUndoSaveSections) to boost::ptr_vector

üst cd9283ac
...@@ -87,8 +87,10 @@ extern void ClearFEShellTabCols(); ...@@ -87,8 +87,10 @@ extern void ClearFEShellTabCols();
typedef SfxItemSet* SfxItemSetPtr; typedef SfxItemSet* SfxItemSetPtr;
SV_DECL_PTRARR_DEL( SfxItemSets, SfxItemSetPtr, 10 ) SV_DECL_PTRARR_DEL( SfxItemSets, SfxItemSetPtr, 10 )
typedef SwUndoSaveSection* SwUndoSaveSectionPtr; class SwUndoSaveSections : public boost::ptr_vector<SwUndoSaveSection> {
SV_DECL_PTRARR_DEL( SwUndoSaveSections, SwUndoSaveSectionPtr, 0 ) public:
SwUndoSaveSections(size_type n) : boost::ptr_vector<SwUndoSaveSection>(n) {}
};
class SwUndoMoves : public boost::ptr_vector<SwUndoMove> {}; class SwUndoMoves : public boost::ptr_vector<SwUndoMove> {};
...@@ -220,7 +222,6 @@ struct SwTblToTxtSave ...@@ -220,7 +222,6 @@ struct SwTblToTxtSave
}; };
SV_IMPL_PTRARR( SfxItemSets, SfxItemSetPtr ) SV_IMPL_PTRARR( SfxItemSets, SfxItemSetPtr )
SV_IMPL_PTRARR( SwUndoSaveSections, SwUndoSaveSectionPtr )
sal_uInt16 aSave_BoxCntntSet[] = { sal_uInt16 aSave_BoxCntntSet[] = {
RES_CHRATR_COLOR, RES_CHRATR_CROSSEDOUT, RES_CHRATR_COLOR, RES_CHRATR_CROSSEDOUT,
...@@ -1736,7 +1737,7 @@ void SwUndoTblNdsChg::SaveSection( SwStartNode* pSttNd ) ...@@ -1736,7 +1737,7 @@ void SwUndoTblNdsChg::SaveSection( SwStartNode* pSttNd )
SwUndoSaveSection* pSave = new SwUndoSaveSection; SwUndoSaveSection* pSave = new SwUndoSaveSection;
pSave->SaveSection( pSttNd->GetDoc(), SwNodeIndex( *pSttNd )); pSave->SaveSection( pSttNd->GetDoc(), SwNodeIndex( *pSttNd ));
pDelSects->Insert( pSave, pDelSects->Count() ); pDelSects->push_back( pSave );
nSttNode = pTblNd->GetIndex(); nSttNode = pTblNd->GetIndex();
} }
...@@ -1768,9 +1769,9 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext) ...@@ -1768,9 +1769,9 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
SwTableBoxes& rLnBoxes = pCpyBox->GetUpper()->GetTabBoxes(); SwTableBoxes& rLnBoxes = pCpyBox->GetUpper()->GetTabBoxes();
// die Sections wieder herstellen // 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 ); pSave->RestoreSection( &rDoc, &aIdx, SwTableBoxStartNode );
if( pSave->GetHistory() ) if( pSave->GetHistory() )
pSave->GetHistory()->Rollback( &rDoc ); pSave->GetHistory()->Rollback( &rDoc );
...@@ -1778,7 +1779,7 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext) ...@@ -1778,7 +1779,7 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
pCpyBox->GetUpper() ); pCpyBox->GetUpper() );
rLnBoxes.C40_INSERT( SwTableBox, pBox, rLnBoxes.Count() ); rLnBoxes.C40_INSERT( SwTableBox, pBox, rLnBoxes.Count() );
} }
pDelSects->DeleteAndDestroy( 0, pDelSects->Count() ); pDelSects->clear();
} }
else if( !pNewSttNds->empty() ) else if( !pNewSttNds->empty() )
{ {
...@@ -1955,9 +1956,7 @@ void SwUndoTblNdsChg::RedoImpl(::sw::UndoRedoContext & rContext) ...@@ -1955,9 +1956,7 @@ void SwUndoTblNdsChg::RedoImpl(::sw::UndoRedoContext & rContext)
if( pUndo ) if( pUndo )
{ {
pDelSects->Insert( pUndo->pDelSects.get(), 0 ); pDelSects->transfer( pDelSects->begin(), *pUndo->pDelSects.get() );
pUndo->pDelSects->Remove( 0, pUndo->pDelSects->Count() );
delete pUndo; delete pUndo;
} }
rDoc.GetIDocumentUndoRedo().DoUndo( false ); rDoc.GetIDocumentUndoRedo().DoUndo( false );
......
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