From 82bd78d9a54cd600635786b70114311e30506344 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Mon, 27 Feb 2012 16:39:34 -0800 Subject: [PATCH] use boost::make_shared instead of new as per mapnik coding conventions --- src/text_placements/dummy.cpp | 5 ++++- src/text_placements/list.cpp | 8 ++++++-- src/text_placements/simple.cpp | 5 +++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/text_placements/dummy.cpp b/src/text_placements/dummy.cpp index cf2d43f15..3c66b1f14 100644 --- a/src/text_placements/dummy.cpp +++ b/src/text_placements/dummy.cpp @@ -19,7 +19,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * *****************************************************************************/ + #include +#include + namespace mapnik { bool text_placement_info_dummy::next() @@ -32,7 +35,7 @@ bool text_placement_info_dummy::next() text_placement_info_ptr text_placements_dummy::get_placement_info( double scale_factor, dimension_type dim, bool has_dimensions) const { - return text_placement_info_ptr(new text_placement_info_dummy( + return text_placement_info_ptr(boost::make_shared( this, scale_factor, dim, has_dimensions)); } diff --git a/src/text_placements/list.cpp b/src/text_placements/list.cpp index 9d93fda94..80762baea 100644 --- a/src/text_placements/list.cpp +++ b/src/text_placements/list.cpp @@ -19,7 +19,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * *****************************************************************************/ + #include +#include + namespace mapnik { @@ -56,7 +59,7 @@ text_symbolizer_properties & text_placements_list::get(unsigned i) text_placement_info_ptr text_placements_list::get_placement_info( double scale_factor, dimension_type dim, bool has_dimensions) const { - return text_placement_info_ptr(new text_placement_info_list(this, + return text_placement_info_ptr(boost::make_shared(this, scale_factor, dim, has_dimensions)); } @@ -89,7 +92,8 @@ text_placements_ptr text_placements_list::from_xml(boost::property_tree::ptree c list->defaults.from_xml(xml, fontsets); ptree::const_iterator itr = xml.begin(); ptree::const_iterator end = xml.end(); - for( ;itr != end; ++itr) { + for( ;itr != end; ++itr) + { if ((itr->first.find('<') != std::string::npos) || (itr->first != "Placement")) continue; //TODO: ensure_attrs(symIter->second, "TextSymbolizer/Placement", s_common.str()); text_symbolizer_properties &p = list->add(); diff --git a/src/text_placements/simple.cpp b/src/text_placements/simple.cpp index 588abd341..49151066f 100644 --- a/src/text_placements/simple.cpp +++ b/src/text_placements/simple.cpp @@ -28,6 +28,7 @@ #include #include #include +#include namespace mapnik { @@ -101,7 +102,7 @@ bool text_placement_info_simple::next_position_only() text_placement_info_ptr text_placements_simple::get_placement_info( double scale_factor, dimension_type dim, bool has_dimensions) const { - return text_placement_info_ptr(new text_placement_info_simple(this, + return text_placement_info_ptr(boost::make_shared(this, scale_factor, dim, has_dimensions)); } @@ -168,7 +169,7 @@ std::string text_placements_simple::get_positions() text_placements_ptr text_placements_simple::from_xml(boost::property_tree::ptree const &xml, fontset_map const & fontsets) { - text_placements_ptr ptr = text_placements_ptr(new text_placements_simple( + text_placements_ptr ptr = text_placements_ptr(boost::make_shared( get_attr(xml, "placements", "X"))); ptr->defaults.from_xml(xml, fontsets); return ptr;