diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-10-26 10:12:13 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-10-26 10:37:21 +0100 |
commit | 3bcbcb12c525028f55caf104bdfaa1b604a7be8e (patch) | |
tree | 506c547520c21647d6a2e5f2fa0a9471b1d8e95a /sw | |
parent | 992859b4377e0b7a3a177f0a69dc4e6fec765483 (diff) |
sal_uInt16 to more proper integer types
Change-Id: I8a541e6466b66d6ca41e7b1556db3c72764582d1
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/pagechg.cxx | 7 | ||||
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 30 | ||||
-rw-r--r-- | sw/source/core/layout/tabfrm.cxx | 20 | ||||
-rw-r--r-- | sw/source/core/layout/trvlfrm.cxx | 2 |
4 files changed, 28 insertions, 31 deletions
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index c27427959ce1..811fb3671472 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -369,7 +369,7 @@ static void lcl_MakeObjs( const SwFrmFmts &rTbl, SwPageFrm *pPage ) { // formats are in the special table of the document - for ( sal_uInt16 i = 0; i < rTbl.size(); ++i ) + for ( size_t i = 0; i < rTbl.size(); ++i ) { SdrObject *pSdrObj; SwFrmFmt *pFmt = rTbl[i]; @@ -1403,9 +1403,8 @@ void SwRootFrm::AssertFlyPages() // what page targets the "last" Fly? sal_uInt16 nMaxPg = 0; - sal_uInt16 i; - for ( i = 0; i < pTbl->size(); ++i ) + for ( size_t i = 0; i < pTbl->size(); ++i ) { const SwFmtAnchor &rAnch = (*pTbl)[i]->GetAnchor(); if ( !rAnch.GetCntntAnchor() && nMaxPg < rAnch.GetPageNum() ) @@ -1425,7 +1424,7 @@ void SwRootFrm::AssertFlyPages() bool bOdd = (pPage->GetPhyPageNum() % 2) ? sal_True : sal_False; SwPageDesc *pDesc = pPage->GetPageDesc(); SwFrm *pSibling = pPage->GetNext(); - for ( i = pPage->GetPhyPageNum(); i < nMaxPg; ++i ) + for ( sal_uInt16 i = pPage->GetPhyPageNum(); i < nMaxPg; ++i ) { if ( !(bOdd ? pDesc->GetRightFmt() : pDesc->GetLeftFmt()) ) { diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 8c177fc0f6b9..75bc9cbafc35 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -746,11 +746,11 @@ void SwLineRects::ConnectEdges( OutputDevice *pOut ) bool bRemove = false; // For each line test all following ones. - for ( sal_uInt16 k = 0; !bRemove && k < aCheck.size(); ++k ) + for ( size_t k = 0; !bRemove && k < aCheck.size(); ++k ) { SwLineRect &rR1 = *aCheck[k]; - for ( sal_uInt16 k2 = k+1; !bRemove && k2 < aCheck.size(); ++k2 ) + for ( size_t k2 = k+1; !bRemove && k2 < aCheck.size(); ++k2 ) { SwLineRect &rR2 = *aCheck[k2]; if ( bVert ) @@ -2263,7 +2263,7 @@ void DrawGraphic( else bGrfBackgrdAlreadyDrawn = true; // loop rectangles of background region, which has to be drawn - for( sal_uInt16 i = 0; i < aRegion.size(); ++i ) + for( size_t i = 0; i < aRegion.size(); ++i ) { pOutDev->DrawRect( aRegion[i].SVRect() ); } @@ -4274,12 +4274,12 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const { pOut->SetClipRegion(vcl::Region(aPoly)); } - for ( sal_uInt16 i = 0; i < aRegion.size(); ++i ) + for ( size_t i = 0; i < aRegion.size(); ++i ) PaintBackground( aRegion[i], pPage, rAttrs, false, true ); pOut->Pop(); } else - for ( sal_uInt16 i = 0; i < aRegion.size(); ++i ) + for ( size_t i = 0; i < aRegion.size(); ++i ) PaintBackground( aRegion[i], pPage, rAttrs, false, true ); } @@ -4605,7 +4605,7 @@ static void lcl_PaintShadow( const SwRect& rRect, SwRect& rOutRect, pOut->SetDrawMode( nOldDrawMode ); - for ( sal_uInt16 i = 0; i < aRegion.size(); ++i ) + for ( size_t i = 0; i < aRegion.size(); ++i ) { SwRect &rOut = aRegion[i]; aOut = rOut; @@ -4690,7 +4690,7 @@ void SwFrm::PaintBorderLine( const SwRect& rRect, //{ // SwRegionRects aRegion( aOut, 4 ); // ::lcl_SubtractFlys( this, pPage, aOut, aRegion ); - // for ( sal_uInt16 i = 0; i < aRegion.size(); ++i ) + // for ( size_t i = 0; i < aRegion.size(); ++i ) // pLines->AddLineRect( aRegion[i], pColor, nStyle, pTab, nSubCol ); //} //else @@ -4818,12 +4818,10 @@ static void lcl_SubTopBottom( SwRect& _iorRect, static sal_uInt16 lcl_GetLineWidth( const SvxBorderLine* pLine ) { - sal_uInt16 result = 0; - if ( pLine != NULL ) - result = pLine->GetScaledWidth(); + return pLine->GetScaledWidth(); - return result; + return 0; } static double lcl_GetExtent( const SvxBorderLine* pSideLine, const SvxBorderLine* pOppositeLine ) @@ -4961,7 +4959,7 @@ static void lcl_PaintLeftRightLine( const bool _bLeft, // Shift the left border to the left. Point aCurPos = aRect.Pos(); - sal_uInt16 nOffset = pLeftRightBorder->GetDistance(); + const sal_uInt16 nOffset = pLeftRightBorder->GetDistance(); aCurPos.X() -= nOffset; aCurPos.Y() -= nOffset; aRect.Pos(aCurPos); @@ -5038,7 +5036,7 @@ static void lcl_PaintTopBottomLine( const bool _bTop, (aRect.*_rRectFn->fnGetHeight)() ); // Push the top border up a bit. - sal_uInt16 nOffset = pTopBottomBorder->GetDistance(); + const sal_uInt16 nOffset = pTopBottomBorder->GetDistance(); Point aCurPos = aRect.Pos(); aCurPos.X() -= nOffset; aCurPos.Y() -= nOffset; @@ -5122,7 +5120,7 @@ void PaintCharacterBorder( if( aTopBorder ) { - sal_uInt16 nOffset = aTopBorder->GetDistance(); + const sal_uInt16 nOffset = aTopBorder->GetDistance(); Point aLeftTop( aAlignedRect.Left() - nOffset, @@ -5161,7 +5159,7 @@ void PaintCharacterBorder( if( aLeftBorder ) { - sal_uInt16 nOffset = aLeftBorder->GetDistance(); + const sal_uInt16 nOffset = aLeftBorder->GetDistance(); Point aLeftTop( aAlignedRect.Left() - nOffset, @@ -7382,7 +7380,7 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const // #i16816# tagged pdf support SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pSh->GetOut() ); - for ( sal_uInt16 i = 0; i < aRegion.size(); ++i ) + for ( size_t i = 0; i < aRegion.size(); ++i ) { SwRect &rRetouche = aRegion[i]; diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 5ca1929904a6..bd54386c586d 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -87,7 +87,7 @@ SwTabFrm::SwTabFrm( SwTable &rTab, SwFrm* pSib ): //Create the lines and insert them. const SwTableLines &rLines = rTab.GetTabLines(); SwFrm *pTmpPrev = 0; - for ( sal_uInt16 i = 0; i < rLines.size(); ++i ) + for ( size_t i = 0; i < rLines.size(); ++i ) { SwRowFrm *pNew = new SwRowFrm( *rLines[i], this ); if( pNew->Lower() ) @@ -1357,8 +1357,8 @@ bool SwCntntFrm::CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave, SWRECTFN( pLay ) // FME 2007-08-30 #i81146# new loop control - sal_uInt16 nLoopControlRuns = 0; - const sal_uInt16 nLoopControlMax = 10; + int nLoopControlRuns = 0; + const int nLoopControlMax = 10; const SwModify* pLoopControlCond = 0; while ( pCnt && pDontLeave->IsAnLower( pCnt ) ) @@ -1481,15 +1481,15 @@ static bool lcl_InnerCalcLayout( SwFrm *pFrm, static void lcl_RecalcRow( SwRowFrm& rRow, long nBottom ) { // FME 2007-08-30 #i81146# new loop control - sal_uInt16 nLoopControlRuns_1 = 0; + int nLoopControlRuns_1 = 0; sal_uInt16 nLoopControlStage_1 = 0; - const sal_uInt16 nLoopControlMax = 10; + const int nLoopControlMax = 10; bool bCheck = true; do { // FME 2007-08-30 #i81146# new loop control - sal_uInt16 nLoopControlRuns_2 = 0; + int nLoopControlRuns_2 = 0; sal_uInt16 nLoopControlStage_2 = 0; while( lcl_InnerCalcLayout( &rRow, nBottom ) ) @@ -3510,7 +3510,7 @@ SwRowFrm::SwRowFrm( const SwTableLine &rLine, SwFrm* pSib, bool bInsertContent ) //Create the boxes and insert them. const SwTableBoxes &rBoxes = rLine.GetTabBoxes(); SwFrm *pTmpPrev = 0; - for ( sal_uInt16 i = 0; i < rBoxes.size(); ++i ) + for ( size_t i = 0; i < rBoxes.size(); ++i ) { SwCellFrm *pNew = new SwCellFrm( *rBoxes[i], this, bInsertContent ); pNew->InsertBehind( this, pTmpPrev ); @@ -3957,7 +3957,7 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs ) while ( pTmpRow && !pPrevTabLine ) { - sal_uInt16 nIdx = 0; + size_t nIdx = 0; const SwTableLines& rLines = pTmpRow->GetTabLine()->GetUpper() ? pTmpRow->GetTabLine()->GetUpper()->GetTabLines() : pTable->GetTabLines(); @@ -4399,7 +4399,7 @@ SwCellFrm::SwCellFrm( const SwTableBox &rBox, SwFrm* pSib, bool bInsertContent ) { const SwTableLines &rLines = rBox.GetTabLines(); SwFrm *pTmpPrev = 0; - for ( sal_uInt16 i = 0; i < rLines.size(); ++i ) + for ( size_t i = 0; i < rLines.size(); ++i ) { SwRowFrm *pNew = new SwRowFrm( *rLines[i], this, bInsertContent ); pNew->InsertBehind( this, pTmpPrev ); @@ -4722,7 +4722,7 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs ) const SwTableBox* pTmpBox = 0; SwTwips nSumWidth = 0; - sal_uInt16 i = 0; + size_t i = 0; do { pTmpBox = rBoxes[ i++ ]; diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index ce15334960a5..b8fa9f99cb72 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -1903,7 +1903,7 @@ bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr ) const bool bReadOnlyAvailable = rTblCrsr.IsReadOnlyAvailable(); - for ( sal_uInt16 i = 0; i < aUnions.size(); ++i ) + for ( size_t i = 0; i < aUnions.size(); ++i ) { SwSelUnion *pUnion = &aUnions[i]; const SwTabFrm *pTable = pUnion->GetTable(); |