diff options
author | Noel Grandin <noel@peralex.com> | 2012-06-21 17:56:59 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-06-25 20:13:16 +0200 |
commit | e22cc759097feedd53cd56337b1b4a9813ba3d60 (patch) | |
tree | a48b0099d97b49433f5e829a83cadb889d33e48a /sw | |
parent | ace0b43a026626dfbf0623800c24600d2d9480b5 (diff) |
Convert pFrmFmts member from Svptrarr to std::vector
Change-Id: I628709ab09318917083f71dde9f06cfb1c8d1a49
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/undobj.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/undo/untblk.cxx | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index 31140af123c9..ecc4c55c11af 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -233,7 +233,7 @@ class SwUndoInsLayFmt; class SwUndoInserts : public SwUndo, public SwUndRng, private SwUndoSaveCntnt { SwTxtFmtColl *pTxtFmtColl, *pLastNdColl; - SvPtrarr* pFrmFmts; + std::vector<SwFrmFmt*>* pFrmFmts; ::std::vector< ::boost::shared_ptr<SwUndoInsLayFmt> > m_FlyUndos; SwRedlineData* pRedlData; sal_Bool bSttWasTxtNd; diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx index 9888f316e013..f02764514f7c 100644 --- a/sw/source/core/undo/untblk.cxx +++ b/sw/source/core/undo/untblk.cxx @@ -70,8 +70,8 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam ) nSttNode == pAPos->nNode.GetIndex() ) { if( !pFrmFmts ) - pFrmFmts = new SvPtrarr; - pFrmFmts->Insert( pFmt, pFrmFmts->Count() ); + pFrmFmts = new std::vector<SwFrmFmt*>; + pFrmFmts->push_back( pFmt ); } } } @@ -112,7 +112,7 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, sal_Bool bScanFlys, { // than collect all new Flys SwDoc* pDoc = (SwDoc*)rPam.GetDoc(); - sal_uInt16 nFndPos, nArrLen = pDoc->GetSpzFrmFmts()->size(); + sal_uInt16 nArrLen = pDoc->GetSpzFrmFmts()->size(); for( sal_uInt16 n = 0; n < nArrLen; ++n ) { SwFrmFmt* pFmt = (*pDoc->GetSpzFrmFmts())[n]; @@ -122,15 +122,16 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, sal_Bool bScanFlys, (pAnchor->GetAnchorId() == FLY_AT_PARA) && nSttNode == pAPos->nNode.GetIndex() ) { + std::vector<SwFrmFmt*>::iterator it; if( !pFrmFmts || - USHRT_MAX == ( nFndPos = pFrmFmts->GetPos( pFmt ) ) ) + pFrmFmts->end() == ( it = std::find( pFrmFmts->begin(), pFrmFmts->end(), pFmt ) ) ) { ::boost::shared_ptr<SwUndoInsLayFmt> const pFlyUndo( new SwUndoInsLayFmt(pFmt, 0, 0)); m_FlyUndos.push_back(pFlyUndo); } else - pFrmFmts->Remove( nFndPos ); + pFrmFmts->erase( it ); } } delete pFrmFmts, pFrmFmts = 0; |