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

Stephan Bergmann sbergman at redhat.com
Sun Feb 26 21:02:16 UTC 2017


 drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx |    8 ++++--
 drawinglayer/source/primitive2d/metafileprimitive2d.cxx      |    2 -
 drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx  |   14 ++++-------
 3 files changed, 13 insertions(+), 11 deletions(-)

New commits:
commit 19403aef11a536e2ecb5589b87a94d3a345512ea
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Sun Feb 26 22:01:46 2017 +0100

    loplugin:loopvartoosmall
    
    Change-Id: I06d7d5d7cae13b9b1f62955f53407df8c9001f26

diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
index 0164e4b..7014dcf 100644
--- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
@@ -181,9 +181,13 @@ namespace drawinglayer
                             // check if buffering is complete
                             bool bBufferingComplete(true);
 
-                            for (sal_uInt32 a(0); bBufferingComplete && a < maBufferedPrimitives.size(); a++)
+                            for (auto const & a: maBufferedPrimitives)
                             {
-                                bBufferingComplete = maBufferedPrimitives[a].is();
+                                if (!a.is())
+                                {
+                                    bBufferingComplete = false;
+                                    break;
+                                }
                             }
 
                             if (bBufferingComplete)
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index f1d728b..7a13ff7 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -3085,7 +3085,7 @@ namespace
                         // better to use this info
                         const MetaGradientExAction* pMetaGradientExAction = nullptr;
                         bool bDone(false);
-                        sal_uInt32 b(nAction + 1);
+                        size_t b(nAction + 1);
 
                         for(; !bDone && b < nCount; b++)
                         {
diff --git a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
index a53caf4..bc14653 100644
--- a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
@@ -92,8 +92,6 @@ namespace drawinglayer
             const basegfx::B3DRange& rRange,
             const basegfx::B2DVector& rTextureSize)
         {
-            sal_uInt32 a;
-
             // handle texture coordinates X
             const bool bParallelX(css::drawing::TextureProjectionMode_PARALLEL == eModeX);
             const bool bSphereX(!bParallelX && (css::drawing::TextureProjectionMode_SPHERE == eModeX));
@@ -105,9 +103,9 @@ namespace drawinglayer
             if(bParallelX || bParallelY)
             {
                 // apply parallel texture coordinates in X and/or Y
-                for(a = 0; a < rFill.size(); a++)
+                for(auto & a: rFill)
                 {
-                    rFill[a] = basegfx::tools::applyDefaultTextureCoordinatesParallel(rFill[a], rRange, bParallelX, bParallelY);
+                    a = basegfx::tools::applyDefaultTextureCoordinatesParallel(a, rRange, bParallelX, bParallelY);
                 }
             }
 
@@ -116,9 +114,9 @@ namespace drawinglayer
                 // apply spherical texture coordinates in X and/or Y
                 const basegfx::B3DPoint aCenter(rRange.getCenter());
 
-                for(a = 0; a < rFill.size(); a++)
+                for(auto & a: rFill)
                 {
-                    rFill[a] = basegfx::tools::applyDefaultTextureCoordinatesSphere(rFill[a], aCenter, bSphereX, bSphereY);
+                    a = basegfx::tools::applyDefaultTextureCoordinatesSphere(a, aCenter, bSphereX, bSphereY);
                 }
             }
 
@@ -126,9 +124,9 @@ namespace drawinglayer
             basegfx::B2DHomMatrix aTexMatrix;
             aTexMatrix.scale(rTextureSize.getX(), rTextureSize.getY());
 
-            for(a = 0; a < rFill.size(); a++)
+            for(auto & a: rFill)
             {
-                rFill[a].transformTextureCoordinates(aTexMatrix);
+                a.transformTextureCoordinates(aTexMatrix);
             }
         }
 


More information about the Libreoffice-commits mailing list