diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-03-08 11:01:32 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-03-08 11:01:32 +0100 |
commit | 6412b9c5dd10af511cc255a952be4b18a25ab9a8 (patch) | |
tree | 66eb7ad4d2a7f2fe351d8c5b5c56658ef825eb4c /svtools/source/graphic | |
parent | 6271381baa0d2db257070cb7ecfc9abf89faaf0f (diff) |
loplugin:loopvartoosmall
Change-Id: If76fa042462897735d0d67341a3734b8cfced12c
Diffstat (limited to 'svtools/source/graphic')
-rw-r--r-- | svtools/source/graphic/grfmgr.cxx | 5 | ||||
-rw-r--r-- | svtools/source/graphic/grfmgr2.cxx | 11 |
2 files changed, 9 insertions, 7 deletions
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index f315955f53b3..3225cdb186fd 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -805,10 +805,9 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo // #105641# Also crop animations if( aTransGraphic.IsAnimated() ) { - sal_uInt16 nFrame; Animation aAnim( aTransGraphic.GetAnimation() ); - for( nFrame=0; nFrame<aAnim.Count(); ++nFrame ) + for( size_t nFrame=0; nFrame<aAnim.Count(); ++nFrame ) { AnimationBitmap aAnimBmp( aAnim.Get( nFrame ) ); @@ -852,7 +851,7 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo Point aPosOffset( aCropLeftTop.Width() < 0 ? -aCropLeftTop.Width() : 0, aCropLeftTop.Height() < 0 ? -aCropLeftTop.Height() : 0 ); - for( nFrame=0; nFrame<aAnim.Count(); ++nFrame ) + for( size_t nFrame=0; nFrame<aAnim.Count(); ++nFrame ) { AnimationBitmap aAnimBmp( aAnim.Get( nFrame ) ); diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index fda6832a7db9..68ade89842db 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -199,7 +199,7 @@ void GraphicManager::ImplCheckSizeOfSwappedInGraphics(const GraphicObject* pGrap // sort by DataChangeTimeStamp so that the oldest get removed first std::sort(aCandidates.begin(), aCandidates.end(), simpleSortByDataChangeTimeStamp()); - for(sal_uInt32 a(0); mnUsedSize >= nMaxCacheSize && a < aCandidates.size(); a++) + for(decltype(aCandidates)::size_type a(0); mnUsedSize >= nMaxCacheSize && a < aCandidates.size(); a++) { // swap out until we have no more or the goal to use less than nMaxCacheSize // is reached @@ -332,12 +332,12 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib double fRevScaleY; bool scaleByAveraging = false; - int x,y; if(aBitmapWidth > 1 && aUnrotatedWidth > 1) { fRevScaleX = (double) ( aBitmapWidth - 1 ) / (double)( aUnrotatedWidth - 1 ); // create horizontal mapping table + long x; for( x = 0, nTmpX = aBitmapWidth - 1L, nTmp = aBitmapWidth - 2L >= 0 ? aBitmapWidth -2L : 0L; x < aUnrotatedWidth; x++ ) { fTmp = x * fRevScaleX; @@ -355,7 +355,7 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib if(aBitmapWidth == 1) { fRevScaleX = 1.0 / (double)( aUnrotatedWidth ); - for ( x = 0; x < aUnrotatedWidth ; x++) + for ( long x = 0; x < aUnrotatedWidth ; x++) { pMapIX[x] = 0; pMapFX[x] = 0; @@ -376,6 +376,7 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib { fRevScaleY = (double) ( aBitmapHeight - 1 ) / (double)( aUnrotatedHeight - 1 ); // create vertical mapping table + long y; for( y = 0, nTmpY = aBitmapHeight - 1L, nTmp = aBitmapHeight - 2L >= 0 ? aBitmapHeight - 2L : 0L; y < aUnrotatedHeight; y++ ) { fTmp = y * fRevScaleY; @@ -393,7 +394,7 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib if(aBitmapHeight == 1) { fRevScaleY = 1.0 / (double)( aUnrotatedHeight); - for (y = 0; y < aUnrotatedHeight; ++y) + for (long y = 0; y < aUnrotatedHeight; ++y) { pMapIY[y] = 0; pMapFY[y] = 0; @@ -433,6 +434,7 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib Rectangle aNewBound( aPoly.GetBoundRect() ); // create horizontal mapping table + long x; for( x = 0, nTmpX = aNewBound.Left() + nStartX; x < aTargetWidth; x++ ) { pCosX[ x ] = FRound( fCosAngle * ( fTmp = nTmpX++ << 8 ) ); @@ -440,6 +442,7 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib } // create vertical mapping table + long y; for( y = 0, nTmpY = aNewBound.Top() + nStartY; y < aTargetHeight; y++ ) { pCosY[ y ] = FRound( fCosAngle * ( fTmp = nTmpY++ << 8 ) ); |