diff options
author | Noel Grandin <noel@peralex.com> | 2012-06-22 14:52:00 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-06-25 20:13:19 +0200 |
commit | 772101649cf16233bbaf0900aa9ebbc915151a95 (patch) | |
tree | a118021d50a92e441e8b1d79417b4f14d484175c | |
parent | 688dcf0dc155e6278ab9d3a2c61bb720cd792c82 (diff) |
Convert SwDoc::UnProtectCells to use std::vector
Change-Id: Ib1b4756bf26934ded941a7c91c6742e03b942f59
-rw-r--r-- | sw/source/core/docnode/ndtbl.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index d4a1c1220377..758188551808 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -4466,22 +4466,22 @@ sal_Bool SwDoc::UnProtectCells( const SwSelBoxes& rBoxes ) ? new SwUndoAttrTbl( *rBoxes[0]->GetSttNd()->FindTableNode() ) : 0; - SvPtrarr aFmts( 16 ), aNewFmts( 16 ); + std::vector<SwFrmFmt*> aFmts, aNewFmts; for( sal_uInt16 i = rBoxes.Count(); i; ) { SwTableBox* pBox = rBoxes[ --i ]; SwFrmFmt* pBoxFmt = pBox->GetFrmFmt(); if( pBoxFmt->GetProtect().IsCntntProtected() ) { - sal_uInt16 nFnd = aFmts.GetPos( pBoxFmt ); - if( USHRT_MAX != nFnd ) - pBox->ChgFrmFmt( (SwTableBoxFmt*)aNewFmts[ nFnd ] ); + std::vector<SwFrmFmt*>::iterator it = std::find( aFmts.begin(), aFmts.end(), pBoxFmt ); + if( aFmts.end() != it ) + pBox->ChgFrmFmt( (SwTableBoxFmt*)*it ); else { - aFmts.Insert( pBoxFmt, aFmts.Count() ); + aFmts.push_back( pBoxFmt ); pBoxFmt = pBox->ClaimFrmFmt(); pBoxFmt->ResetFmtAttr( RES_PROTECT ); - aNewFmts.Insert( pBoxFmt, aNewFmts.Count() ); + aNewFmts.push_back( pBoxFmt ); } bChgd = sal_True; } |