From e06c4567895732e2c7d8f3a91f02b3b16b43b88e Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Mon, 19 Mar 2012 10:46:44 +0000 Subject: [PATCH] even better, use BOOST_FOREACH --- include/mapnik/font_engine_freetype.hpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/include/mapnik/font_engine_freetype.hpp b/include/mapnik/font_engine_freetype.hpp index 54baaa04d..5b4b87b40 100644 --- a/include/mapnik/font_engine_freetype.hpp +++ b/include/mapnik/font_engine_freetype.hpp @@ -46,6 +46,7 @@ extern "C" #include #include #include +#include #ifdef MAPNIK_THREADSAFE #include #endif @@ -168,12 +169,10 @@ public: glyph_ptr get_glyph(unsigned c) const { - std::vector::const_iterator face = faces_.begin(); - std::vector::const_iterator end = faces_.end(); - for (; face != end; ++face) + BOOST_FOREACH ( face_ptr const& face, faces_) { - FT_UInt g = (*face)->get_char(c); - if (g) return boost::make_shared(*face, g); + FT_UInt g = face->get_char(c); + if (g) return boost::make_shared(face, g); } // Final fallback to empty square if nothing better in any font @@ -186,17 +185,17 @@ public: void set_pixel_sizes(unsigned size) { - for (std::vector::iterator face = faces_.begin(); face != faces_.end(); ++face) + BOOST_FOREACH ( face_ptr const& face, faces_) { - (*face)->set_pixel_sizes(size); + face->set_pixel_sizes(size); } } void set_character_sizes(float size) { - for (std::vector::iterator face = faces_.begin(); face != faces_.end(); ++face) + BOOST_FOREACH ( face_ptr const& face, faces_) { - (*face)->set_character_sizes(size); + face->set_character_sizes(size); } } private: