From 169dff19d4da8d76e69b8e896aa25b0013639c03 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Wed, 2 Jan 2019 10:41:30 +0100 Subject: modernize loops --- src/display/drawing-text.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/display/drawing-text.cpp') diff --git a/src/display/drawing-text.cpp b/src/display/drawing-text.cpp index d809e8dcb..9d81d736d 100644 --- a/src/display/drawing-text.cpp +++ b/src/display/drawing-text.cpp @@ -446,8 +446,8 @@ unsigned DrawingText::_renderItem(DrawingContext &dc, Geom::IntRect const &/*are dc.setSource(rgba); dc.setTolerance(0.5); // low quality, but good enough for outline mode - for (ChildrenList::iterator i = _children.begin(); i != _children.end(); ++i) { - DrawingGlyphs *g = dynamic_cast(&*i); + for (auto & i : _children) { + DrawingGlyphs *g = dynamic_cast(&i); if (!g) throw InvalidItemException(); Inkscape::DrawingContext::Save save(dc); @@ -512,9 +512,9 @@ unsigned DrawingText::_renderItem(DrawingContext &dc, Geom::IntRect const &/*are double leftmost = DBL_MAX; bool first_y = true; double start_y = 0.0; - for (ChildrenList::iterator i = _children.begin(); i != _children.end(); ++i) { + for (auto & i : _children) { - DrawingGlyphs *g = dynamic_cast(&*i); + DrawingGlyphs *g = dynamic_cast(&i); if (!g) throw InvalidItemException(); if (!invset) { @@ -576,8 +576,8 @@ unsigned DrawingText::_renderItem(DrawingContext &dc, Geom::IntRect const &/*are } // accumulate the path that represents the glyphs - for (ChildrenList::iterator i = _children.begin(); i != _children.end(); ++i) { - DrawingGlyphs *g = dynamic_cast(&*i); + for (auto & i : _children) { + DrawingGlyphs *g = dynamic_cast(&i); if (!g) throw InvalidItemException(); Inkscape::DrawingContext::Save save(dc); @@ -678,8 +678,8 @@ void DrawingText::_clipItem(DrawingContext &dc, Geom::IntRect const &/*area*/) } } - for (ChildrenList::iterator i = _children.begin(); i != _children.end(); ++i) { - DrawingGlyphs *g = dynamic_cast(&*i); + for (auto & i : _children) { + DrawingGlyphs *g = dynamic_cast(&i); if (!g) { throw InvalidItemException(); } -- cgit v1.2.3