Kaydet (Commit) 6483ed12 authored tarafından Matteo Casalin's avatar Matteo Casalin

Avoid unneeded downcast, reduce scope, constify

Change-Id: Ic2298985c26356170d395d943c1d538a7544e4da
üst 196fcbd8
......@@ -103,20 +103,18 @@ bool SwTableRep::FillTabCols( SwTabCols& rTabCols ) const
break;
}
sal_uInt16 i;
SwTwips nPos = 0;
SwTwips nLeft = GetLeftSpace();
const SwTwips nLeft = GetLeftSpace();
rTabCols.SetLeft(nLeft);
if(bSingleLine)
{
// The invisible separators are taken from the old TabCols,
// the visible coming from pTColumns.
boost::scoped_array<TColumn> pOldTColumns(new TColumn[nAllCols + 1]);
SwTwips nStart = 0,
nEnd;
for(i = 0; i < nAllCols - 1; i++)
SwTwips nStart = 0;
for ( sal_uInt16 i = 0; i < nAllCols - 1; ++i )
{
nEnd = rTabCols[i] - rTabCols.GetLeft();
const SwTwips nEnd = rTabCols[i] - rTabCols.GetLeft();
pOldTColumns[i].nWidth = nEnd - nStart;
pOldTColumns[i].bVisible = !rTabCols.IsHidden(i);
nStart = nEnd;
......@@ -130,9 +128,8 @@ bool SwTableRep::FillTabCols( SwTabCols& rTabCols ) const
SwTwips nNew = 0;
bool bOld = false;
bool bFirst = true;
i = 0;
while ( i < nAllCols -1 )
for ( sal_uInt16 i = 0; i < nAllCols - 1; ++i )
{
while((bFirst || bOld ) && nOldPos < nAllCols )
{
......@@ -151,16 +148,15 @@ bool SwTableRep::FillTabCols( SwTabCols& rTabCols ) const
bFirst = false;
// They have to be inserted sorted.
bOld = nOld < nNew;
nPos = sal_uInt16(bOld ? nOld : nNew);
nPos = bOld ? nOld : nNew;
rTabCols[i] = nPos + nLeft;
rTabCols.SetHidden( i, bOld );
i++;
}
rTabCols.SetRight(nLeft + nTblWidth);
}
else
{
for ( i = 0; i < nAllCols - 1; ++i )
for ( sal_uInt16 i = 0; i < nAllCols - 1; ++i )
{
nPos += pTColumns[i].nWidth;
rTabCols[i] = nPos + rTabCols.GetLeft();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment