diff --git a/src/formatting/list.cpp b/src/formatting/list.cpp index e5044cf7d..c412a6ae6 100644 --- a/src/formatting/list.cpp +++ b/src/formatting/list.cpp @@ -19,7 +19,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * *****************************************************************************/ + +// mapnik #include +// boost +#include namespace mapnik { using boost::property_tree::ptree; @@ -27,45 +31,37 @@ using boost::property_tree::ptree; namespace formatting { /************************************************************/ -void list_node::to_xml(boost::property_tree::ptree &xml) const +void list_node::to_xml(boost::property_tree::ptree & xml) const { - std::vector::const_iterator itr = children_.begin(); - std::vector::const_iterator end = children_.end(); - for (;itr != end; itr++) + BOOST_FOREACH(node_ptr const& node, children_) { - (*itr)->to_xml(xml); + node->to_xml(xml); } } void list_node::apply(char_properties const& p, Feature const& feature, processed_text &output) const -{ - std::vector::const_iterator itr = children_.begin(); - std::vector::const_iterator end = children_.end(); - for (;itr != end; itr++) +{ + BOOST_FOREACH(node_ptr const& node, children_) { - (*itr)->apply(p, feature, output); - } + node->apply(p, feature, output); + } } void list_node::add_expressions(expression_set &output) const { - std::vector::const_iterator itr = children_.begin(); - std::vector::const_iterator end = children_.end(); - for (;itr != end; itr++) + BOOST_FOREACH(node_ptr const& node, children_) { - (*itr)->add_expressions(output); + node->add_expressions(output); } } - void list_node::push_back(node_ptr n) { children_.push_back(n); } - void list_node::clear() { children_.clear();