use boost::make_shared instead of new as per mapnik coding conventions
This commit is contained in:
parent
a5d7239cfc
commit
82bd78d9a5
3 changed files with 13 additions and 5 deletions
|
@ -19,7 +19,10 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include <mapnik/text_placements/dummy.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
|
||||
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<text_placement_info_dummy>(
|
||||
this, scale_factor, dim, has_dimensions));
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,10 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include <mapnik/text_placements/list.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
|
||||
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<text_placement_info_list>(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();
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <boost/spirit/include/qi.hpp>
|
||||
#include <boost/spirit/include/phoenix_core.hpp>
|
||||
#include <boost/spirit/include/phoenix_stl.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
|
||||
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<text_placement_info_simple>(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<text_placements_simple>(
|
||||
get_attr<std::string>(xml, "placements", "X")));
|
||||
ptr->defaults.from_xml(xml, fontsets);
|
||||
return ptr;
|
||||
|
|
Loading…
Reference in a new issue