diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-07-25 12:52:09 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-07-26 14:25:30 +0200 |
commit | 6483ed12cea9e268834fe4343007caafdc7f0d0c (patch) | |
tree | 5fc6b1a6fce047769a6869d973ed96389ea63bec /sw/source/uibase/table | |
parent | 196fcbd842d7e8bc0ea3f720f8b35930d27ad9e5 (diff) |
Avoid unneeded downcast, reduce scope, constify
Change-Id: Ic2298985c26356170d395d943c1d538a7544e4da
Diffstat (limited to 'sw/source/uibase/table')
-rw-r--r-- | sw/source/uibase/table/swtablerep.cxx | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sw/source/uibase/table/swtablerep.cxx b/sw/source/uibase/table/swtablerep.cxx index fa16f1f439a7..49fe7168c219 100644 --- a/sw/source/uibase/table/swtablerep.cxx +++ b/sw/source/uibase/table/swtablerep.cxx @@ -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(); |