From 6b35f10b83a8142644a2831bae63f5aa566ed635 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 25 Jun 2012 14:35:39 +0200 Subject: Convert Svptrarr to std::vector Change-Id: I1527f6c319d536286e1dc12c8c9ffa3b6a0e3713 --- sw/source/core/doc/docredln.cxx | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'sw') diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index b32ae8ba81f5..88c3749d9c0f 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -3545,7 +3545,7 @@ void SwRedline::MoveFromSection() { SwDoc* pDoc = GetDoc(); const SwRedlineTbl& rTbl = pDoc->GetRedlineTbl(); - SvPtrarr aBeforeArr( 16 ), aBehindArr( 16 ); + std::vector aBeforeArr, aBehindArr; sal_uInt16 nMyPos = rTbl.GetPos( this ); OSL_ENSURE( this, "this is not in the array?" ); sal_Bool bBreak = sal_False; @@ -3556,14 +3556,12 @@ void SwRedline::MoveFromSection() bBreak = sal_True; if( rTbl[ n ]->GetBound(sal_True) == *GetPoint() ) { - void* pTmp = &rTbl[ n ]->GetBound(sal_True); - aBehindArr.Insert( pTmp, aBehindArr.Count()); + aBehindArr.push_back( &rTbl[ n ]->GetBound(sal_True) ); bBreak = sal_False; } if( rTbl[ n ]->GetBound(sal_False) == *GetPoint() ) { - void* pTmp = &rTbl[ n ]->GetBound(sal_False); - aBehindArr.Insert( pTmp, aBehindArr.Count() ); + aBehindArr.push_back( &rTbl[ n ]->GetBound(sal_False) ); bBreak = sal_False; } } @@ -3573,14 +3571,12 @@ void SwRedline::MoveFromSection() bBreak = sal_True; if( rTbl[ n ]->GetBound(sal_True) == *GetPoint() ) { - void* pTmp = &rTbl[ n ]->GetBound(sal_True); - aBeforeArr.Insert( pTmp, aBeforeArr.Count() ); + aBeforeArr.push_back( &rTbl[ n ]->GetBound(sal_True) ); bBreak = sal_False; } if( rTbl[ n ]->GetBound(sal_False) == *GetPoint() ) { - void* pTmp = &rTbl[ n ]->GetBound(sal_False); - aBeforeArr.Insert( pTmp, aBeforeArr.Count() ); + aBeforeArr.push_back( &rTbl[ n ]->GetBound(sal_False) ); bBreak = sal_False; } } @@ -3650,10 +3646,10 @@ void SwRedline::MoveFromSection() // adjustment of redline table positions must take start and // end into account, not point and mark. - for( n = 0; n < aBeforeArr.Count(); ++n ) - *(SwPosition*)aBeforeArr[ n ] = *Start(); - for( n = 0; n < aBehindArr.Count(); ++n ) - *(SwPosition*)aBehindArr[ n ] = *End(); + for( n = 0; n < aBeforeArr.size(); ++n ) + *aBeforeArr[ n ] = *Start(); + for( n = 0; n < aBehindArr.size(); ++n ) + *aBehindArr[ n ] = *End(); } else InvalidateRange(); -- cgit