diff options
author | Daniel Robertson <danlrobertson89@gmail.com> | 2015-08-14 21:35:00 -0400 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2015-08-16 18:30:15 +0000 |
commit | 720cea21f352933fa5d36d4b6faff11799c604f2 (patch) | |
tree | 83d51495c3b59d0bce6be3f3d17d1905ea36bdd8 /canvas/source/opengl | |
parent | 7e383cb50c6020b86ac7857ece8a6273b7eb1a5e (diff) |
canvas: replace for_each with range-based for-loop
Replace ::std::for_each for a more readable range-based for loop in
cases in which the function object to be applied by for_each is more
readable as the body of a for loop.
Change-Id: I5ea0f6a464855b8cc8af38f211bb784dd91eca0d
Reviewed-on: https://gerrit.libreoffice.org/17775
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'canvas/source/opengl')
-rw-r--r-- | canvas/source/opengl/ogl_canvashelper.cxx | 5 | ||||
-rw-r--r-- | canvas/source/opengl/ogl_spritedevicehelper.cxx | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx index 4ecf9914174b..1534f7c3b10a 100644 --- a/canvas/source/opengl/ogl_canvashelper.cxx +++ b/canvas/source/opengl/ogl_canvashelper.cxx @@ -800,9 +800,8 @@ namespace oglcanvas } // own copy, for thread safety - std::for_each(rAct.maPolyPolys.begin(), - rAct.maPolyPolys.end(), - ::boost::mem_fn(&::basegfx::B2DPolyPolygon::makeUnique)); + for( auto& rPoly : rAct.maPolyPolys ) + rPoly.makeUnique(); rAct.maFunction = &lcl_fillPolyPolygon; } diff --git a/canvas/source/opengl/ogl_spritedevicehelper.cxx b/canvas/source/opengl/ogl_spritedevicehelper.cxx index e5da0f23d1a4..3c58b4051bb5 100644 --- a/canvas/source/opengl/ogl_spritedevicehelper.cxx +++ b/canvas/source/opengl/ogl_spritedevicehelper.cxx @@ -293,9 +293,8 @@ namespace oglcanvas std::sort(aSprites.begin(), aSprites.end(), SpriteComparator()); - std::for_each(aSprites.begin(), - aSprites.end(), - std::mem_fn(&CanvasCustomSprite::renderSprite)); + for( const auto& rSprite : aSprites ) + rSprite->renderSprite(); // frame counter, other info |