diff options
author | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2012-03-24 23:01:06 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-04-02 23:15:20 +0200 |
commit | 2f657dd568ce30ec9132892080c63578e4132908 (patch) | |
tree | d728efc358a8e23789e4e3ac1d9091c4b03651b5 | |
parent | a482b89e4d9c41b6f7c1616d193ac6cde05a69a7 (diff) |
Convert SV_PTRARRAY to ::std::deque
-rw-r--r-- | sw/inc/crsrsh.hxx | 1 | ||||
-rw-r--r-- | sw/inc/tblsel.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/crsr/trvltbl.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/frmedt/fetab.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/frmedt/tblsel.cxx | 25 |
5 files changed, 21 insertions, 24 deletions
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index fba2e6814881..0c079727aab1 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -69,7 +69,6 @@ class SwTxtINetFmt; class SwFmtINetFmt; class SwTxtAttr; class SwTableBox; -class SwCellFrms; class SwTOXMark; class SwRedline; class IBlockCursor; diff --git a/sw/inc/tblsel.hxx b/sw/inc/tblsel.hxx index 5ecc65b8df12..5725956df0a1 100644 --- a/sw/inc/tblsel.hxx +++ b/sw/inc/tblsel.hxx @@ -34,6 +34,7 @@ #include "swdllapi.h" #include <map> +#include <deque> class SwCrsrShell; class SwCursor; @@ -49,7 +50,7 @@ class SwTable; class SwUndoTblMerge; class SwCellFrm; -SV_DECL_PTRARR( SwCellFrms, SwCellFrm*, 16 ) +typedef ::std::deque< SwCellFrm* > SwCellFrms; class SwSelBoxes : private std::map<sal_uLong, SwTableBox*> diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx index cae5aa89089b..44a2b95fc5d6 100644 --- a/sw/source/core/crsr/trvltbl.cxx +++ b/sw/source/core/crsr/trvltbl.cxx @@ -217,7 +217,7 @@ sal_Bool SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple ) static_cast<const SwCellFrm*>(pEndFrm), aBoxes, bSelectUp ? 0 : &aCells, eType ); - if( aBoxes.empty() || ( !bSelectUp && 4 != aCells.Count() ) ) + if( aBoxes.empty() || ( !bSelectUp && 4 != aCells.size() ) ) return sal_False; if ( bSelectUp ) diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index 3d3a1aea3441..9da85cd21486 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -2345,12 +2345,12 @@ sal_Bool lcl_IsFormulaSelBoxes( const SwTable& rTbl, const SwTblBoxFormula& rFml for( SwSelBoxes::reverse_iterator it = aBoxes.rbegin(); it != aBoxes.rend(); ++it ) { SwTableBox* pBox = it->second; - sal_uInt16 i; - for( i = 0; i < rCells.Count(); ++i ) - if( rCells[ i ]->GetTabBox() == pBox ) + SwCellFrms::iterator iC; + for( iC = rCells.begin(); iC != rCells.end(); ++iC ) + if( (*iC)->GetTabBox() == pBox ) break; // found - if( i == rCells.Count() ) + if( iC == rCells.end() ) return sal_False; } @@ -2371,7 +2371,7 @@ sal_Bool SwFEShell::GetAutoSum( String& rFml ) const if( ::GetAutoSumSel( *this, aCells )) { sal_uInt16 nW = 0, nInsPos = 0; - for( sal_uInt16 n = aCells.Count(); n; ) + for( size_t n = aCells.size(); n; ) { SwCellFrm* pCFrm = aCells[ --n ]; sal_uInt16 nBoxW = pCFrm->GetTabBox()->IsFormulaOrValueBox(); @@ -2393,7 +2393,7 @@ sal_Bool SwFEShell::GetAutoSum( String& rFml ) const { nW = RES_BOXATR_VALUE; // restore previous spaces! - for( sal_uInt16 i = aCells.Count(); n+1 < i; ) + for( size_t i = aCells.size(); n+1 < i; ) { String sTmp( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "|<" )) ); @@ -2431,7 +2431,7 @@ sal_Bool SwFEShell::GetAutoSum( String& rFml ) const nW = RES_BOXATR_VALUE; rFml.Erase( nInsPos ); // restore previous spaces! - for( sal_uInt16 i = aCells.Count(); n+1 < i; ) + for( size_t i = aCells.size(); n+1 < i; ) { String sTmp( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "|<" )) ); diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index 2a4123e23e69..c8017c407b71 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -74,9 +74,6 @@ #undef DEL_EMPTY_BOXES_AT_START_AND_END #define DEL_ALL_EMPTY_BOXES - -SV_IMPL_PTRARR( SwCellFrms, SwCellFrm* ) - struct _CmpLPt { Point aPos; @@ -403,11 +400,11 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd, if ( pCells ) { - pCells->Remove( 0, pCells->Count() ); - pCells->Insert( pCurrentTopLeftFrm, 0 ); - pCells->Insert( pCurrentTopRightFrm, 1 ); - pCells->Insert( pCurrentBottomLeftFrm, 2 ); - pCells->Insert( pCurrentBottomRightFrm, 3 ); + pCells->clear(); + pCells->push_back( const_cast< SwCellFrm* >(pCurrentTopLeftFrm) ); + pCells->push_back( const_cast< SwCellFrm* >(pCurrentTopRightFrm) ); + pCells->push_back( const_cast< SwCellFrm* >(pCurrentBottomLeftFrm) ); + pCells->push_back( const_cast< SwCellFrm* >(pCurrentBottomRightFrm) ); } if( bTblIsValid ) @@ -773,7 +770,7 @@ sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes ) if( pCell == pSttCell ) { sal_uInt16 nWhichId = 0; - for( sal_uInt16 n = rBoxes.Count(); n; ) + for( size_t n = rBoxes.size(); n; ) if( USHRT_MAX != ( nWhichId = rBoxes[ --n ] ->GetTabBox()->IsFormulaOrValueBox() )) break; @@ -800,7 +797,7 @@ sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes ) } if( pUpperCell ) - rBoxes.Insert( pUpperCell, rBoxes.Count() ); + rBoxes.push_back( const_cast< SwCellFrm* >(pUpperCell) ); } if( bFound ) { @@ -817,7 +814,7 @@ sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes ) { bFound = sal_False; - rBoxes.Remove( 0, rBoxes.Count() ); + rBoxes.clear(); aUnions.DeleteAndDestroy( 0, aUnions.Count() ); ::MakeSelUnions( aUnions, pStart, pEnd, nsSwTblSearchType::TBLSEARCH_ROW ); @@ -842,7 +839,7 @@ sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes ) if( pCell == pSttCell ) { sal_uInt16 nWhichId = 0; - for( sal_uInt16 n = rBoxes.Count(); n; ) + for( size_t n = rBoxes.size(); n; ) if( USHRT_MAX != ( nWhichId = rBoxes[ --n ] ->GetTabBox()->IsFormulaOrValueBox() )) break; @@ -857,8 +854,8 @@ sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes ) OSL_ENSURE( pCell->IsCellFrm(), "Frame without cell" ); if( ::IsFrmInTblSel( pUnion->GetUnion(), pCell ) ) { - const SwCellFrm* pC = (SwCellFrm*)pCell; - rBoxes.Insert( pC, rBoxes.Count() ); + SwCellFrm* pC = (SwCellFrm*)pCell; + rBoxes.push_back( pC ); } if( pCell->GetNext() ) { |