summaryrefslogtreecommitdiff
path: root/canvas/source/tools/page.cxx
diff options
context:
space:
mode:
authorDaniel Robertson <danlrobertson89@gmail.com>2015-08-25 12:24:33 -0400
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2015-08-30 13:03:22 +0000
commitb7f4940c150b3bdd639afa988573a29774fff1f6 (patch)
tree7c4c6bc9af26b8fa282781ebffbc1a95f6a6037a /canvas/source/tools/page.cxx
parent49cb81b411e1c68cada5d3f4375de713118fce64 (diff)
canvas: replace while loops with range-based for
Change-Id: Ide16bee666cf4df41646f9336a585e22a7fe53bd Reviewed-on: https://gerrit.libreoffice.org/18131 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'canvas/source/tools/page.cxx')
-rw-r--r--canvas/source/tools/page.cxx16
1 files changed, 4 insertions, 12 deletions
diff --git a/canvas/source/tools/page.cxx b/canvas/source/tools/page.cxx
index b942b3b9fa15..d9b7c08f3f75 100644
--- a/canvas/source/tools/page.cxx
+++ b/canvas/source/tools/page.cxx
@@ -84,11 +84,9 @@ namespace canvas
bool Page::insert( SurfaceRect& r )
{
- const FragmentContainer_t::const_iterator aEnd(mpFragments.end());
- FragmentContainer_t::const_iterator it(mpFragments.begin());
- while(it != aEnd)
+ for( const auto& pFragment : mpFragments )
{
- const SurfaceRect &rect = (*it)->getRect();
+ const SurfaceRect &rect = pFragment->getRect();
const sal_Int32 x = rect.maPos.getX();
const sal_Int32 y = rect.maPos.getY();
// to avoid interpolation artifacts from other textures,
@@ -107,8 +105,6 @@ namespace canvas
r.maPos.setY(y+h);
if(isValidLocation(r))
return true;
-
- ++it;
}
r.maPos.setX(0);
@@ -126,14 +122,10 @@ namespace canvas
if( !r.inside(aBoundary) )
return false;
- const FragmentContainer_t::const_iterator aEnd(mpFragments.end());
- FragmentContainer_t::const_iterator it(mpFragments.begin());
- while(it != aEnd)
+ for( const auto& pFragment : mpFragments )
{
- if(r.intersection((*it)->getRect()))
+ if( r.intersection( pFragment->getRect() ) )
return false;
-
- ++it;
}
return true;