[Libreoffice-commits] core.git: svtools/source

Stephan Bergmann sbergman at redhat.com
Wed Mar 8 10:02:11 UTC 2017


 svtools/source/contnr/svimpbox.cxx |    2 +-
 svtools/source/control/ruler.cxx   |    6 ++----
 svtools/source/graphic/grfmgr.cxx  |    5 ++---
 svtools/source/graphic/grfmgr2.cxx |   11 +++++++----
 svtools/source/misc/langtab.cxx    |    2 +-
 5 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 6412b9c5dd10af511cc255a952be4b18a25ab9a8
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Mar 8 11:01:32 2017 +0100

    loplugin:loopvartoosmall
    
    Change-Id: If76fa042462897735d0d67341a3734b8cfced12c

diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index b25a5a0..fb3c178 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -1331,7 +1331,7 @@ void SvImpLBox::FillView()
     {
         sal_uInt16 nLast = (sal_uInt16)(pView->GetVisiblePos(pView->LastVisible()));
         sal_uInt16 nThumb = (sal_uInt16)(pView->GetVisiblePos( pStartEntry ));
-        sal_uInt16 nCurDispEntries = nLast-nThumb+1;
+        sal_uLong nCurDispEntries = nLast-nThumb+1;
         if( nCurDispEntries <  nVisibleCount )
         {
             ShowCursor( false );
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index aaaca43..b8a027a 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -688,9 +688,8 @@ void Ruler::ImplDrawBorders(vcl::RenderContext& rRenderContext, long nMin, long
     long    n2;
     long    nTemp1;
     long    nTemp2;
-    sal_uInt32  i;
 
-    for (i = 0; i < mpData->pBorders.size(); i++)
+    for (std::vector<RulerBorder>::size_type i = 0; i < mpData->pBorders.size(); i++)
     {
         if (mpData->pBorders[i].nStyle & RulerBorderStyle::Invisible)
             continue;
@@ -793,14 +792,13 @@ void Ruler::ImplDrawIndent(vcl::RenderContext& rRenderContext, const tools::Poly
 
 void Ruler::ImplDrawIndents(vcl::RenderContext& rRenderContext, long nMin, long nMax, long nVirTop, long nVirBottom)
 {
-    sal_uInt32  j;
     long n;
     long nIndentHeight = (mnVirHeight / 2) - 1;
     long nIndentWidth2 = nIndentHeight-3;
 
     tools::Polygon aPoly(5);
 
-    for (j = 0; j < mpData->pIndents.size(); j++)
+    for (std::vector<RulerIndent>::size_type j = 0; j < mpData->pIndents.size(); j++)
     {
         if (mpData->pIndents[j].bInvisible)
             continue;
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index f315955..3225cdb 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 fda6832..68ade89 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 ) );
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 272f8ed..1c303f9 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -82,7 +82,7 @@ const OUString ApplyLreOrRleEmbedding( const OUString &rText )
     // Thus we can avoid to check every character of the text.
     bool bFound     = false;
     bool bIsRtlText = false;
-    for (sal_uInt16 i = 0;  i < nLen && !bFound;  ++i)
+    for (sal_Int32 i = 0;  i < nLen && !bFound;  ++i)
     {
         sal_Int16 nDirection = rCharClass.getCharacterDirection( rText, i );
         switch (nDirection)


More information about the Libreoffice-commits mailing list