diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-10-01 06:50:54 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-10-01 06:50:54 +0000 |
commit | dd4c6408dd88ab2975bdf3070e8c3366469c6b4c (patch) | |
tree | ab01134b622a65631b5b7460a3689626e93d5a30 /svx/source/table/tablerow.cxx | |
parent | 5542ceebce993e2c39cf704748febe0614845fa2 (diff) |
CWS-TOOLING: integrate CWS impress149
Diffstat (limited to 'svx/source/table/tablerow.cxx')
-rw-r--r-- | svx/source/table/tablerow.cxx | 37 |
1 files changed, 8 insertions, 29 deletions
diff --git a/svx/source/table/tablerow.cxx b/svx/source/table/tablerow.cxx index 337091b7366e..e4f35bad6d58 100644 --- a/svx/source/table/tablerow.cxx +++ b/svx/source/table/tablerow.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: tablerow.cxx,v $ - * $Revision: 1.3 $ + * $Revision: 1.3.148.1 $ * * This file is part of OpenOffice.org. * @@ -129,36 +129,15 @@ void TableRow::insertColumns( sal_Int32 nIndex, sal_Int32 nCount, CellVector::it throwIfDisposed(); if( nCount ) { - if( nIndex < static_cast< sal_Int32 >( maCells.size() ) ) - { - CellVector::iterator aIter( maCells.begin() ); - while( nIndex-- ) - aIter++; - while( nCount-- ) - { - CellRef xCell; - if( pIter ) - xCell = (*(*pIter)++); - else - xCell = mxTableModel->createCell(); - - maCells.insert( aIter, xCell ); - } - } + if( nIndex >= static_cast< sal_Int32 >( maCells.size() ) ) + nIndex = static_cast< sal_Int32 >( maCells.size() ); + if ( pIter ) + maCells.insert( maCells.begin() + nIndex, *pIter, (*pIter) + nCount ); else { - nIndex = static_cast< sal_Int32 >( maCells.size() ); - maCells.resize( nIndex + nCount ); - while(nCount--) - { - CellRef xCell; - if( pIter ) - xCell = (*(*pIter)++); - else - xCell = mxTableModel->createCell(); - - maCells[nIndex++] = xCell; - } + maCells.reserve( maCells.size() + nCount ); + for ( sal_Int32 i = 0; i < nCount; i++ ) + maCells.insert( maCells.begin() + nIndex + i, mxTableModel->createCell() ); } } } |