[Libreoffice-commits] .: 8 commits - sw/inc sw/source
Michael Stahl
mst at kemper.freedesktop.org
Mon May 14 12:16:16 PDT 2012
sw/inc/authfld.hxx | 14 -
sw/inc/swtable.hxx | 13 +
sw/inc/tblafmt.hxx | 3
sw/inc/unoevtlstnr.hxx | 3
sw/inc/unotxdoc.hxx | 3
sw/source/core/doc/docchart.cxx | 8
sw/source/core/doc/gctable.cxx | 77 ++++-----
sw/source/core/doc/htmltbl.cxx | 18 +-
sw/source/core/doc/tblafmt.cxx | 15 -
sw/source/core/doc/tblcpy.cxx | 54 +++---
sw/source/core/doc/tblrwcl.cxx | 214 +++++++++++++-------------
sw/source/core/docnode/ndcopy.cxx | 34 +---
sw/source/core/docnode/ndtbl.cxx | 124 +++++++--------
sw/source/core/docnode/ndtbl1.cxx | 2
sw/source/core/fields/authfld.cxx | 101 ++++--------
sw/source/core/fields/cellfml.cxx | 8
sw/source/core/fields/ddetbl.cxx | 2
sw/source/core/frmedt/fetab.cxx | 5
sw/source/core/frmedt/tblsel.cxx | 36 ++--
sw/source/core/inc/tblrwcl.hxx | 7
sw/source/core/layout/tabfrm.cxx | 6
sw/source/core/table/swnewtable.cxx | 52 +++---
sw/source/core/table/swtable.cxx | 49 +++--
sw/source/core/undo/untbl.cxx | 24 +-
sw/source/core/unocore/unochart.cxx | 4
sw/source/core/unocore/unoevtlstnr.cxx | 25 +--
sw/source/core/unocore/unotbl.cxx | 36 ++--
sw/source/filter/html/htmltab.cxx | 13 -
sw/source/filter/html/htmltabw.cxx | 27 +--
sw/source/filter/rtf/rtftbl.cxx | 18 +-
sw/source/filter/rtf/swparrtf.cxx | 2
sw/source/filter/writer/wrtswtbl.cxx | 6
sw/source/filter/ww1/fltshell.cxx | 10 -
sw/source/filter/ww8/WW8TableInfo.cxx | 12 -
sw/source/filter/ww8/wrtww8.cxx | 6
sw/source/filter/ww8/ww8par2.cxx | 12 -
sw/source/filter/xml/xmltble.cxx | 21 +-
sw/source/filter/xml/xmltbli.cxx | 4
sw/source/ui/dbui/dbinsdlg.cxx | 9 -
sw/source/ui/shells/basesh.cxx | 10 -
sw/source/ui/table/tautofmt.cxx | 57 +++---
sw/source/ui/uno/RefreshListenerContainer.cxx | 4
sw/source/ui/uno/unotxdoc.cxx | 10 -
sw/source/ui/vba/vbatablehelper.cxx | 4
44 files changed, 577 insertions(+), 585 deletions(-)
New commits:
commit 68b9fc0627bcfaad6df2ada1734905811149a1ce
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon May 14 18:33:15 2012 +0200
Fix memory leak from using std::vector for SwTableBoxes
Also adapt dbgutil code for previous commit
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index 43f172a..cab9d92 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -3488,7 +3488,7 @@ void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize )
SwTwips nAktSize = 0;
// See if the tables have a correct width
- for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
+ for (sal_uInt16 n = 0; n < rBoxes.size(); ++n)
{
const SwTableBox* pBox = rBoxes[ n ];
const SwTwips nBoxW = pBox->GetFrmFmt()->GetFrmSize().GetWidth();
@@ -3498,7 +3498,7 @@ void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize )
_CheckBoxWidth( *pBox->GetTabLines()[ i ], nBoxW );
}
- if( Abs( nAktSize - nSize ) > ( COLFUZZY * rBoxes.Count() ) )
+ if (Abs(nAktSize - nSize) > (COLFUZZY * rBoxes.size()))
{
OSL_FAIL( "Line's Boxes are too small or too large" );
}
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 722a7fb..537c201 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -1561,6 +1561,10 @@ SwTableLine::SwTableLine( SwTableLineFmt *pFmt, sal_uInt16 nBoxes,
SwTableLine::~SwTableLine()
{
+ for (size_t i = 0; i < aBoxes.size(); ++i)
+ {
+ delete aBoxes[i];
+ }
// ist die TabelleLine der letzte Client im FrameFormat, kann dieses
// geloescht werden
SwModify* pMod = GetFrmFmt();
commit b8ace0f986769cc952718ab5e262808d899d5549
Author: Noel Grandin <noel at peralex.com>
Date: Thu May 10 17:42:10 2012 +0200
Convert SV_DECL_PTRARR_DEL(SwTableBoxes) to std::vector
I added a GetPos() method because quite a lot of code used that
method and the existing code is quite tied to the precise
return values of that method.
Change-Id: I9af6b923d978abe758b63d835f228495c020455a
diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index ba67780..29c779a 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -37,6 +37,8 @@
#include <memory>
#include <boost/noncopyable.hpp>
+#include <vector>
+#include <algorithm>
class SwStartNode;
class SwFmt;
@@ -72,7 +74,16 @@ SV_DECL_REF( SwServerObject )
#endif
SV_DECL_PTRARR_DEL(SwTableLines, SwTableLine*, 10)
-SV_DECL_PTRARR_DEL(SwTableBoxes, SwTableBox*, 25)
+
+class SwTableBoxes : public std::vector<SwTableBox*> {
+public:
+ // return USHRT_MAX if not found, else index of position
+ sal_uInt16 GetPos(const SwTableBox* pBox) const
+ {
+ const_iterator it = std::find(begin(), end(), pBox);
+ return it == end() ? USHRT_MAX : it - begin();
+ }
+};
// Save content-bearing box-pointers additionally in a sorted array
// (for calculation in table).
diff --git a/sw/source/core/doc/docchart.cxx b/sw/source/core/doc/docchart.cxx
index 92df356..427164c 100644
--- a/sw/source/core/doc/docchart.cxx
+++ b/sw/source/core/doc/docchart.cxx
@@ -83,19 +83,19 @@ sal_Bool SwTable::IsTblComplexForChart( const String& rSelection ) const
else
{
const SwTableLines* pLns = &GetTabLines();
- pSttBox = (*pLns)[ 0 ]->GetTabBoxes()[ 0 ];
+ pSttBox = (*pLns)[ 0 ]->GetTabBoxes().front();
while( !pSttBox->GetSttNd() )
// Until the Content Box!
- pSttBox = pSttBox->GetTabLines()[ 0 ]->GetTabBoxes()[ 0 ];
+ pSttBox = pSttBox->GetTabLines()[ 0 ]->GetTabBoxes().front();
const SwTableBoxes* pBoxes = &(*pLns)[ pLns->Count()-1 ]->GetTabBoxes();
- pEndBox = (*pBoxes)[ pBoxes->Count()-1 ];
+ pEndBox = pBoxes->back();
while( !pEndBox->GetSttNd() )
{
// Until the Content Box!
pLns = &pEndBox->GetTabLines();
pBoxes = &(*pLns)[ pLns->Count()-1 ]->GetTabBoxes();
- pEndBox = (*pBoxes)[ pBoxes->Count()-1 ];
+ pEndBox = pBoxes->back();
}
}
diff --git a/sw/source/core/doc/gctable.cxx b/sw/source/core/doc/gctable.cxx
index d61151c..5507c54 100644
--- a/sw/source/core/doc/gctable.cxx
+++ b/sw/source/core/doc/gctable.cxx
@@ -32,6 +32,7 @@
#include <editeng/boxitem.hxx>
#include <tblrwcl.hxx>
#include <swtblfmt.hxx>
+#include <algorithm>
using namespace ::editeng;
@@ -83,22 +84,23 @@ sal_Bool lcl_GCBorder_ChkBoxBrd_B( const SwTableBox*& rpBox, void* pPara )
return bRet;
}
+static void lcl_GCBorder_GetLastBox_B( const SwTableBox* pBox, SwTableBoxes* pPara );
+
sal_Bool lcl_GCBorder_GetLastBox_L( const SwTableLine*& rpLine, void* pPara )
{
const SwTableBoxes& rBoxes = rpLine->GetTabBoxes();
- const SwTableBox* pBox = rBoxes[ rBoxes.Count()-1 ];
- ::lcl_GCBorder_GetLastBox_B( pBox, pPara );
+ const SwTableBox* pBox = rBoxes.back();
+ lcl_GCBorder_GetLastBox_B( pBox, (SwTableBoxes*)pPara );
return sal_True;
}
-sal_Bool lcl_GCBorder_GetLastBox_B( const SwTableBox*& rpBox, void* pPara )
+static void lcl_GCBorder_GetLastBox_B( const SwTableBox* pBox, SwTableBoxes* pPara )
{
- SwTableLines& rLines = (SwTableLines&)rpBox->GetTabLines();
+ SwTableLines& rLines = (SwTableLines&)pBox->GetTabLines();
if( rLines.Count() )
rLines.ForEach( &lcl_GCBorder_GetLastBox_L, pPara );
else
- ((SwTableBoxes*)pPara)->Insert( rpBox, ((SwTableBoxes*)pPara)->Count() );
- return sal_True;
+ pPara->push_back( (SwTableBox*)pBox );
}
// Find the "end" of the passed BorderLine. Returns the "Layout"Pos!
@@ -168,6 +170,7 @@ void lcl_GCBorder_DelBorder( const SwCollectTblLineBoxes& rCollTLB,
} while( sal_True );
}
+static sal_Bool lcl_GC_Box_Border( SwTableBox* pBox, _SwGCLineBorder* pPara );
sal_Bool lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara )
{
@@ -179,19 +182,19 @@ sal_Bool lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara )
const SvxBorderLine* pBrd;
const SfxPoolItem* pItem;
const SwTableBoxes& rBoxes = rpLine->GetTabBoxes();
- for( sal_uInt16 n = 0, nBoxes = rBoxes.Count() - 1; n < nBoxes; ++n )
+ for( sal_uInt16 n = 0, nBoxes = rBoxes.size() - 1; n < nBoxes; ++n )
{
SwTableBoxes aBoxes;
{
- const SwTableBox* pBox = rBoxes[ n ];
+ SwTableBox* pBox = rBoxes[ n ];
if( pBox->GetSttNd() )
- aBoxes.Insert( pBox, 0 );
+ aBoxes.insert( aBoxes.begin(), pBox );
else
lcl_GCBorder_GetLastBox_B( pBox, &aBoxes );
}
SwTableBox* pBox;
- for( sal_uInt16 i = aBoxes.Count(); i; )
+ for( sal_uInt16 i = aBoxes.size(); i; )
if( SFX_ITEM_SET == (pBox = aBoxes[ --i ])->GetFrmFmt()->
GetItemState( RES_BOX, sal_True, &pItem ) &&
0 != ( pBrd = ((SvxBoxItem*)pItem)->GetRight() ) )
@@ -210,7 +213,7 @@ sal_Bool lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara )
}
}
- aBoxes.Remove( 0, aBoxes.Count() );
+ aBoxes.clear();
}
}
@@ -308,20 +311,22 @@ sal_Bool lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara )
} while( sal_True );
}
- ((SwTableLine*)rpLine)->GetTabBoxes().ForEach( &lcl_GC_Box_Border, pPara );
+ for( SwTableBoxes::iterator it = ((SwTableLine*)rpLine)->GetTabBoxes().begin();
+ it != ((SwTableLine*)rpLine)->GetTabBoxes().end(); ++it)
+ lcl_GC_Box_Border(*it, (_SwGCLineBorder*)pPara );
++pGCPara->nLinePos;
return sal_True;
}
-sal_Bool lcl_GC_Box_Border( const SwTableBox*& rpBox, void* pPara )
+static sal_Bool lcl_GC_Box_Border( SwTableBox* pBox, _SwGCLineBorder* pPara )
{
- if( rpBox->GetTabLines().Count() )
+ if( pBox->GetTabLines().Count() )
{
- _SwGCLineBorder aPara( *rpBox );
- aPara.pShareFmts = ((_SwGCLineBorder*)pPara)->pShareFmts;
- ((SwTableBox*)rpBox)->GetTabLines().ForEach( &lcl_GC_Line_Border, &aPara );
+ _SwGCLineBorder aPara( *pBox );
+ aPara.pShareFmts = pPara->pShareFmts;
+ pBox->GetTabLines().ForEach( &lcl_GC_Line_Border, &aPara );
}
return sal_True;
}
@@ -338,33 +343,33 @@ struct _GCLinePara
static bool lcl_MergeGCLine(const SwTableLine*& rpLine, void*const pPara);
-static bool lcl_MergeGCBox(const SwTableBox*& rpTblBox, void*const pPara)
+static bool lcl_MergeGCBox(SwTableBox* pTblBox, void*const pPara)
{
- SwTableBox*& rpBox = (SwTableBox*&)rpTblBox;
- sal_uInt16 n, nLen = rpBox->GetTabLines().Count();
+ sal_uInt16 n, nLen = pTblBox->GetTabLines().Count();
if( nLen )
{
// ATTENTION: The Line count can change!
- _GCLinePara aPara( rpBox->GetTabLines(), (_GCLinePara*)pPara );
- for( n = 0; n < rpBox->GetTabLines().Count() &&
- lcl_MergeGCLine( *(rpBox->GetTabLines().GetData() + n), &aPara );
+ _GCLinePara aPara( pTblBox->GetTabLines(), (_GCLinePara*)pPara );
+ for( n = 0; n < pTblBox->GetTabLines().Count() &&
+ lcl_MergeGCLine( *(pTblBox->GetTabLines().GetData() + n), &aPara );
++n )
;
- if( 1 == rpBox->GetTabLines().Count() )
+ if( 1 == pTblBox->GetTabLines().Count() )
{
// Box with a Line, then move all the Line's Boxes after this Box
// into the parent Line and delete this Box
- SwTableLine* pInsLine = rpBox->GetUpper();
- SwTableLine* pCpyLine = rpBox->GetTabLines()[0];
- sal_uInt16 nInsPos = pInsLine->GetTabBoxes().C40_GETPOS( SwTableBox, rpBox );
- for( n = 0; n < pCpyLine->GetTabBoxes().Count(); ++n )
+ SwTableLine* pInsLine = pTblBox->GetUpper();
+ SwTableLine* pCpyLine = pTblBox->GetTabLines()[0];
+ SwTableBoxes::iterator it = std::find( pInsLine->GetTabBoxes().begin(), pInsLine->GetTabBoxes().end(), pTblBox );
+ for( n = 0; n < pCpyLine->GetTabBoxes().size(); ++n )
pCpyLine->GetTabBoxes()[n]->SetUpper( pInsLine );
- pInsLine->GetTabBoxes().Insert( &pCpyLine->GetTabBoxes(), nInsPos+1 );
- pCpyLine->GetTabBoxes().Remove( 0, n );
+ pInsLine->GetTabBoxes().insert( it + 1, pCpyLine->GetTabBoxes().begin(), pCpyLine->GetTabBoxes().end());
+ pCpyLine->GetTabBoxes().clear();
// Delete the old Box with the Line
- pInsLine->GetTabBoxes().DeleteAndDestroy( nInsPos );
+ delete *it;
+ pInsLine->GetTabBoxes().erase( it );
return false; // set up anew
}
@@ -375,14 +380,14 @@ static bool lcl_MergeGCBox(const SwTableBox*& rpTblBox, void*const pPara)
static bool lcl_MergeGCLine(const SwTableLine*& rpLine, void *const pPara)
{
SwTableLine* pLn = (SwTableLine*)rpLine;
- sal_uInt16 nLen = pLn->GetTabBoxes().Count();
+ sal_uInt16 nLen = pLn->GetTabBoxes().size();
if( nLen )
{
_GCLinePara* pGCPara = (_GCLinePara*)pPara;
while( 1 == nLen )
{
// We have a Box with Lines
- SwTableBox* pBox = pLn->GetTabBoxes()[0];
+ SwTableBox* pBox = pLn->GetTabBoxes().front();
if( !pBox->GetTabLines().Count() )
break;
@@ -425,12 +430,12 @@ static bool lcl_MergeGCLine(const SwTableLine*& rpLine, void *const pPara)
rLns[ nInsPos++ ]->SetUpper( pUpper );
pLn = pLine; // and set up anew
- nLen = pLn->GetTabBoxes().Count();
+ nLen = pLn->GetTabBoxes().size();
}
// ATTENTION: The number of boxes can change!
- for( nLen = 0; nLen < pLn->GetTabBoxes().Count(); ++nLen )
- if( !lcl_MergeGCBox( *(pLn->GetTabBoxes().GetData() + nLen ), pPara ))
+ for( nLen = 0; nLen < pLn->GetTabBoxes().size(); ++nLen )
+ if( !lcl_MergeGCBox( pLn->GetTabBoxes()[nLen], pPara ))
--nLen;
}
return true;
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index befc7d5..890a1c8 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -419,7 +419,7 @@ const SwStartNode *SwHTMLTableLayout::GetAnyBoxStartNode() const
{
OSL_ENSURE( pBox->GetTabLines().Count() > 0,
"Box without start node and lines" );
- OSL_ENSURE( pBox->GetTabLines()[0]->GetTabBoxes().Count() > 0,
+ OSL_ENSURE( pBox->GetTabLines()[0]->GetTabBoxes().size() > 0,
"Line without boxes" );
pBox = pBox->GetTabLines()[0]->GetTabBoxes()[0];
}
@@ -1537,20 +1537,18 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
static sal_Bool lcl_ResizeLine( const SwTableLine*& rpLine, void* pPara );
-static sal_Bool lcl_ResizeBox( const SwTableBox*& rpBox, void* pPara )
+static sal_Bool lcl_ResizeBox( SwTableBox* pBox, sal_uInt16* pWidth )
{
- sal_uInt16 *pWidth = (sal_uInt16 *)pPara;
-
- if( !rpBox->GetSttNd() )
+ if( !pBox->GetSttNd() )
{
sal_uInt16 nWidth = 0;
- ((SwTableBox *)rpBox)->GetTabLines().ForEach( &lcl_ResizeLine, &nWidth );
- rpBox->GetFrmFmt()->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, nWidth, 0 ));
+ pBox->GetTabLines().ForEach( &lcl_ResizeLine, &nWidth );
+ pBox->GetFrmFmt()->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, nWidth, 0 ));
*pWidth = *pWidth + nWidth;
}
else
{
- *pWidth = *pWidth + (sal_uInt16)rpBox->GetFrmFmt()->GetFrmSize().GetSize().Width();
+ *pWidth = *pWidth + (sal_uInt16)pBox->GetFrmFmt()->GetFrmSize().GetSize().Width();
}
return sal_True;
@@ -1563,7 +1561,9 @@ static sal_Bool lcl_ResizeLine( const SwTableLine*& rpLine, void* pPara )
sal_uInt16 nOldWidth = *pWidth;
#endif
*pWidth = 0;
- ((SwTableLine *)rpLine)->GetTabBoxes().ForEach( &lcl_ResizeBox, pWidth );
+ for( SwTableBoxes::iterator it = ((SwTableLine*)rpLine)->GetTabBoxes().begin();
+ it != ((SwTableLine*)rpLine)->GetTabBoxes().end(); ++it)
+ lcl_ResizeBox(*it, pWidth );
#if OSL_DEBUG_LEVEL > 0
OSL_ENSURE( !nOldWidth || Abs(*pWidth-nOldWidth) < COLFUZZY,
diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx
index 8c3e960..60cbd5f 100644
--- a/sw/source/core/doc/tblcpy.cxx
+++ b/sw/source/core/doc/tblcpy.cxx
@@ -163,7 +163,7 @@ namespace
SubTable::iterator pMax = pStartLn;
++pMax;
SubTable::difference_type nMax = 1;
- for( sal_uInt16 nBox = 0; nBox < rLine.GetTabBoxes().Count(); ++nBox )
+ for( sal_uInt16 nBox = 0; nBox < rLine.GetTabBoxes().size(); ++nBox )
{
SubTable::iterator pTmp = insertSubBox( rSubTable,
*rLine.GetTabBoxes()[nBox], pStartLn, pMax );
@@ -262,7 +262,7 @@ namespace
{
bool bComplex = false;
if( !bNewModel )
- for( sal_uInt16 nBox = 0; !bComplex && nBox < rBoxes.Count(); ++nBox )
+ for( sal_uInt16 nBox = 0; !bComplex && nBox < rBoxes.size(); ++nBox )
bComplex = rBoxes[nBox]->GetTabLines().Count() > 0;
if( bComplex )
{
@@ -271,7 +271,7 @@ namespace
aSubTable.push_back( aSubLine );
SubTable::iterator pStartLn = aSubTable.begin();
SubTable::iterator pEndLn = aSubTable.end();
- for( sal_uInt16 nBox = 0; nBox < rBoxes.Count(); ++nBox )
+ for( sal_uInt16 nBox = 0; nBox < rBoxes.size(); ++nBox )
insertSubBox( aSubTable, *rBoxes[nBox], pStartLn, pEndLn );
SubTable::size_type nSize = aSubTable.size();
if( nSize )
@@ -303,10 +303,10 @@ namespace
bool bSelected = false;
sal_uLong nBorder = 0;
sal_uInt16 nCol = 0;
- maLines[rLine].reserve( rBoxes.Count() );
+ maLines[rLine].reserve( rBoxes.size() );
ColumnStructure::iterator pCol = maCols.begin();
BoxStructure::iterator pSel = maLines[rLine].end();
- for( sal_uInt16 nBox = 0; nBox < rBoxes.Count(); ++nBox )
+ for( sal_uInt16 nBox = 0; nBox < rBoxes.size(); ++nBox )
addBox( rLine, pSelBoxes, rBoxes[nBox], nBorder, nCol,
pCol, pSel, bSelected, false );
++rLine;
@@ -829,7 +829,7 @@ sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
OSL_ENSURE( !rCpyTbl.IsTblComplex(), "Table too complex" );
- SwDoc* pDoc = GetFrmFmt()->GetDoc();
+ SwDoc* pDoc = GetFrmFmt()->GetDoc();
SwDoc* pCpyDoc = rCpyTbl.GetFrmFmt()->GetDoc();
SwTblNumFmtMerge aTNFM( *pCpyDoc, *pDoc );
@@ -850,7 +850,6 @@ sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
if( 1 != rCpyTbl.GetTabSortBoxes().Count() )
{
SwTableLine* pSttLine = pSttBox->GetUpper();
- sal_uInt16 nSttBox = pSttLine->GetTabBoxes().C40_GETPOS( SwTableBox, pSttBox );
sal_uInt16 nSttLine = GetTabLines().C40_GETPOS( SwTableLine, pSttLine );
_FndBox* pFndBox;
@@ -883,19 +882,19 @@ sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
SwTableLine* pLastLn = GetTabLines()[ GetTabLines().Count()-1 ];
pSttBox = pFLine->GetBoxes()[0].GetBox();
- nSttBox = pFLine->GetLine()->GetTabBoxes().C40_GETPOS( SwTableBox, pSttBox );
+ sal_uInt16 nSttBox = pFLine->GetLine()->GetTabBoxes().GetPos( pSttBox );
for( sal_uInt16 n = rCpyTbl.GetTabLines().Count() - nNewLns;
n < rCpyTbl.GetTabLines().Count(); ++n )
{
SwTableLine* pCpyLn = rCpyTbl.GetTabLines()[ n ];
- if( pLastLn->GetTabBoxes().Count() < nSttBox ||
- ( pLastLn->GetTabBoxes().Count() - nSttBox ) <
- pCpyLn->GetTabBoxes().Count() )
+ if( pLastLn->GetTabBoxes().size() < nSttBox ||
+ ( pLastLn->GetTabBoxes().size() - nSttBox ) <
+ pCpyLn->GetTabBoxes().size() )
return sal_False;
// Test for nesting
- for( nBx = 0; nBx < pCpyLn->GetTabBoxes().Count(); ++nBx )
+ for( nBx = 0; nBx < pCpyLn->GetTabBoxes().size(); ++nBx )
if( !( pTmpBox = pLastLn->GetTabBoxes()[ nSttBox + nBx ])
->GetSttNd() )
return sal_False;
@@ -928,7 +927,7 @@ sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
pFLine = &aFndBox.GetLines()[ nLn % nFndCnt ];
SwTableLine* pLine = pFLine->GetLine();
pSttBox = pFLine->GetBoxes()[0].GetBox();
- nSttBox = pLine->GetTabBoxes().C40_GETPOS( SwTableBox, pSttBox );
+ sal_uInt16 nSttBox = pLine->GetTabBoxes().GetPos( pSttBox );
if( nLn >= nFndCnt )
{
// We have more rows in the ClipBoard than we have selected
@@ -943,9 +942,9 @@ sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
if( pInsFLine )
{
// We insert a new row into the FndBox
- if( pLine->GetTabBoxes().Count() < nSttBox ||
+ if( pLine->GetTabBoxes().size() < nSttBox ||
sal::static_int_cast< sal_uInt16 >(
- pLine->GetTabBoxes().Count() - nSttBox ) <
+ pLine->GetTabBoxes().size() - nSttBox ) <
pFLine->GetBoxes().size() )
return sal_False;
@@ -963,13 +962,13 @@ sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
}
else if( pFLine->GetBoxes().size() == 1 )
{
- if( pLine->GetTabBoxes().Count() < nSttBox ||
- ( pLine->GetTabBoxes().Count() - nSttBox ) <
- pCpyLn->GetTabBoxes().Count() )
+ if( pLine->GetTabBoxes().size() < nSttBox ||
+ ( pLine->GetTabBoxes().size() - nSttBox ) <
+ pCpyLn->GetTabBoxes().size() )
return sal_False;
// Test for nesting
- for( nBx = 0; nBx < pCpyLn->GetTabBoxes().Count(); ++nBx )
+ for( nBx = 0; nBx < pCpyLn->GetTabBoxes().size(); ++nBx )
{
if( !( pTmpBox = pLine->GetTabBoxes()[ nSttBox + nBx ])
->GetSttNd() )
@@ -987,7 +986,7 @@ sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
// Match the selected Boxes with the ones in the Clipboard
// (n times)
if( 0 != ( pFLine->GetBoxes().size() %
- pCpyLn->GetTabBoxes().Count() ))
+ pCpyLn->GetTabBoxes().size() ))
return sal_False;
// Test for nesting
@@ -1029,7 +1028,7 @@ sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
{
// Copy the pCpyBox into pMyBox
lcl_CpyBox( rCpyTbl, pCpyLn->GetTabBoxes()[
- nBx % pCpyLn->GetTabBoxes().Count() ],
+ nBx % pCpyLn->GetTabBoxes().size() ],
*this, pFLine->GetBoxes()[nBx].GetBox(), sal_True, pUndo );
}
}
@@ -1038,10 +1037,9 @@ sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
return sal_True;
}
-sal_Bool _FndCntntBox( const SwTableBox*& rpBox, void* pPara )
+static sal_Bool _FndCntntBox( SwTableBox* pBox, void* pPara )
{
- SwTableBox* pBox = (SwTableBox*)rpBox;
- if( rpBox->GetTabLines().Count() )
+ if( pBox->GetTabLines().Count() )
pBox->GetTabLines().ForEach( &_FndCntntLine, pPara );
else
((SwSelBoxes*)pPara)->Insert( pBox );
@@ -1050,7 +1048,9 @@ sal_Bool _FndCntntBox( const SwTableBox*& rpBox, void* pPara )
sal_Bool _FndCntntLine( const SwTableLine*& rpLine, void* pPara )
{
- ((SwTableLine*)rpLine)->GetTabBoxes().ForEach( &_FndCntntBox, pPara );
+ for( SwTableBoxes::iterator it = ((SwTableLine*)rpLine)->GetTabBoxes().begin();
+ it != ((SwTableLine*)rpLine)->GetTabBoxes().end(); ++it)
+ _FndCntntBox(*it, pPara );
return sal_True;
}
@@ -1065,7 +1065,9 @@ SwSelBoxes& SwTable::SelLineFromBox( const SwTableBox* pBox,
// Delete all old ones
rBoxes.Remove( sal_uInt16(0), rBoxes.Count() );
- pLine->GetTabBoxes().ForEach( &_FndCntntBox, &rBoxes );
+ for( SwTableBoxes::iterator it = pLine->GetTabBoxes().begin();
+ it != pLine->GetTabBoxes().end(); ++it)
+ _FndCntntBox(*it, &rBoxes );
return rBoxes;
}
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index dfad7a4..43f172a 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -348,7 +348,7 @@ static void lcl_CopyCol( _FndBox & rFndBox, _CpyPara *const pCpyPara)
if( pBox->GetTabLines().Count() )
{
pCmpLine = &rFndBox.GetLines().front();
- if ( pCmpLine->GetBoxes().size() != pCmpLine->GetLine()->GetTabBoxes().Count() )
+ if ( pCmpLine->GetBoxes().size() != pCmpLine->GetLine()->GetTabBoxes().size() )
bDiffCount = true;
}
@@ -403,7 +403,7 @@ static void lcl_CopyCol( _FndBox & rFndBox, _CpyPara *const pCpyPara)
{
pBox = new SwTableBox( aFindFrm.pNewFrmFmt,
rFndBox.GetLines().size(), pCpyPara->pInsLine );
- pCpyPara->pInsLine->GetTabBoxes().C40_INSERT( SwTableBox, pBox, pCpyPara->nInsPos++);
+ pCpyPara->pInsLine->GetTabBoxes().insert( pCpyPara->pInsLine->GetTabBoxes().begin() + pCpyPara->nInsPos++, pBox );
_CpyPara aPara( *pCpyPara, pBox );
aPara.nDelBorderFlag &= 7;
@@ -496,7 +496,7 @@ void lcl_InsCol( _FndLine* pFndLn, _CpyPara& rCpyPara, sal_uInt16 nCpyCnt,
rCpyPara.pInsLine = pFndLn->GetLine();
SwTableBox* pBox = pFndLn->GetBoxes()[ bBehind ?
pFndLn->GetBoxes().size()-1 : 0 ].GetBox();
- rCpyPara.nInsPos = pFndLn->GetLine()->GetTabBoxes().C40_GETPOS( SwTableBox, pBox );
+ rCpyPara.nInsPos = pFndLn->GetLine()->GetTabBoxes().GetPos( pBox );
if( bBehind )
++rCpyPara.nInsPos;
@@ -681,11 +681,10 @@ sal_Bool SwTable::_InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
sal_Bool _FndBoxAppendRowLine( const SwTableLine*& rpLine, void* pPara );
-sal_Bool _FndBoxAppendRowBox( const SwTableBox*& rpBox, void* pPara )
+static void _FndBoxAppendRowBox( SwTableBox* pBox, _FndPara* pFndPara )
{
- _FndPara* pFndPara = (_FndPara*)pPara;
- _FndBox* pFndBox = new _FndBox( (SwTableBox*)rpBox, pFndPara->pFndLine );
- if( rpBox->GetTabLines().Count() )
+ _FndBox* pFndBox = new _FndBox( pBox, pFndPara->pFndLine );
+ if( pBox->GetTabLines().Count() )
{
_FndPara aPara( *pFndPara, pFndBox );
pFndBox->GetBox()->GetTabLines().ForEach( &_FndBoxAppendRowLine, &aPara );
@@ -694,7 +693,6 @@ sal_Bool _FndBoxAppendRowBox( const SwTableBox*& rpBox, void* pPara )
}
else
pFndPara->pFndLine->GetBoxes().push_back( pFndBox );
- return sal_True;
}
sal_Bool _FndBoxAppendRowLine( const SwTableLine*& rpLine, void* pPara )
@@ -702,7 +700,9 @@ sal_Bool _FndBoxAppendRowLine( const SwTableLine*& rpLine, void* pPara )
_FndPara* pFndPara = (_FndPara*)pPara;
_FndLine* pFndLine = new _FndLine( (SwTableLine*)rpLine, pFndPara->pFndBox );
_FndPara aPara( *pFndPara, pFndLine );
- pFndLine->GetLine()->GetTabBoxes().ForEach( &_FndBoxAppendRowBox, &aPara );
+ for( SwTableBoxes::iterator it = pFndLine->GetLine()->GetTabBoxes().begin();
+ it != pFndLine->GetLine()->GetTabBoxes().end(); ++it)
+ _FndBoxAppendRowBox(*it, &aPara );
if( pFndLine->GetBoxes().size() )
{
pFndPara->pFndBox->GetLines().push_back( pFndLine );
@@ -786,7 +786,7 @@ void lcl_LastBoxSetWidthLine( SwTableLines &rLines, const long nOffset,
void lcl_LastBoxSetWidth( SwTableBoxes &rBoxes, const long nOffset,
sal_Bool bFirst, SwShareBoxFmts& rShareFmts )
{
- SwTableBox& rBox = *rBoxes[ bFirst ? 0 : rBoxes.Count() - 1 ];
+ SwTableBox& rBox = *(bFirst ? rBoxes.front() : rBoxes.back());
if( !rBox.GetSttNd() )
::lcl_LastBoxSetWidthLine( rBox.GetTabLines(), nOffset,
bFirst, rShareFmts );
@@ -819,11 +819,11 @@ void _DeleteBox( SwTable& rTbl, SwTableBox* pBox, SwUndo* pUndo,
pBox->GetFrmFmt()->GetFrmSize().GetWidth() : 0;
SwTableLine* pLine = pBox->GetUpper();
SwTableBoxes& rTblBoxes = pLine->GetTabBoxes();
- sal_uInt16 nDelPos = rTblBoxes.C40_GETPOS( SwTableBox, pBox );
+ sal_uInt16 nDelPos = rTblBoxes.GetPos( pBox );
SwTableBox* pUpperBox = pBox->GetUpper()->GetUpper();
// Special treatment for the border:
- if( bCorrBorder && 1 < rTblBoxes.Count() )
+ if( bCorrBorder && 1 < rTblBoxes.size() )
{
sal_Bool bChgd = sal_False;
const SvxBoxItem& rBoxItem = pBox->GetFrmFmt()->GetBox();
@@ -832,7 +832,7 @@ void _DeleteBox( SwTable& rTbl, SwTableBox* pBox, SwUndo* pUndo,
{
// JP 02.04.97: 1st part for Bug 36271
// First the left/right edges
- if( nDelPos + 1 < rTblBoxes.Count() )
+ if( nDelPos + 1 < (sal_uInt16)rTblBoxes.size() )
{
SwTableBox* pNxtBox = rTblBoxes[ nDelPos + 1 ];
const SvxBoxItem& rNxtBoxItem = pNxtBox->GetFrmFmt()->GetBox();
@@ -858,7 +858,7 @@ void _DeleteBox( SwTable& rTbl, SwTableBox* pBox, SwUndo* pUndo,
SwTableBox* pPrvBox = rTblBoxes[ nDelPos - 1 ];
const SvxBoxItem& rPrvBoxItem = pPrvBox->GetFrmFmt()->GetBox();
- SwTableBox* pNxtBox = nDelPos + 1 < rTblBoxes.Count()
+ SwTableBox* pNxtBox = nDelPos + 1 < (sal_uInt16)rTblBoxes.size()
? rTblBoxes[ nDelPos + 1 ] : 0;
if( pPrvBox->GetSttNd() && !rPrvBoxItem.GetRight() &&
@@ -882,7 +882,8 @@ void _DeleteBox( SwTable& rTbl, SwTableBox* pBox, SwUndo* pUndo,
SwStartNode* pSttNd = (SwStartNode*)pBox->GetSttNd();
if( pShareFmts )
pShareFmts->RemoveFormat( *rTblBoxes[ nDelPos ]->GetFrmFmt() );
- rTblBoxes.DeleteAndDestroy( nDelPos );
+ delete rTblBoxes[nDelPos];
+ rTblBoxes.erase( rTblBoxes.begin() + nDelPos );
if( pSttNd )
{
@@ -894,10 +895,10 @@ void _DeleteBox( SwTable& rTbl, SwTableBox* pBox, SwUndo* pUndo,
}
// Also delete the Line?
- if( rTblBoxes.Count() )
+ if( !rTblBoxes.empty() )
{
// Then adapt the Frame-SSize
- sal_Bool bLastBox = nDelPos == rTblBoxes.Count();
+ sal_Bool bLastBox = nDelPos == rTblBoxes.size();
if( bLastBox )
--nDelPos;
pBox = rTblBoxes[nDelPos];
@@ -956,7 +957,7 @@ SwTableBox* lcl_FndNxtPrvDelBox( const SwTableLines& rTblLns,
SwTableLine* pLine = rTblLns[ nLinePos ];
SwTwips nFndBoxWidth = 0;
SwTwips nFndWidth = nBoxStt + nBoxWidth;
- sal_uInt16 nBoxCnt = pLine->GetTabBoxes().Count();
+ sal_uInt16 nBoxCnt = pLine->GetTabBoxes().size();
pFndBox = pLine->GetTabBoxes()[ 0 ];
for( sal_uInt16 n = 0; 0 < nFndWidth && n < nBoxCnt; ++n )
@@ -1007,7 +1008,7 @@ void lcl_SaveUpperLowerBorder( SwTable& rTbl, const SwTableBox& rBox,
const SwTableLine* pLine = rBox.GetUpper();
const SwTableBoxes& rTblBoxes = pLine->GetTabBoxes();
const SwTableBox* pUpperBox = &rBox;
- sal_uInt16 nDelPos = rTblBoxes.C40_GETPOS( SwTableBox, pUpperBox );
+ sal_uInt16 nDelPos = rTblBoxes.GetPos( pUpperBox );
pUpperBox = rBox.GetUpper()->GetUpper();
const SvxBoxItem& rBoxItem = rBox.GetFrmFmt()->GetBox();
@@ -1200,9 +1201,8 @@ sal_Bool SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16
(nCnt + 1) );
SwTableBox* pNewBox = new SwTableBox( pFrmFmt, nCnt, pInsLine );
- sal_uInt16 nBoxPos = pInsLine->GetTabBoxes().C40_GETPOS( SwTableBox, pSelBox );
- pInsLine->GetTabBoxes().Remove( nBoxPos ); // delete old ones
- pInsLine->GetTabBoxes().C40_INSERT( SwTableBox, pNewBox, nBoxPos );
+ sal_uInt16 nBoxPos = pInsLine->GetTabBoxes().GetPos( pSelBox );
+ pInsLine->GetTabBoxes()[nBoxPos] = pNewBox; // overwrite old one
// Delete background/border attribute
SwTableBox* pLastBox = pSelBox; // To distribute the TextNodes!
@@ -1240,7 +1240,7 @@ sal_Bool SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16
if( !i ) // hang up the original Box
{
pSelBox->SetUpper( pNewLine );
- pNewLine->GetTabBoxes().C40_INSERT( SwTableBox, pSelBox, 0 );
+ pNewLine->GetTabBoxes().insert( pNewLine->GetTabBoxes().begin(), pSelBox );
}
else
{
@@ -1324,7 +1324,7 @@ sal_Bool SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nC
// Then split the nCnt Box up into nCnt Boxes
SwTableLine* pInsLine = pSelBox->GetUpper();
- sal_uInt16 nBoxPos = pInsLine->GetTabBoxes().C40_GETPOS( SwTableBox, pSelBox );
+ sal_uInt16 nBoxPos = pInsLine->GetTabBoxes().GetPos( pSelBox );
// Find the Frame Format in the Frame Format Array
SwTableBoxFmt* pLastBoxFmt;
@@ -1433,9 +1433,10 @@ void lcl_CpyBoxes( sal_uInt16 nStt, sal_uInt16 nEnd,
for( sal_uInt16 n = nStt; n < nEnd; ++n )
rBoxes[n]->SetUpper( pInsLine );
if( USHRT_MAX == nPos )
- nPos = pInsLine->GetTabBoxes().Count();
- pInsLine->GetTabBoxes().Insert( &rBoxes, nPos, nStt, nEnd );
- rBoxes.Remove( nStt, nEnd - nStt );
+ nPos = pInsLine->GetTabBoxes().size();
+ pInsLine->GetTabBoxes().insert( pInsLine->GetTabBoxes().begin() + nPos,
+ rBoxes.begin() + nStt, rBoxes.begin() + nEnd );
+ rBoxes.erase( rBoxes.begin() + nStt, rBoxes.begin() + nEnd );
}
void lcl_CalcWidth( SwTableBox* pBox )
@@ -1448,7 +1449,7 @@ void lcl_CalcWidth( SwTableBox* pBox )
OSL_ENSURE( pLine, "Box is not within a Line" );
long nWidth = 0;
- for( sal_uInt16 n = 0; n < pLine->GetTabBoxes().Count(); ++n )
+ for( sal_uInt16 n = 0; n < pLine->GetTabBoxes().size(); ++n )
nWidth += pLine->GetTabBoxes()[n]->GetFrmFmt()->GetFrmSize().GetWidth();
pFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, nWidth, 0 ));
@@ -1503,15 +1504,15 @@ static void lcl_Merge_MoveBox(_FndBox & rFndBox, _InsULPara *const pULPara)
if( pULPara->bUL ) // Left ?
{
// if there are Boxes before it, move them
- if( 0 != ( nPos = pBoxes->C40_GETPOS( SwTableBox, pFndTableBox )) )
+ if( 0 != ( nPos = pBoxes->GetPos( pFndTableBox ) ) )
lcl_CpyBoxes( 0, nPos, *pBoxes, pULPara->pInsLine );
}
else // Right
// if there are Boxes behind it, move them
- if( (nPos = pBoxes->C40_GETPOS( SwTableBox, pFndTableBox )) +1 < pBoxes->Count() )
+ if( (nPos = pBoxes->GetPos( pFndTableBox )) +1 < (sal_uInt16)pBoxes->size() )
{
- nInsPos = pULPara->pInsLine->GetTabBoxes().Count();
- lcl_CpyBoxes( nPos+1, pBoxes->Count(),
+ nInsPos = pULPara->pInsLine->GetTabBoxes().size();
+ lcl_CpyBoxes( nPos+1, pBoxes->size(),
*pBoxes, pULPara->pInsLine );
}
}
@@ -1541,8 +1542,8 @@ static void lcl_Merge_MoveBox(_FndBox & rFndBox, _InsULPara *const pULPara)
if( pBox->GetTabLines().Count() )
{
if( USHRT_MAX == nInsPos )
- nInsPos = pBoxes->Count();
- pBoxes->C40_INSERT( SwTableBox, pBox, nInsPos );
+ nInsPos = pBoxes->size();
+ pBoxes->insert( pBoxes->begin() + nInsPos, pBox );
lcl_CalcWidth( pBox ); // calculate the Box's width
}
else
@@ -1566,10 +1567,10 @@ static void lcl_Merge_MoveLine(_FndLine& rFndLine, _InsULPara *const pULPara)
SwTableBox* pLBx = rFndLine.GetBoxes().front().GetBox();
SwTableBox* pRBx = rFndLine.GetBoxes().back().GetBox();
- sal_uInt16 nLeft = pFndLn->GetTabBoxes().C40_GETPOS( SwTableBox, pLBx );
- sal_uInt16 nRight = pFndLn->GetTabBoxes().C40_GETPOS( SwTableBox, pRBx );
+ sal_uInt16 nLeft = pFndLn->GetTabBoxes().GetPos( pLBx );
+ sal_uInt16 nRight = pFndLn->GetTabBoxes().GetPos( pRBx );
- if( !nLeft || nRight == pFndLn->GetTabBoxes().Count() )
+ if( !nLeft || nRight == pFndLn->GetTabBoxes().size() )
{
if( pULPara->bUL ) // Upper ?
{
@@ -1603,7 +1604,7 @@ static void lcl_Merge_MoveLine(_FndLine& rFndLine, _InsULPara *const pULPara)
lcl_CpyBoxes( 0, 2, pInsLine->GetTabBoxes(), pLMLn );
- pInsLine->GetTabBoxes().C40_INSERT( SwTableBox, pLMBox, 0 );
+ pInsLine->GetTabBoxes().insert( pInsLine->GetTabBoxes().begin(), pLMBox );
if( pULPara->bUL ) // Upper ?
{
@@ -1618,7 +1619,7 @@ static void lcl_Merge_MoveLine(_FndLine& rFndLine, _InsULPara *const pULPara)
pLMBox );
lcl_CalcWidth( pLMBox ); // calculate the Box's width
}
- else if( nRight+1 < pFndLn->GetTabBoxes().Count() )
+ else if( nRight+1 < (sal_uInt16)pFndLn->GetTabBoxes().size() )
{
// There are still Boxes on the right, so put the Right-
// and Merge-Box into one Box and Line, insert before/after
@@ -1637,14 +1638,14 @@ static void lcl_Merge_MoveLine(_FndLine& rFndLine, _InsULPara *const pULPara)
lcl_CpyBoxes( 1, 3, pInsLine->GetTabBoxes(), pRMLn );
- pInsLine->GetTabBoxes().C40_INSERT( SwTableBox, pRMBox, 0 );
+ pInsLine->GetTabBoxes().insert( pInsLine->GetTabBoxes().begin(), pRMBox );
}
else
{
// Left and Merge have been merged, so also move Right into the Line
pInsLine = pULPara->pLeftBox->GetUpper();
- sal_uInt16 nMvPos = pULPara->pRightBox->GetUpper()->GetTabBoxes().
- C40_GETPOS( SwTableBox, pULPara->pRightBox );
+ sal_uInt16 nMvPos = pULPara->pRightBox->GetUpper()->GetTabBoxes().GetPos(
+ pULPara->pRightBox );
lcl_CpyBoxes( nMvPos, nMvPos+1,
pULPara->pRightBox->GetUpper()->GetTabBoxes(),
pInsLine );
@@ -1662,7 +1663,7 @@ static void lcl_Merge_MoveLine(_FndLine& rFndLine, _InsULPara *const pULPara)
pRMBox->GetTabLines().C40_INSERT( SwTableLine, pNewLn,
pULPara->bUL ? nMvPos : nMvPos+1 );
pRMBox = new SwTableBox( (SwTableBoxFmt*)pRMBox->GetFrmFmt(), 0, pNewLn );
- pNewLn->GetTabBoxes().C40_INSERT( SwTableBox, pRMBox, 0 );
+ pNewLn->GetTabBoxes().insert( pNewLn->GetTabBoxes().begin(), pRMBox );
sal_uInt16 nPos1, nPos2;
if( pULPara->bUL )
@@ -1677,8 +1678,7 @@ static void lcl_Merge_MoveLine(_FndLine& rFndLine, _InsULPara *const pULPara)
lcl_CalcWidth( pRMBox ); // calculate the Box's width
pRMBox = new SwTableBox( (SwTableBoxFmt*)pRMBox->GetFrmFmt(), 0, pNewLn );
- pNewLn->GetTabBoxes().C40_INSERT( SwTableBox, pRMBox,
- pNewLn->GetTabBoxes().Count() );
+ pNewLn->GetTabBoxes().push_back( pRMBox );
}
}
if( pULPara->bUL ) // Upper ?
@@ -1718,7 +1718,7 @@ static void lcl_Merge_MoveLine(_FndLine& rFndLine, _InsULPara *const pULPara)
lcl_Merge_MoveBox(*it, &aPara);
}
- if( pNewLine->GetTabBoxes().Count() )
+ if( !pNewLine->GetTabBoxes().empty() )
{
if( USHRT_MAX == nInsPos )
nInsPos = pLines->Count();
@@ -1728,6 +1728,8 @@ static void lcl_Merge_MoveLine(_FndLine& rFndLine, _InsULPara *const pULPara)
delete pNewLine;
}
+static sal_Bool lcl_BoxSetHeadCondColl( SwTableBox* pBox );
+
sal_Bool SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
SwTableBox* pMergeBox, SwUndoTblMerge* pUndo )
{
@@ -1782,10 +1784,10 @@ sal_Bool SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
SwTableBox* pLeftBox = new SwTableBox( (SwTableBoxFmt*)pMergeBox->GetFrmFmt(), 0, pInsLine );
SwTableBox* pRightBox = new SwTableBox( (SwTableBoxFmt*)pMergeBox->GetFrmFmt(), 0, pInsLine );
pMergeBox->SetUpper( pInsLine );
- pInsLine->GetTabBoxes().C40_INSERT( SwTableBox, pLeftBox, 0 );
+ pInsLine->GetTabBoxes().insert( pInsLine->GetTabBoxes().begin(), pLeftBox );
pLeftBox->ClaimFrmFmt();
- pInsLine->GetTabBoxes().C40_INSERT( SwTableBox, pMergeBox, 1 );
- pInsLine->GetTabBoxes().C40_INSERT( SwTableBox, pRightBox, 2 );
+ pInsLine->GetTabBoxes().insert( pInsLine->GetTabBoxes().begin() + 1, pMergeBox);
+ pInsLine->GetTabBoxes().insert( pInsLine->GetTabBoxes().begin() + 2, pRightBox );
pRightBox->ClaimFrmFmt();
// This contains all Lines that are above the selected Area,
@@ -1837,7 +1839,9 @@ sal_Bool SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
// Clean up this Line's structure once again, generally all of them
GCLines();
- GetTabLines()[0]->GetTabBoxes().ForEach( &lcl_BoxSetHeadCondColl, 0 );
+ for( SwTableBoxes::iterator it = GetTabLines()[0]->GetTabBoxes().begin();
+ it != GetTabLines()[0]->GetTabBoxes().end(); ++it)
+ lcl_BoxSetHeadCondColl(*it);
aFndBox.MakeFrms( *this );
@@ -1855,7 +1859,7 @@ void lcl_CheckRowSpan( SwTable &rTbl )
while( nMaxSpan )
{
SwTableLine* pLine = rTbl.GetTabLines()[ nLineCount - nMaxSpan ];
- for( sal_uInt16 nBox = 0; nBox < pLine->GetTabBoxes().Count(); ++nBox )
+ for( sal_uInt16 nBox = 0; nBox < pLine->GetTabBoxes().size(); ++nBox )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nBox];
long nRowSpan = pBox->getRowSpan();
@@ -1917,9 +1921,9 @@ void lcl_CalcNewWidths( const _FndLines& rFndLines, _CpyPara& rPara )
if( pFndLine && pFndLine->GetBoxes().size() )
{
const SwTableLine *pLine = pFndLine->GetLine();
- if( pLine && pLine->GetTabBoxes().Count() )
+ if( pLine && !pLine->GetTabBoxes().empty() )
{
- sal_uInt16 nBoxCount = pLine->GetTabBoxes().Count();
+ sal_uInt16 nBoxCount = pLine->GetTabBoxes().size();
sal_uLong nPos = 0;
// The first selected box...
const SwTableBox *const pSel =
@@ -2042,7 +2046,7 @@ static void lcl_CopyBoxToDoc(_FndBox const& rFndBox, _CpyPara *const pCpyPara)
{
pBox = new SwTableBox( aFindFrm.pNewFrmFmt,
rFndBox.GetLines().size(), pCpyPara->pInsLine );
- pCpyPara->pInsLine->GetTabBoxes().C40_INSERT( SwTableBox, pBox, pCpyPara->nInsPos++ );
+ pCpyPara->pInsLine->GetTabBoxes().insert( pCpyPara->pInsLine->GetTabBoxes().begin() + pCpyPara->nInsPos++, pBox );
_CpyPara aPara( *pCpyPara, pBox );
aPara.nNewSize = nSize; // get the size
BOOST_FOREACH(_FndLine const& rFndLine, rFndBox.GetLines())
@@ -2146,7 +2150,7 @@ lcl_CopyLineToDoc(const _FndLine& rFndLine, _CpyPara *const pCpyPara)
aPara.nBoxIdx = 1;
}
else if( rFndLine.GetBoxes().size() ==
- rFndLine.GetLine()->GetTabBoxes().Count() )
+ rFndLine.GetLine()->GetTabBoxes().size() )
{
// Get the Parent's size
const SwFrmFmt* pFmt;
@@ -2206,7 +2210,7 @@ sal_Bool SwTable::CopyHeadlineIntoTable( SwTableNode& rTblNd )
if( rTblNd.GetTable().IsNewModel() )
{ // The copied line must not contain any row span attributes > 1
SwTableLine* pLine = rTblNd.GetTable().GetTabLines()[0];
- sal_uInt16 nColCount = pLine->GetTabBoxes().Count();
+ sal_uInt16 nColCount = pLine->GetTabBoxes().size();
OSL_ENSURE( nColCount, "Empty Table Line" );
for( sal_uInt16 nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
{
@@ -2310,14 +2314,18 @@ sal_Bool SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
SwCollectTblLineBoxes aLnPara( sal_False, HEADLINE_BORDERCOPY );
pLn = GetTabLines()[ nLnPos - 1 ];
- pLn->GetTabBoxes().ForEach( &lcl_Box_CollectBox, &aLnPara );
+ for( SwTableBoxes::iterator it = pLn->GetTabBoxes().begin();
+ it != pLn->GetTabBoxes().end(); ++it)
+ lcl_Box_CollectBox( *it, &aLnPara );
if( aLnPara.Resize( lcl_GetBoxOffset( aFndBox ),
lcl_GetLineWidth( *pFndLn )) )
{
aLnPara.SetValues( sal_True );
pLn = pNewTbl->GetTabLines()[ 0 ];
- pLn->GetTabBoxes().ForEach( &lcl_BoxSetSplitBoxFmts, &aLnPara );
+ for( SwTableBoxes::iterator it = pLn->GetTabBoxes().begin();
+ it != pLn->GetTabBoxes().end(); ++it)
+ lcl_BoxSetSplitBoxFmts(*it, &aLnPara );
}
}
@@ -2331,14 +2339,18 @@ sal_Bool SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
SwCollectTblLineBoxes aLnPara( sal_True, HEADLINE_BORDERCOPY );
pLn = GetTabLines()[ nLnPos + 1 ];
- pLn->GetTabBoxes().ForEach( &lcl_Box_CollectBox, &aLnPara );
+ for( SwTableBoxes::iterator it = pLn->GetTabBoxes().begin();
+ it != pLn->GetTabBoxes().end(); ++it)
+ lcl_Box_CollectBox( *it, &aLnPara );
if( aLnPara.Resize( lcl_GetBoxOffset( aFndBox ),
lcl_GetLineWidth( *pFndLn )) )
{
aLnPara.SetValues( sal_False );
pLn = pNewTbl->GetTabLines()[ pNewTbl->GetTabLines().Count()-1 ];
- pLn->GetTabBoxes().ForEach( &lcl_BoxSetSplitBoxFmts, &aLnPara );
+ for( SwTableBoxes::iterator it = pLn->GetTabBoxes().begin();
+ it != pLn->GetTabBoxes().end(); ++it)
+ lcl_BoxSetSplitBoxFmts(*it, &aLnPara );
}
}
}
@@ -2367,9 +2379,9 @@ SwTableBox* SwTableLine::FindNextBox( const SwTable& rTbl,
const SwTableLine* pLine = this; // for M800
SwTableBox* pBox;
sal_uInt16 nFndPos;
- if( GetTabBoxes().Count() && pSrchBox &&
+ if( !GetTabBoxes().empty() && pSrchBox &&
USHRT_MAX != ( nFndPos = GetTabBoxes().GetPos( pSrchBox )) &&
- nFndPos + 1 != GetTabBoxes().Count() )
+ nFndPos + 1 != (sal_uInt16)GetTabBoxes().size() )
{
pBox = GetTabBoxes()[ nFndPos + 1 ];
while( pBox->GetTabLines().Count() )
@@ -2398,11 +2410,11 @@ SwTableBox* SwTableLine::FindNextBox( const SwTable& rTbl,
else
return 0;
- if( pLine->GetTabBoxes().Count() )
+ if( !pLine->GetTabBoxes().empty() )
{
- pBox = pLine->GetTabBoxes()[0];
+ pBox = pLine->GetTabBoxes().front();
while( pBox->GetTabLines().Count() )
- pBox = pBox->GetTabLines()[0]->GetTabBoxes()[0];
+ pBox = pBox->GetTabLines()[0]->GetTabBoxes().front();
return pBox;
}
return pLine->FindNextBox( rTbl, 0, bOvrTblLns );
@@ -2415,7 +2427,7 @@ SwTableBox* SwTableLine::FindPreviousBox( const SwTable& rTbl,
const SwTableLine* pLine = this; // for M800
SwTableBox* pBox;
sal_uInt16 nFndPos;
- if( GetTabBoxes().Count() && pSrchBox &&
+ if( !GetTabBoxes().empty() && pSrchBox &&
USHRT_MAX != ( nFndPos = GetTabBoxes().GetPos( pSrchBox )) &&
nFndPos )
{
@@ -2423,7 +2435,7 @@ SwTableBox* SwTableLine::FindPreviousBox( const SwTable& rTbl,
while( pBox->GetTabLines().Count() )
{
pLine = pBox->GetTabLines()[pBox->GetTabLines().Count()-1];
- pBox = pLine->GetTabBoxes()[pLine->GetTabBoxes().Count()-1];
+ pBox = pLine->GetTabBoxes().back();
}
return pBox;
}
@@ -2449,13 +2461,13 @@ SwTableBox* SwTableLine::FindPreviousBox( const SwTable& rTbl,
else
return 0;
- if( pLine->GetTabBoxes().Count() )
+ if( !pLine->GetTabBoxes().empty() )
{
- pBox = pLine->GetTabBoxes()[pLine->GetTabBoxes().Count()-1];
+ pBox = pLine->GetTabBoxes().back();
while( pBox->GetTabLines().Count() )
{
pLine = pBox->GetTabLines()[pBox->GetTabLines().Count()-1];
- pBox = pLine->GetTabBoxes()[pLine->GetTabBoxes().Count()-1];
+ pBox = pLine->GetTabBoxes().back();
}
return pBox;
}
@@ -2483,20 +2495,22 @@ SwTableBox* SwTableBox::FindPreviousBox( const SwTable& rTbl,
bOvrTblLns );
}
-sal_Bool lcl_BoxSetHeadCondColl( const SwTableBox*& rpBox, void* )
+static sal_Bool lcl_BoxSetHeadCondColl( SwTableBox* pBox )
{
// We need to adapt the paragraphs with conditional templates in the HeadLine
- const SwStartNode* pSttNd = rpBox->GetSttNd();
+ const SwStartNode* pSttNd = pBox->GetSttNd();
if( pSttNd )
pSttNd->CheckSectionCondColl();
else
- ((SwTableBox*)rpBox)->GetTabLines().ForEach( &lcl_LineSetHeadCondColl, 0 );
+ pBox->GetTabLines().ForEach( &lcl_LineSetHeadCondColl, 0 );
return sal_True;
}
sal_Bool lcl_LineSetHeadCondColl( const SwTableLine*& rpLine, void* )
{
- ((SwTableLine*)rpLine)->GetTabBoxes().ForEach( &lcl_BoxSetHeadCondColl, 0 );
+ for( SwTableBoxes::iterator it = ((SwTableLine*)rpLine)->GetTabBoxes().begin();
+ it != ((SwTableLine*)rpLine)->GetTabBoxes().end(); ++it)
+ lcl_BoxSetHeadCondColl(*it);
return sal_True;
}
@@ -2507,7 +2521,7 @@ SwTwips lcl_GetDistance( SwTableBox* pBox, sal_Bool bLeft )
SwTableLine* pLine;
while( pBox && 0 != ( pLine = pBox->GetUpper() ) )
{
- sal_uInt16 nStt = 0, nPos = pLine->GetTabBoxes().C40_GETPOS( SwTableBox, pBox );
+ sal_uInt16 nStt = 0, nPos = pLine->GetTabBoxes().GetPos( pBox );
if( bFirst && !bLeft )
++nPos;
@@ -2525,7 +2539,7 @@ sal_Bool lcl_SetSelBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam,
SwTwips nDist, sal_Bool bCheck )
{
SwTableBoxes& rBoxes = pLine->GetTabBoxes();
- for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rBoxes.size(); ++n )
{
SwTableBox* pBox = rBoxes[ n ];
SwFrmFmt* pFmt = pBox->GetFrmFmt();
@@ -2626,7 +2640,7 @@ sal_Bool lcl_SetOtherBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam,
SwTwips nDist, sal_Bool bCheck )
{
SwTableBoxes& rBoxes = pLine->GetTabBoxes();
- for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rBoxes.size(); ++n )
{
SwTableBox* pBox = rBoxes[ n ];
SwFrmFmt* pFmt = pBox->GetFrmFmt();
@@ -2721,7 +2735,7 @@ sal_Bool lcl_InsSelBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
{
SwTableBoxes& rBoxes = pLine->GetTabBoxes();
sal_uInt16 n, nCmp;
- for( n = 0; n < rBoxes.Count(); ++n )
+ for( n = 0; n < rBoxes.size(); ++n )
{
SwTableBox* pBox = rBoxes[ n ];
SwTableBoxFmt* pFmt = (SwTableBoxFmt*)pBox->GetFrmFmt();
@@ -2865,7 +2879,7 @@ sal_Bool lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
// Find the right width to which the relative width adjustment
// corresponds to
SwTwips nTmpDist = nDist;
- for( n = 0; n < rBoxes.Count(); ++n )
+ for( n = 0; n < rBoxes.size(); ++n )
{
SwTwips nWidth = rBoxes[ n ]->GetFrmFmt()->GetFrmSize().GetWidth();
if( (nTmpDist + nWidth / 2 ) > rParam.nSide )
@@ -2879,7 +2893,7 @@ sal_Bool lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
}
}
- for( n = 0; n < rBoxes.Count(); ++n )
+ for( n = 0; n < rBoxes.size(); ++n )
{
SwTableBox* pBox = rBoxes[ n ];
SwFrmFmt* pFmt = pBox->GetFrmFmt();
@@ -2896,7 +2910,7 @@ sal_Bool lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
if(
rParam.bLeft ? ((nDist + nWidth / 2 ) <= rParam.nSide &&
(TBLFIX_CHGABS != rParam.nMode ||
- (n < rBoxes.Count() &&
+ (n < rBoxes.size() &&
(nDist + nWidth + rBoxes[ n+1 ]->
GetFrmFmt()->GetFrmSize().GetWidth() / 2)
> rParam.nSide) ))
@@ -2960,7 +2974,7 @@ sal_Bool lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
if( nLowerDiff ||
(rParam.bLeft ? ((nDist + nWidth / 2 ) <= rParam.nSide &&
(TBLFIX_CHGABS != rParam.nMode ||
- (n < rBoxes.Count() &&
+ (n < rBoxes.size() &&
(nDist + nWidth + rBoxes[ n+1 ]->
GetFrmFmt()->GetFrmSize().GetWidth() / 2)
> rParam.nSide) ))
@@ -3050,13 +3064,13 @@ void lcl_DelSelBox_CorrLowers( SwTableLine& rLine, CR_SetBoxWidth& rParam,
SwTwips nBoxWidth = 0;
sal_uInt16 n;
- for( n = rBoxes.Count(); n; )
+ for( n = rBoxes.size(); n; )
nBoxWidth += rBoxes[ --n ]->GetFrmFmt()->GetFrmSize().GetWidth();
if( COLFUZZY < Abs( nWidth - nBoxWidth ))
{
// Thus, they need to be adjusted
- for( n = rBoxes.Count(); n; )
+ for( n = rBoxes.size(); n; )
{
SwTableBox* pBox = rBoxes[ --n ];
SwFmtFrmSize aNew( pBox->GetFrmFmt()->GetFrmSize() );
@@ -3164,7 +3178,7 @@ sal_Bool lcl_DeleteBox_Rekursiv( CR_SetBoxWidth& rParam, SwTableBox& rBox,
for( sal_uInt16 i = rBox.GetTabLines().Count(); i; )
{
SwTableLine& rLine = *rBox.GetTabLines()[ --i ];
- for( sal_uInt16 n = rLine.GetTabBoxes().Count(); n; )
+ for( sal_uInt16 n = rLine.GetTabBoxes().size(); n; )
if( !::lcl_DeleteBox_Rekursiv( rParam,
*rLine.GetTabBoxes()[ --n ], bCheck ))
return sal_False;
@@ -3180,7 +3194,7 @@ sal_Bool lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
sal_uInt16 n, nCntEnd, nBoxChkStt, nBoxChkEnd, nDelWidth = 0;
if( rParam.bLeft )
{
- n = rBoxes.Count();
+ n = rBoxes.size();
nCntEnd = 0;
nBoxChkStt = (sal_uInt16)rParam.nSide;
nBoxChkEnd = static_cast<sal_uInt16>(rParam.nSide + rParam.nBoxWidth);
@@ -3188,7 +3202,7 @@ sal_Bool lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
else
{
n = 0;
- nCntEnd = rBoxes.Count();
+ nCntEnd = rBoxes.size();
nBoxChkStt = static_cast<sal_uInt16>(rParam.nSide - rParam.nBoxWidth);
nBoxChkEnd = (sal_uInt16)rParam.nSide;
}
@@ -3325,7 +3339,7 @@ sal_Bool lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
return sal_False;
// Do the Box and its Lines still exist?
- if( n < rBoxes.Count() &&
+ if( n < rBoxes.size() &&
pBox == rBoxes[ rParam.bLeft ? n : n-1 ] &&
i < pBox->GetTabLines().Count() &&
pLine == pBox->GetTabLines()[ i ] )
@@ -3355,7 +3369,7 @@ sal_Bool lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
if( !bCheck )
{
// Has the Box already been removed?
- if( n > rBoxes.Count() ||
+ if( n > rBoxes.size() ||
pBox != rBoxes[ ( rParam.bLeft ? n : n-1 ) ] )
{
// Then change the loop variable when deleting to the right
@@ -3451,7 +3465,7 @@ sal_Bool lcl_DelOtherBox( SwTableLine* , CR_SetBoxWidth& , SwTwips , sal_Bool )
void lcl_AjustLines( SwTableLine* pLine, CR_SetBoxWidth& rParam )
{
SwTableBoxes& rBoxes = pLine->GetTabBoxes();
- for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rBoxes.size(); ++n )
{
SwTableBox* pBox = rBoxes[ n ];
@@ -3912,8 +3926,8 @@ sal_Bool SwTable::SetColWidth( SwTableBox& rAktBox, sal_uInt16 eType,
SwTableLine* pLine = rAktBox.GetUpper();
while( pLine->GetUpper() )
{
- sal_uInt16 nPos = pLine->GetTabBoxes().C40_GETPOS( SwTableBox, pBox );
- if( bLeft ? nPos : nPos + 1 != pLine->GetTabBoxes().Count() )
+ sal_uInt16 nPos = pLine->GetTabBoxes().GetPos( pBox );
+ if( bLeft ? nPos : nPos + 1 != (sal_uInt16)pLine->GetTabBoxes().size() )
break;
pBox = pLine->GetUpper();
@@ -4089,7 +4103,7 @@ void SetLineHeight( SwTableLine& rLine, SwTwips nOldHeight, SwTwips nNewHeight,
// First adapt all internal ones
SwTableBoxes& rBoxes = rLine.GetTabBoxes();
- for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rBoxes.size(); ++n )
{
SwTableBox& rBox = *rBoxes[ n ];
for( sal_uInt16 i = 0; i < rBox.GetTabLines().Count(); ++i )
@@ -4181,11 +4195,11 @@ sal_Bool lcl_InsDelSelLine( SwTableLine* pLine, CR_SetLineHeight& rParam,
{
sal_uInt16 n;
- for( n = rBoxes.Count(); n; )
+ for( n = rBoxes.size(); n; )
::lcl_SaveUpperLowerBorder( rParam.pTblNd->GetTable(),
*rBoxes[ --n ],
rParam.aShareFmts );
- for( n = rBoxes.Count(); n; )
+ for( n = rBoxes.size(); n; )
::_DeleteBox( rParam.pTblNd->GetTable(),
rBoxes[ --n ], rParam.pUndo, sal_False,
sal_False, &rParam.aShareFmts );
@@ -4194,7 +4208,7 @@ sal_Bool lcl_InsDelSelLine( SwTableLine* pLine, CR_SetLineHeight& rParam,
{
// Insert Line
SwTableLine* pNewLine = new SwTableLine( (SwTableLineFmt*)pLine->GetFrmFmt(),
- rBoxes.Count(), pLine->GetUpper() );
+ rBoxes.size(), pLine->GetUpper() );
SwTableLines* pLines;
if( pLine->GetUpper() )
pLines = &pLine->GetUpper()->GetTabLines();
@@ -4210,7 +4224,7 @@ sal_Bool lcl_InsDelSelLine( SwTableLine* pLine, CR_SetLineHeight& rParam,
// And once again calculate the Box count
SwTableBoxes& rNewBoxes = pNewLine->GetTabBoxes();
- for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rBoxes.size(); ++n )
{
SwTwips nWidth = 0;
SwTableBox* pOld = rBoxes[ n ];
@@ -4246,7 +4260,7 @@ sal_Bool lcl_InsDelSelLine( SwTableLine* pLine, CR_SetLineHeight& rParam,
{
// Collect Boxes!
SwTableBoxes& rBoxes = pLine->GetTabBoxes();
- for( sal_uInt16 n = rBoxes.Count(); n; )
+ for( sal_uInt16 n = rBoxes.size(); n; )
{
SwTableBox* pBox = rBoxes[ --n ];
if( pBox->GetFrmFmt()->GetProtect().IsCntntProtected() )
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index 9b1ec4c..a698cd6 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -324,17 +324,13 @@ struct _CopyTable
{}
};
-sal_Bool lcl_CopyTblBox( const SwTableBox*& rpBox, void* pPara );
-
sal_Bool lcl_CopyTblLine( const SwTableLine*& rpLine, void* pPara );
-sal_Bool lcl_CopyTblBox( const SwTableBox*& rpBox, void* pPara )
+static void lcl_CopyTblBox( SwTableBox* pBox, _CopyTable* pCT )
{
- _CopyTable* pCT = reinterpret_cast< _CopyTable* >(pPara);
-
- SwTableBoxFmt* pBoxFmt = (SwTableBoxFmt*)rpBox->GetFrmFmt();
+ SwTableBoxFmt* pBoxFmt = (SwTableBoxFmt*)pBox->GetFrmFmt();
pCT->rMapArr.ForEach( lcl_SrchNew, &pBoxFmt );
- if( pBoxFmt == rpBox->GetFrmFmt() ) // ein neues anlegen ??
+ if( pBoxFmt == pBox->GetFrmFmt() ) // ein neues anlegen ??
{
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == pBoxFmt->GetItemState( RES_BOXATR_FORMULA, sal_False,
@@ -344,9 +340,9 @@ sal_Bool lcl_CopyTblBox( const SwTableBox*& rpBox, void* pPara )
}
pBoxFmt = pCT->pDoc->MakeTableBoxFmt();
- pBoxFmt->CopyAttrs( *rpBox->GetFrmFmt() );
+ pBoxFmt->CopyAttrs( *pBox->GetFrmFmt() );
- if( rpBox->GetSttIdx() )
+ if( pBox->GetSttIdx() )
{
SvNumberFormatter* pN = pCT->pDoc->GetNumberFormatter( sal_False );
if( pN && pN->HasMergeFmtTbl() && SFX_ITEM_SET == pBoxFmt->
@@ -360,36 +356,34 @@ sal_Bool lcl_CopyTblBox( const SwTableBox*& rpBox, void* pPara )
}
}
- pCT->rMapArr.Insert( _MapTblFrmFmt( rpBox->GetFrmFmt(), pBoxFmt ),
+ pCT->rMapArr.Insert( _MapTblFrmFmt( pBox->GetFrmFmt(), pBoxFmt ),
pCT->rMapArr.Count() );
}
- sal_uInt16 nLines = rpBox->GetTabLines().Count();
+ sal_uInt16 nLines = pBox->GetTabLines().Count();
SwTableBox* pNewBox;
if( nLines )
pNewBox = new SwTableBox( pBoxFmt, nLines, pCT->pInsLine );
else
{
SwNodeIndex aNewIdx( *pCT->pTblNd,
- rpBox->GetSttIdx() - pCT->nOldTblSttIdx );
+ pBox->GetSttIdx() - pCT->nOldTblSttIdx );
OSL_ENSURE( aNewIdx.GetNode().IsStartNode(), "Index nicht auf einem StartNode" );
pNewBox = new SwTableBox( pBoxFmt, aNewIdx, pCT->pInsLine );
- pNewBox->setRowSpan( rpBox->getRowSpan() );
+ pNewBox->setRowSpan( pBox->getRowSpan() );
}
- pCT->pInsLine->GetTabBoxes().C40_INSERT( SwTableBox, pNewBox,
- pCT->pInsLine->GetTabBoxes().Count() );
+ pCT->pInsLine->GetTabBoxes().push_back( pNewBox );
if( nLines )
{
_CopyTable aPara( *pCT );
aPara.pInsBox = pNewBox;
- ((SwTableBox*)rpBox)->GetTabLines().ForEach( &lcl_CopyTblLine, &aPara );
+ pBox->GetTabLines().ForEach( &lcl_CopyTblLine, &aPara );
}
else if( pNewBox->IsInHeadline( &pCT->pTblNd->GetTable() ))
// in der HeadLine sind die Absaetze mit BedingtenVorlage anzupassen
pNewBox->GetSttNd()->CheckSectionCondColl();
- return sal_True;
}
sal_Bool lcl_CopyTblLine( const SwTableLine*& rpLine, void* pPara )
@@ -405,7 +399,7 @@ sal_Bool lcl_CopyTblLine( const SwTableLine*& rpLine, void* pPara )
pCT->rMapArr.Count());
}
SwTableLine* pNewLine = new SwTableLine( pLineFmt,
- rpLine->GetTabBoxes().Count(), pCT->pInsBox );
+ rpLine->GetTabBoxes().size(), pCT->pInsBox );
// die neue Zeile in die Tabelle eintragen
if( pCT->pInsBox )
{
@@ -418,7 +412,9 @@ sal_Bool lcl_CopyTblLine( const SwTableLine*& rpLine, void* pPara )
pCT->pTblNd->GetTable().GetTabLines().Count() );
}
pCT->pInsLine = pNewLine;
- ((SwTableLine*)rpLine)->GetTabBoxes().ForEach( &lcl_CopyTblBox, pCT );
+ for( SwTableBoxes::iterator it = ((SwTableLine*)rpLine)->GetTabBoxes().begin();
+ it != ((SwTableLine*)rpLine)->GetTabBoxes().end(); ++it)
+ lcl_CopyTblBox(*it, pCT );
return sal_True;
}
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 2d23145..a6efdba 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -250,9 +250,9 @@ sal_Bool SwNodes::InsBoxen( SwTableNode* pTblNd,
// Index hinter die letzte Box der Line
sal_uLong nIdxPos = 0;
SwTableBox *pPrvBox = 0, *pNxtBox = 0;
- if( pLine->GetTabBoxes().Count() )
+ if( !pLine->GetTabBoxes().empty() )
{
- if( nInsPos < pLine->GetTabBoxes().Count() )
+ if( nInsPos < pLine->GetTabBoxes().size() )
{
if( 0 == (pPrvBox = pLine->FindPreviousBox( pTblNd->GetTable(),
pLine->GetTabBoxes()[ nInsPos ] )))
@@ -261,7 +261,7 @@ sal_Bool SwNodes::InsBoxen( SwTableNode* pTblNd,
else
{
if( 0 == (pNxtBox = pLine->FindNextBox( pTblNd->GetTable(),
- pLine->GetTabBoxes()[ pLine->GetTabBoxes().Count()-1 ] )))
+ pLine->GetTabBoxes().back() )))
pNxtBox = pLine->FindNextBox( pTblNd->GetTable() );
}
}
@@ -307,10 +307,10 @@ sal_Bool SwNodes::InsBoxen( SwTableNode* pTblNd,
SwTableBoxes & rTabBoxes = pLine->GetTabBoxes();
sal_uInt16 nRealInsPos = nInsPos + n;
- if (nRealInsPos > rTabBoxes.Count())
- nRealInsPos = rTabBoxes.Count();
+ if (nRealInsPos > rTabBoxes.size())
+ nRealInsPos = rTabBoxes.size();
- rTabBoxes.C40_INSERT( SwTableBox, pPrvBox, nRealInsPos );
+ rTabBoxes.insert( rTabBoxes.begin() + nRealInsPos, pPrvBox );
if( ! pTxtColl->IsAssignedToListLevelOfOutlineStyle()//<-end,zhaojianwei
//FEATURE::CONDCOLL
@@ -544,7 +544,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
}
SwTableBox *pBox = new SwTableBox( pBoxF, aNdIdx, pLine);
- rBoxes.C40_INSERT( SwTableBox, pBox, i );
+ rBoxes.insert( rBoxes.begin() + i, pBox );
aNdIdx += 3; // StartNode, TextNode, EndNode == 3 Nodes
}
}
@@ -775,7 +775,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
for( sal_uInt16 n = 0; n < nRows; ++n )
{
SwTableBoxes& rBoxes = rLines[ n ]->GetTabBoxes();
- sal_uInt16 nCols = rBoxes.Count();
+ sal_uInt16 nCols = rBoxes.size();
for( sal_uInt16 i = 0; i < nCols; ++i )
{
SwTableBox* pBox = rBoxes[ i ];
@@ -1007,7 +1007,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
// Section der Box zuweisen
pBox = new SwTableBox( pBoxFmt, *pSttNd, pLine );
- pLine->GetTabBoxes().C40_INSERT( SwTableBox, pBox, nBoxes++ );
+ pLine->GetTabBoxes().insert( pLine->GetTabBoxes().begin() + nBoxes++, pBox );
}
// und jetzt den letzten Teil-String
@@ -1021,7 +1021,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
pTxtNd->pStartOfSection = pSttNd;
pBox = new SwTableBox( pBoxFmt, *pSttNd, pLine );
- pLine->GetTabBoxes().C40_INSERT( SwTableBox, pBox, nBoxes++ );
+ pLine->GetTabBoxes().insert( pLine->GetTabBoxes().begin() + nBoxes++, pBox );
if( nMaxBoxes < nBoxes )
nMaxBoxes = nBoxes;
}
@@ -1032,7 +1032,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
for( n = 0; n < pTable->GetTabLines().Count(); ++n )
{
SwTableLine* pCurrLine = pTable->GetTabLines()[ n ];
- if( nMaxBoxes != ( nBoxes = pCurrLine->GetTabBoxes().Count() ))
+ if( nMaxBoxes != ( nBoxes = pCurrLine->GetTabBoxes().size() ))
{
InsBoxen( pTblNd, pCurrLine, pBoxFmt, pTxtColl, 0,
nBoxes, nMaxBoxes - nBoxes );
@@ -1366,7 +1366,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes,
// Section der Box zuweisen
pBox = new SwTableBox( pBoxFmt, *pSttNd, pLine );
- pLine->GetTabBoxes().C40_INSERT( SwTableBox, pBox, nBoxes++ );
+ pLine->GetTabBoxes().insert( pLine->GetTabBoxes().begin() + nBoxes++, pBox );
}
if( nMaxBoxes < nBoxes )
nMaxBoxes = nBoxes;
@@ -1468,13 +1468,15 @@ struct _DelTabPara
// forward deklarieren damit sich die Lines und Boxen rekursiv aufrufen
// koennen.
-sal_Bool lcl_DelBox( const SwTableBox*&, void *pPara );
+static void lcl_DelBox( SwTableBox* pBox, _DelTabPara* pDelPara );
sal_Bool lcl_DelLine( const SwTableLine*& rpLine, void* pPara )
{
OSL_ENSURE( pPara, "die Parameter fehlen" );
_DelTabPara aPara( *(_DelTabPara*)pPara );
- ((SwTableLine*&)rpLine)->GetTabBoxes().ForEach( &lcl_DelBox, &aPara );
+ for( SwTableBoxes::iterator it = ((SwTableLine*)rpLine)->GetTabBoxes().begin();
+ it != ((SwTableLine*)rpLine)->GetTabBoxes().end(); ++it)
+ lcl_DelBox(*it, &aPara );
if( rpLine->GetUpper() ) // gibt es noch eine uebergeordnete Box ??
// dann gebe den letzten TextNode zurueck
((_DelTabPara*)pPara)->pLastNd = aPara.pLastNd;
@@ -1482,19 +1484,18 @@ sal_Bool lcl_DelLine( const SwTableLine*& rpLine, void* pPara )
}
-sal_Bool lcl_DelBox( const SwTableBox*& rpBox, void* pPara )
+static void lcl_DelBox( SwTableBox* pBox, _DelTabPara* pDelPara )
{
- OSL_ENSURE( pPara, "die Parameter fehlen" );
+ OSL_ENSURE( pDelPara, "die Parameter fehlen" );
// loesche erstmal die Lines der Box
- _DelTabPara* pDelPara = (_DelTabPara*)pPara;
- if( rpBox->GetTabLines().Count() )
- ((SwTableBox*&)rpBox)->GetTabLines().ForEach( &lcl_DelLine, pDelPara );
+ if( pBox->GetTabLines().Count() )
+ pBox->GetTabLines().ForEach( &lcl_DelLine, pDelPara );
else
{
SwDoc* pDoc = pDelPara->rNds.GetDoc();
- SwNodeRange aDelRg( *rpBox->GetSttNd(), 0,
- *rpBox->GetSttNd()->EndOfSectionNode() );
+ SwNodeRange aDelRg( *pBox->GetSttNd(), 0,
+ *pBox->GetSttNd()->EndOfSectionNode() );
// loesche die Section
pDelPara->rNds.SectionUp( &aDelRg );
const SwTxtNode* pCurTxtNd;
@@ -1542,7 +1543,6 @@ sal_Bool lcl_DelBox( const SwTableBox*& rpBox, void* pPara )
if( pDelPara->pLastNd && pDelPara->pLastNd->HasSwAttrSet() )
pDelPara->pLastNd->ResetAttr( RES_PARATR_ADJUST );
}
- return sal_True;
}
@@ -1841,13 +1841,12 @@ sal_Bool SwDoc::DeleteRow( const SwCursor& rCursor )
}
SwTableLine* pDelLine = pFndBox->GetLines().back().GetLine();
- SwTableBox* pDelBox = pDelLine->GetTabBoxes()[
- pDelLine->GetTabBoxes().Count() - 1 ];
+ SwTableBox* pDelBox = pDelLine->GetTabBoxes().back();
while( !pDelBox->GetSttNd() )
{
SwTableLine* pLn = pDelBox->GetTabLines()[
pDelBox->GetTabLines().Count()-1 ];
- pDelBox = pLn->GetTabBoxes()[ pLn->GetTabBoxes().Count() - 1 ];
+ pDelBox = pLn->GetTabBoxes().back();
}
SwTableBox* pNextBox = pDelLine->FindNextBox( pTblNd->GetTable(),
pDelBox, sal_True );
@@ -3007,16 +3006,19 @@ sal_Bool lcl_Line_CollectBox( const SwTableLine*& rpLine, void* pPara )
{
SwCollectTblLineBoxes* pSplPara = (SwCollectTblLineBoxes*)pPara;
if( pSplPara->IsGetValues() )
- ((SwTableLine*)rpLine)->GetTabBoxes().ForEach( &lcl_Box_CollectBox, pPara );
+ for( SwTableBoxes::iterator it = ((SwTableLine*)rpLine)->GetTabBoxes().begin();
+ it != ((SwTableLine*)rpLine)->GetTabBoxes().end(); ++it)
+ lcl_Box_CollectBox(*it, pSplPara );
else
- ((SwTableLine*)rpLine)->GetTabBoxes().ForEach( &lcl_BoxSetSplitBoxFmts, pPara );
+ for( SwTableBoxes::iterator it = ((SwTableLine*)rpLine)->GetTabBoxes().begin();
+ it != ((SwTableLine*)rpLine)->GetTabBoxes().end(); ++it)
+ lcl_BoxSetSplitBoxFmts(*it, pSplPara );
return sal_True;
}
-sal_Bool lcl_Box_CollectBox( const SwTableBox*& rpBox, void* pPara )
+void lcl_Box_CollectBox( const SwTableBox* pBox, SwCollectTblLineBoxes* pSplPara )
{
- SwCollectTblLineBoxes* pSplPara = (SwCollectTblLineBoxes*)pPara;
- sal_uInt16 nLen = rpBox->GetTabLines().Count();
+ sal_uInt16 nLen = pBox->GetTabLines().Count();
if( nLen )
{
// dann mit der richtigen Line weitermachen
@@ -3025,18 +3027,16 @@ sal_Bool lcl_Box_CollectBox( const SwTableBox*& rpBox, void* pPara )
else
--nLen;
- const SwTableLine* pLn = rpBox->GetTabLines()[ nLen ];
- lcl_Line_CollectBox( pLn, pPara );
+ const SwTableLine* pLn = pBox->GetTabLines()[ nLen ];
+ lcl_Line_CollectBox( pLn, pSplPara );
}
else
- pSplPara->AddBox( *rpBox );
- return sal_True;
+ pSplPara->AddBox( *pBox );
}
-sal_Bool lcl_BoxSetSplitBoxFmts( const SwTableBox*& rpBox, void* pPara )
+void lcl_BoxSetSplitBoxFmts( SwTableBox* pBox, SwCollectTblLineBoxes* pSplPara )
{
- SwCollectTblLineBoxes* pSplPara = (SwCollectTblLineBoxes*)pPara;
- sal_uInt16 nLen = rpBox->GetTabLines().Count();
+ sal_uInt16 nLen = pBox->GetTabLines().Count();
if( nLen )
{
// dann mit der richtigen Line weitermachen
@@ -3045,14 +3045,13 @@ sal_Bool lcl_BoxSetSplitBoxFmts( const SwTableBox*& rpBox, void* pPara )
else
--nLen;
- const SwTableLine* pLn = rpBox->GetTabLines()[ nLen ];
- lcl_Line_CollectBox( pLn, pPara );
+ const SwTableLine* pLn = pBox->GetTabLines()[ nLen ];
+ lcl_Line_CollectBox( pLn, pSplPara );
}
else
{
- const SwTableBox* pSrcBox = pSplPara->GetBoxOfPos( *rpBox );
+ const SwTableBox* pSrcBox = pSplPara->GetBoxOfPos( *pBox );
SwFrmFmt* pFmt = pSrcBox->GetFrmFmt();
- SwTableBox* pBox = (SwTableBox*)rpBox;
if( HEADLINE_BORDERCOPY == pSplPara->GetMode() )
{
@@ -3101,7 +3100,6 @@ sal_uInt16 aTableSplitBoxSetRange[] = {
pBox->GetSttNd()->CheckSectionCondColl();
}
}
- return sal_True;
}
@@ -3177,11 +3175,15 @@ sal_Bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode,
SwCollectTblLineBoxes aPara( sal_False, eHdlnMode );
SwTableLine* pLn = rTbl.GetTabLines()[
rTbl.GetTabLines().Count() - 1 ];
- pLn->GetTabBoxes().ForEach( &lcl_Box_CollectBox, &aPara );
+ for( SwTableBoxes::iterator it = pLn->GetTabBoxes().begin();
+ it != pLn->GetTabBoxes().end(); ++it)
+ lcl_Box_CollectBox(*it, &aPara );
aPara.SetValues( sal_True );
pLn = pNew->GetTable().GetTabLines()[ 0 ];
- pLn->GetTabBoxes().ForEach( &lcl_BoxSetSplitBoxFmts, &aPara );
+ for( SwTableBoxes::iterator it = pLn->GetTabBoxes().begin();
+ it != pLn->GetTabBoxes().end(); ++it)
+ lcl_BoxSetSplitBoxFmts(*it, &aPara );
// Kopfzeile wiederholen abschalten
pNew->GetTable().SetRowsToRepeat( 0 );
@@ -3198,11 +3200,15 @@ sal_Bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode,
SwCollectTblLineBoxes aPara( sal_True, eHdlnMode, pHst );
SwTableLine* pLn = rTbl.GetTabLines()[ 0 ];
- pLn->GetTabBoxes().ForEach( &lcl_Box_CollectBox, &aPara );
+ for( SwTableBoxes::iterator it = pLn->GetTabBoxes().begin();
+ it != pLn->GetTabBoxes().end(); ++it)
+ lcl_Box_CollectBox(*it, &aPara );
aPara.SetValues( sal_True );
pLn = pNew->GetTable().GetTabLines()[ 0 ];
- pLn->GetTabBoxes().ForEach( &lcl_BoxSetSplitBoxFmts, &aPara );
+ for( SwTableBoxes::iterator it = pLn->GetTabBoxes().begin();
+ it != pLn->GetTabBoxes().end(); ++it)
+ lcl_BoxSetSplitBoxFmts(*it, &aPara );
}
break;
@@ -3260,7 +3266,7 @@ sal_Bool lcl_ChgTblSize( SwTable& rTbl )
{
SwTwips nMaxLnWidth = 0;
SwTableBoxes& rBoxes = rLns[ nLns ]->GetTabBoxes();
- for( sal_uInt16 nBox = 0; nBox < rBoxes.Count(); ++nBox )
+ for( sal_uInt16 nBox = 0; nBox < rBoxes.size(); ++nBox )
nMaxLnWidth += rBoxes[nBox]->GetFrmFmt()->GetFrmSize().GetWidth();
if( nMaxLnWidth > aTblMaxSz.GetWidth() )
@@ -3303,7 +3309,7 @@ public:
};
-sal_Bool lcl_SplitTable_CpyBox( const SwTableBox*& rpBox, void* pPara );
+static void lcl_SplitTable_CpyBox( SwTableBox* pBox, _SplitTable_Para* pPara );
sal_Bool lcl_SplitTable_CpyLine( const SwTableLine*& rpLine, void* pPara )
{
@@ -3320,30 +3326,28 @@ sal_Bool lcl_SplitTable_CpyLine( const SwTableLine*& rpLine, void* pPara )
else
pLn->ChgFrmFmt( (SwTableLineFmt*)rPara.DestFmt_Get( nPos ) );
- pLn->GetTabBoxes().ForEach( &lcl_SplitTable_CpyBox, pPara );
+ for( SwTableBoxes::iterator it = pLn->GetTabBoxes().begin();
+ it != pLn->GetTabBoxes().end(); ++it)
+ lcl_SplitTable_CpyBox(*it, (_SplitTable_Para*)pPara );
return sal_True;
}
-sal_Bool lcl_SplitTable_CpyBox( const SwTableBox*& rpBox, void* pPara )
+static void lcl_SplitTable_CpyBox( SwTableBox* pBox, _SplitTable_Para* pPara )
{
- SwTableBox* pBox = (SwTableBox*)rpBox;
- _SplitTable_Para& rPara = *(_SplitTable_Para*)pPara;
-
SwFrmFmt *pSrcFmt = pBox->GetFrmFmt();
- sal_uInt16 nPos = rPara.SrcFmt_GetPos( pSrcFmt );
+ sal_uInt16 nPos = pPara->SrcFmt_GetPos( pSrcFmt );
if( USHRT_MAX == nPos )
{
- rPara.DestFmt_Insert( pBox->ClaimFrmFmt() );
- rPara.SrcFmt_Insert( pSrcFmt );
+ pPara->DestFmt_Insert( pBox->ClaimFrmFmt() );
+ pPara->SrcFmt_Insert( pSrcFmt );
}
else
- pBox->ChgFrmFmt( (SwTableBoxFmt*)rPara.DestFmt_Get( nPos ) );
+ pBox->ChgFrmFmt( (SwTableBoxFmt*)pPara->DestFmt_Get( nPos ) );
if( pBox->GetSttNd() )
- rPara.ChgBox( pBox );
+ pPara->ChgBox( pBox );
else
pBox->GetTabLines().ForEach( &lcl_SplitTable_CpyLine, pPara );
- return sal_True;
}
SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, sal_Bool bAfter,
@@ -3415,7 +3419,7 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, sal_Bool bAfter,
for (sal_uInt16 k = nLinePos; k < rTbl.GetTabLines().Count(); ++k)
{
sal_uInt16 nLineIdx = (rTbl.GetTabLines().Count() - 1) - k + nLinePos;
- sal_uInt16 nBoxCnt = rTbl.GetTabLines()[ nLineIdx ]->GetTabBoxes().Count();
+ sal_uInt16 nBoxCnt = rTbl.GetTabLines()[ nLineIdx ]->GetTabBoxes().size();
for (sal_uInt16 j = 0; j < nBoxCnt; ++j)
{
sal_uInt16 nIdx = nBoxCnt - 1 - j;
diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx
index 7f8b593..9da8c06 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -307,7 +307,7 @@ void lcl_ProcessRowSize( SvPtrarr &rFmtCmp, SwTableLine *pLine, const SwFmtFrmSi
{
lcl_ProcessRowAttr( rFmtCmp, pLine, rNew );
SwTableBoxes &rBoxes = pLine->GetTabBoxes();
- for ( sal_uInt16 i = 0; i < rBoxes.Count(); ++i )
+ for ( sal_uInt16 i = 0; i < rBoxes.size(); ++i )
::lcl_ProcessBoxSize( rFmtCmp, rBoxes[i], rNew );
}
diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx
index 700de05..097fb66 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -276,7 +276,7 @@ sal_Bool SwTblCalcPara::CalcWithStackOverflow()
SwTableBox* pBox = (SwTableBox*)pLastTblBox;
nStackCnt = 0;
rCalc.SetCalcError( CALC_NOERR );
- aStackOverFlows.C40_INSERT( SwTableBox, pBox, nCnt++ );
+ aStackOverFlows.insert( aStackOverFlows.begin() + nCnt++, pBox );
pBoxStk->Remove( pBox );
pBox->GetValue( *this );
@@ -297,7 +297,7 @@ sal_Bool SwTblCalcPara::CalcWithStackOverflow()
}
nMaxSize = nSaveMaxSize;
- aStackOverFlows.Remove( 0, aStackOverFlows.Count() );
+ aStackOverFlows.clear();
return !rCalc.IsCalcError();
}
@@ -786,7 +786,7 @@ const SwTableBox* lcl_RelToBox( const SwTable& rTbl,
// dann suche die Box
pBoxes = &pLine->GetTabBoxes();
- if( nBoxOffset >= long(pBoxes->Count()) )
+ if( nBoxOffset >= long(pBoxes->size()) )
return 0;
pBox = (*pBoxes)[ sal_uInt16(nBoxOffset) ];
@@ -806,7 +806,7 @@ const SwTableBox* lcl_RelToBox( const SwTable& rTbl,
// bestimme die Box
pBoxes = &pLine->GetTabBoxes();
- if( nSttBox >= pBoxes->Count() )
+ if( nSttBox >= pBoxes->size() )
break;
pBox = (*pBoxes)[ nSttBox ];
}
diff --git a/sw/source/core/fields/ddetbl.cxx b/sw/source/core/fields/ddetbl.cxx
index c186a38..f13f79f 100644
--- a/sw/source/core/fields/ddetbl.cxx
+++ b/sw/source/core/fields/ddetbl.cxx
@@ -128,7 +128,7 @@ void SwDDETable::ChangeContent()
{
String aLine = aExpand.GetToken( n, '\n' );
SwTableLine* pLine = aLines[ n ];
- for( sal_uInt16 i = 0; i < pLine->GetTabBoxes().Count(); ++i )
+ for( sal_uInt16 i = 0; i < pLine->GetTabBoxes().size(); ++i )
{
SwTableBox* pBox = pLine->GetTabBoxes()[ i ];
OSL_ENSURE( pBox->GetSttIdx(), "keine InhaltsBox" );
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index 28938d0..73387b0 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -399,13 +399,12 @@ sal_Bool SwFEShell::DeleteRow()
}
SwTableLine* pDelLine = pFndBox->GetLines().back().GetLine();
- SwTableBox* pDelBox = pDelLine->GetTabBoxes()[
- pDelLine->GetTabBoxes().Count() - 1 ];
+ SwTableBox* pDelBox = pDelLine->GetTabBoxes().back();
while( !pDelBox->GetSttNd() )
{
SwTableLine* pLn = pDelBox->GetTabLines()[
pDelBox->GetTabLines().Count()-1 ];
- pDelBox = pLn->GetTabBoxes()[ pLn->GetTabBoxes().Count() - 1 ];
+ pDelBox = pLn->GetTabBoxes().back();
}
SwTableBox* pNextBox = pDelLine->FindNextBox( pTblNd->GetTable(),
pDelBox, sal_True );
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index ade24da..ed442cd 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -258,7 +258,7 @@ void GetTblSel( const SwCursor& rCrsr, SwSelBoxes& rBoxes,
for( ; nSttPos <= nEndPos; ++nSttPos )
{
pLine = rLines[ nSttPos ];
- for( sal_uInt16 n = pLine->GetTabBoxes().Count(); n ; )
+ for( sal_uInt16 n = pLine->GetTabBoxes().size(); n ; )
{
SwTableBox* pBox = pLine->GetTabBoxes()[ --n ];
// check for cell protection??
@@ -955,7 +955,6 @@ sal_Bool IsEmptyBox( const SwTableBox& rBox, SwPaM& rPam )
return bRet;
}
-
void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
SwTableBox** ppMergeBox, SwUndoTblMerge* pUndo )
{
@@ -1027,7 +1026,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
if( ( rUnion.Right() + COLFUZZY ) < pCell->Frm().Right() )
{
sal_uInt16 nInsPos = pBox->GetUpper()->
- GetTabBoxes().C40_GETPOS( SwTableBox, pBox )+1;
+ GetTabBoxes().GetPos( pBox )+1;
lcl_InsTblBox( pTblNd, pDoc, pBox, nInsPos );
pBox->ClaimFrmFmt();
SwFmtFrmSize aNew(
@@ -1070,8 +1069,8 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
else if( ( rUnion.Left() - COLFUZZY ) >= pCell->Frm().Left() &&
( rUnion.Right() + COLFUZZY ) < pCell->Frm().Right() )
{
- sal_uInt16 nInsPos = pBox->GetUpper()->GetTabBoxes().
- C40_GETPOS( SwTableBox, pBox )+1;
+ sal_uInt16 nInsPos = pBox->GetUpper()->GetTabBoxes().GetPos(
+ pBox )+1;
lcl_InsTblBox( pTblNd, pDoc, pBox, nInsPos, 2 );
pBox->ClaimFrmFmt();
SwFmtFrmSize aNew(
@@ -1127,8 +1126,8 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
( pCell->Frm().Left() + COLFUZZY ) < rUnion.Left() )
{
// then we should insert a new box and adjust the widths
- sal_uInt16 nInsPos = pBox->GetUpper()->GetTabBoxes().
- C40_GETPOS( SwTableBox, pBox )+1;
+ sal_uInt16 nInsPos = pBox->GetUpper()->GetTabBoxes().GetPos(
+ pBox )+1;
lcl_InsTblBox( pTblNd, pDoc, pBox, nInsPos, 1 );
SwFmtFrmSize aNew(pBox->GetFrmFmt()->GetFrmSize() );
@@ -1362,11 +1361,11 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
{
SwTableBox* pTmpBox = rBoxes[0];
SwTableLine* pInsLine = pTmpBox->GetUpper();
- sal_uInt16 nInsPos = pInsLine->GetTabBoxes().C40_GETPOS( SwTableBox, pTmpBox );
+ sal_uInt16 nInsPos = pInsLine->GetTabBoxes().GetPos( pTmpBox );
lcl_InsTblBox( pTblNd, pDoc, pTmpBox, nInsPos );
(*ppMergeBox) = pInsLine->GetTabBoxes()[ nInsPos ];
- pInsLine->GetTabBoxes().Remove( nInsPos ); // remove again
+ pInsLine->GetTabBoxes().erase( pInsLine->GetTabBoxes().begin() + nInsPos ); // remove again
(*ppMergeBox)->SetUpper( 0 );
(*ppMergeBox)->ClaimFrmFmt();
@@ -2099,32 +2098,29 @@ void lcl_InsertRow( SwTableLine &rLine, SwLayoutFrm *pUpper, SwFrm *pSibling )
}
-sal_Bool _FndBoxCopyCol( const SwTableBox*& rpBox, void* pPara )
+static void _FndBoxCopyCol( SwTableBox* pBox, _FndPara* pFndPara )
{
- _FndPara* pFndPara = (_FndPara*)pPara;
- _FndBox* pFndBox = new _FndBox( (SwTableBox*)rpBox, pFndPara->pFndLine );
- if( rpBox->GetTabLines().Count() )
+ _FndBox* pFndBox = new _FndBox( pBox, pFndPara->pFndLine );
+ if( pBox->GetTabLines().Count() )
{
_FndPara aPara( *pFndPara, pFndBox );
pFndBox->GetBox()->GetTabLines().ForEach( &_FndLineCopyCol, &aPara );
if( pFndBox->GetLines().empty() )
{
delete pFndBox;
- return sal_True;
+ return;
}
}
else
{
- SwTableBoxPtr pSrch = (SwTableBoxPtr)rpBox;
sal_uInt16 nFndPos;
- if( !pFndPara->rBoxes.Seek_Entry( pSrch, &nFndPos ))
+ if( !pFndPara->rBoxes.Seek_Entry( pBox, &nFndPos ))
{
delete pFndBox;
- return sal_True;
+ return;
}
}
pFndPara->pFndLine->GetBoxes().push_back( pFndBox );
- return sal_True;
}
sal_Bool _FndLineCopyCol( const SwTableLine*& rpLine, void* pPara )
@@ -2132,7 +2128,9 @@ sal_Bool _FndLineCopyCol( const SwTableLine*& rpLine, void* pPara )
_FndPara* pFndPara = (_FndPara*)pPara;
_FndLine* pFndLine = new _FndLine( (SwTableLine*)rpLine, pFndPara->pFndBox );
_FndPara aPara( *pFndPara, pFndLine );
- pFndLine->GetLine()->GetTabBoxes().ForEach( &_FndBoxCopyCol, &aPara );
+ for( SwTableBoxes::iterator it = pFndLine->GetLine()->GetTabBoxes().begin();
+ it != pFndLine->GetLine()->GetTabBoxes().end(); ++it)
+ _FndBoxCopyCol(*it, &aPara );
if( pFndLine->GetBoxes().size() )
{
pFndPara->pFndBox->GetLines().push_back( pFndLine );
diff --git a/sw/source/core/inc/tblrwcl.hxx b/sw/source/core/inc/tblrwcl.hxx
index 5623e95..6f11e22 100644
--- a/sw/source/core/inc/tblrwcl.hxx
+++ b/sw/source/core/inc/tblrwcl.hxx
@@ -50,7 +50,6 @@ class SwFmtFrmSize;
struct _CpyPara;
struct _InsULPara;
-sal_Bool lcl_BoxSetHeadCondColl( const SwTableBox*& rpBox, void* pPara );
sal_Bool lcl_LineSetHeadCondColl( const SwTableLine*& rpLine, void* pPara );
@@ -111,10 +110,10 @@ public:
sal_Bool Resize( sal_uInt16 nOffset, sal_uInt16 nWidth );
};
-sal_Bool lcl_Box_CollectBox( const SwTableBox*& rpBox, void* pPara );
+void lcl_Box_CollectBox( const SwTableBox* pBox, SwCollectTblLineBoxes* pSplPara );
sal_Bool lcl_Line_CollectBox( const SwTableLine*& rpLine, void* pPara );
-sal_Bool lcl_BoxSetSplitBoxFmts( const SwTableBox*& rpBox, void* pPara );
+void lcl_BoxSetSplitBoxFmts( SwTableBox* pBox, SwCollectTblLineBoxes* pSplPara );
// This structure is needed by Undo to restore row span attributes
// when a table has been splitted into two tables
@@ -157,13 +156,11 @@ public:
};
sal_Bool lcl_GC_Line_Border( const SwTableLine*& , void* pPara );
-sal_Bool lcl_GC_Box_Border( const SwTableBox*& , void* pPara );
sal_Bool lcl_GCBorder_ChkBoxBrd_L( const SwTableLine*& , void* pPara );
sal_Bool lcl_GCBorder_ChkBoxBrd_B( const SwTableBox*& , void* pPara );
sal_Bool lcl_GCBorder_GetLastBox_L( const SwTableLine*& , void* pPara );
-sal_Bool lcl_GCBorder_GetLastBox_B( const SwTableBox*& , void* pPara );
class SwShareBoxFmt
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index e08182f..27d8ffd 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -3676,10 +3676,10 @@ SwRowFrm::SwRowFrm( const SwTableLine &rLine, SwFrm* pSib, bool bInsertContent )
nType = FRMC_ROW;
//Create the boxes and insert them.
- const SwTableBoxes &rBoxes = rLine.GetTabBoxes();
+ const SwTableBoxes &rBoxes = rLine.GetTabBoxes();
SwFrm *pTmpPrev = 0;
- for ( sal_uInt16 i = 0; i < rBoxes.Count(); ++i )
- {
+ for ( sal_uInt16 i = 0; i < rBoxes.size(); ++i )
+ {
SwCellFrm *pNew = new SwCellFrm( *rBoxes[i], this, bInsertContent );
pNew->InsertBehind( this, pTmpPrev );
pTmpPrev = pNew;
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index 80e8bba..8f59ac2 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -128,10 +128,10 @@ if bSet is true, rMin and rMax will be set to the left and right border of the b
void lcl_CheckMinMax( long& rMin, long& rMax, const SwTableLine& rLine, sal_uInt16 nCheck, bool bSet )
{
++nCheck;
- if( rLine.GetTabBoxes().Count() < nCheck )
+ if( rLine.GetTabBoxes().size() < nCheck )
{ // robust
OSL_FAIL( "Box out of table line" );
- nCheck = rLine.GetTabBoxes().Count();
+ nCheck = rLine.GetTabBoxes().size();
}
long nNew = 0; // will be the right border of the current box
@@ -169,7 +169,7 @@ long lcl_Box2LeftBorder( const SwTableBox& rBox )
return 0;
long nLeft = 0;
const SwTableLine &rLine = *rBox.GetUpper();
- sal_uInt16 nCount = rLine.GetTabBoxes().Count();
+ sal_uInt16 nCount = rLine.GetTabBoxes().size();
for( sal_uInt16 nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
{
SwTableBox* pBox = rLine.GetTabBoxes()[nCurrBox];
@@ -203,7 +203,7 @@ SwTableBox* lcl_LeftBorder2Box( long nLeft, const SwTableLine* pLine )
if( !pLine )
return 0;
long nCurrLeft = 0;
- sal_uInt16 nCount = pLine->GetTabBoxes().Count();
+ sal_uInt16 nCount = pLine->GetTabBoxes().size();
for( sal_uInt16 nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrBox];
@@ -267,7 +267,7 @@ void lcl_ChangeRowSpan( const SwTable& rTable, const long nDiff,
bGoOn = false; // will be set to true if we found a non-master cell
// which has to be manipulated => we have to chekc the previous row, too.
const SwTableLine* pLine = rTable.GetTabLines()[ nRowIdx ];
- sal_uInt16 nBoxCount = pLine->GetTabBoxes().Count();
+ sal_uInt16 nBoxCount = pLine->GetTabBoxes().size();
for( sal_uInt16 nCurrBox = 0; nCurrBox < nBoxCount; ++nCurrBox )
{
long nRowSpan = pLine->GetTabBoxes()[nCurrBox]->getRowSpan();
@@ -338,7 +338,7 @@ SwBoxSelection* SwTable::CollectBoxSelection( const SwPaM& rPam ) const
{
SwTableLine* pLine = aLines[nRow];
OSL_ENSURE( pLine, "Missing table line" );
- sal_uInt16 nCols = pLine->GetTabBoxes().Count();
+ sal_uInt16 nCols = pLine->GetTabBoxes().size();
for( sal_uInt16 nCol = 0; nCol < nCols; ++nCol )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCol];
@@ -382,7 +382,7 @@ SwBoxSelection* SwTable::CollectBoxSelection( const SwPaM& rPam ) const
long nLeft = 0;
long nRight = 0;
long nRowSpan = 1;
- sal_uInt16 nCount = pLine->GetTabBoxes().Count();
+ sal_uInt16 nCount = pLine->GetTabBoxes().size();
for( sal_uInt16 nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrBox];
@@ -616,7 +616,7 @@ long lcl_InsertPosition( SwTable &rTable, std::vector<sal_uInt16>& rInsPos,
SwTableLine* pLine = pBox->GetUpper();
long nWidth = rBoxes[j]->GetFrmFmt()->GetFrmSize().GetWidth();
nAddWidth += nWidth;
- sal_uInt16 nCurrBox = pLine->GetTabBoxes().C40_GETPOS(SwTableBox, pBox );
+ sal_uInt16 nCurrBox = pLine->GetTabBoxes().GetPos( pBox );
sal_uInt16 nCurrLine = rTable.GetTabLines().C40_GETPOS(SwTableLine, pLine );
OSL_ENSURE( nCurrLine != USHRT_MAX, "Time to say Good-Bye.." );
if( rInsPos[ nCurrLine ] == USHRT_MAX )
@@ -662,7 +662,7 @@ sal_Bool SwTable::NewInsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes,
std::vector< sal_uInt16 > aInsPos( aLines.Count(), USHRT_MAX );
{ // Calculation of the insert positions and the width of the new boxes
sal_uInt64 nTableWidth = 0;
- for( sal_uInt16 i = 0; i < aLines[0]->GetTabBoxes().Count(); ++i )
+ for( sal_uInt16 i = 0; i < aLines[0]->GetTabBoxes().size(); ++i )
nTableWidth += aLines[0]->GetTabBoxes()[i]->GetFrmFmt()->GetFrmSize().GetWidth();
// Fill the vector of insert positions and the (average) width to insert
@@ -773,7 +773,7 @@ sal_Bool SwTable::NewInsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes,
{
const SwTableBoxes &rTabBoxes = aLines[0]->GetTabBoxes();
long nNewWidth = 0;
- for( sal_uInt16 i = 0; i < rTabBoxes.Count(); ++i )
+ for( sal_uInt16 i = 0; i < rTabBoxes.size(); ++i )
nNewWidth += rTabBoxes[i]->GetFrmFmt()->GetFrmSize().GetWidth();
OSL_ENSURE( nNewWidth > 0, "Very small" );
}
@@ -983,7 +983,7 @@ void SwTable::_FindSuperfluousRows( SwSelBoxes& rBoxes,
{
SwTableLine* pLine = aLines[nRow];
OSL_ENSURE( pLine, "Missing table line" );
- sal_uInt16 nCols = pLine->GetTabBoxes().Count();
+ sal_uInt16 nCols = pLine->GetTabBoxes().size();
bool bSuperfl = true;
for( sal_uInt16 nCol = 0; nCol < nCols; ++nCol )
{
@@ -1142,7 +1142,7 @@ void lcl_UnMerge( const SwTable& rTable, SwTableBox& rBox, sal_uInt16 nCnt,
void lcl_FillSelBoxes( SwSelBoxes &rBoxes, SwTableLine &rLine )
{
- sal_uInt16 nBoxCount = rLine.GetTabBoxes().Count();
+ sal_uInt16 nBoxCount = rLine.GetTabBoxes().size();
sal_uInt16 nCurrBox;
for( nCurrBox = 0; nCurrBox < nBoxCount; ++nCurrBox )
rBoxes.Insert( rLine.GetTabBoxes()[nCurrBox] );
@@ -1170,7 +1170,7 @@ void SwTable::InsertSpannedRow( SwDoc* pDoc, sal_uInt16 nRowIdx, sal_uInt16 nCnt
pFrmFmt->SetFmtAttr( aFSz );
}
_InsertRow( pDoc, aBoxes, nCnt, sal_True );
- sal_uInt16 nBoxCount = rLine.GetTabBoxes().Count();
+ sal_uInt16 nBoxCount = rLine.GetTabBoxes().size();
for( sal_uInt16 n = 0; n < nCnt; ++n )
{
SwTableLine *pNewLine = GetTabLines()[ nRowIdx + nCnt - n ];
@@ -1501,7 +1501,7 @@ sal_Bool SwTable::InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
SwSelBoxes aLineBoxes;
lcl_FillSelBoxes( aLineBoxes, *pLine );
_InsertRow( pDoc, aLineBoxes, nCnt, bBehind );
- sal_uInt16 nBoxCount = pLine->GetTabBoxes().Count();
+ sal_uInt16 nBoxCount = pLine->GetTabBoxes().size();
sal_uInt16 nOfs = bBehind ? 0 : 1;
for( sal_uInt16 n = 0; n < nCnt; ++n )
{
@@ -1608,7 +1608,7 @@ void lcl_SearchSelBox( const SwTable &rTable, SwSelBoxes& rBoxes, long nMin, lon
long nLeft = 0;
long nRight = 0;
long nMid = ( nMax + nMin )/ 2;
- sal_uInt16 nCount = rLine.GetTabBoxes().Count();
+ sal_uInt16 nCount = rLine.GetTabBoxes().size();
for( sal_uInt16 nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
{
SwTableBox* pBox = rLine.GetTabBoxes()[nCurrBox];
@@ -1690,7 +1690,7 @@ void SwTable::CreateSelection( const SwNode* pStartNd, const SwNode* pEndNd,
{
SwTableLine* pLine = aLines[nRow];
OSL_ENSURE( pLine, "Missing table line" );
- sal_uInt16 nCols = pLine->GetTabBoxes().Count();
+ sal_uInt16 nCols = pLine->GetTabBoxes().size();
for( sal_uInt16 nCol = 0; nCol < nCols; ++nCol )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCol];
@@ -1735,7 +1735,7 @@ void SwTable::CreateSelection( const SwNode* pStartNd, const SwNode* pEndNd,
{
SwTableLine* pLine = aLines[nRow];
OSL_ENSURE( pLine, "Missing table line" );
- sal_uInt16 nCount = pLine->GetTabBoxes().Count();
+ sal_uInt16 nCount = pLine->GetTabBoxes().size();
for( sal_uInt16 nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrBox];
@@ -1814,7 +1814,7 @@ void SwTable::ExpandColumnSelection( SwSelBoxes& rBoxes, long &rMin, long &rMax
{
SwTableLine* pLine = aLines[nRow];
OSL_ENSURE( pLine, "Missing table line" );
- sal_uInt16 nCols = pLine->GetTabBoxes().Count();
+ sal_uInt16 nCols = pLine->GetTabBoxes().size();
for( sal_uInt16 nCol = 0; nCol < nCols; ++nCol )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCol];
@@ -1831,7 +1831,7 @@ void SwTable::ExpandColumnSelection( SwSelBoxes& rBoxes, long &rMin, long &rMax
for( sal_uInt16 nRow = 0; nRow < nLineCnt; ++nRow )
{
SwTableLine* pLine = aLines[nRow];
- sal_uInt16 nCols = pLine->GetTabBoxes().Count();
+ sal_uInt16 nCols = pLine->GetTabBoxes().size();
long nLeft = 0;
long nRight = 0;
for( sal_uInt16 nCurrBox = 0; nCurrBox < nCols; ++nCurrBox )
@@ -1861,7 +1861,7 @@ void SwTable::PrepareDeleteCol( long nMin, long nMax )
for( sal_uInt16 nRow = 0; nRow < nLineCnt; ++nRow )
{
SwTableLine* pLine = aLines[nRow];
- sal_uInt16 nCols = pLine->GetTabBoxes().Count();
+ sal_uInt16 nCols = pLine->GetTabBoxes().size();
long nLeft = 0;
long nRight = 0;
for( sal_uInt16 nCurrBox = 0; nCurrBox < nCols; ++nCurrBox )
@@ -1931,7 +1931,7 @@ void SwTable::CheckRowSpan( SwTableLinePtr &rpLine, bool bUp ) const
{
bChange = false;
rpLine = GetTabLines()[ nLineIdx ];
- sal_uInt16 nCols = rpLine->GetTabBoxes().Count();
+ sal_uInt16 nCols = rpLine->GetTabBoxes().size();
for( sal_uInt16 nCol = 0; !bChange && nCol < nCols; ++nCol )
{
SwTableBox* pBox = rpLine->GetTabBoxes()[nCol];
@@ -1957,7 +1957,7 @@ void SwTable::CheckRowSpan( SwTableLinePtr &rpLine, bool bUp ) const
{
bChange = false;
rpLine = GetTabLines()[ nLineIdx ];
- sal_uInt16 nCols = rpLine->GetTabBoxes().Count();
+ sal_uInt16 nCols = rpLine->GetTabBoxes().size();
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list