From 489168d529da217abb2399b8d01e3f7981c894a5 Mon Sep 17 00:00:00 2001 From: Jordan Hollinger Date: Mon, 10 Feb 2014 11:48:33 -0500 Subject: [PATCH] Use make_shared to create shared_ptr. --- src/text/formatting/layout.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/text/formatting/layout.cpp b/src/text/formatting/layout.cpp index 043be0661..d21550d9f 100644 --- a/src/text/formatting/layout.cpp +++ b/src/text/formatting/layout.cpp @@ -60,8 +60,7 @@ void layout_node::to_xml(ptree &xml) const node_ptr layout_node::from_xml(xml_node const& xml) { - layout_node *n = new layout_node(); - node_ptr np(n); + std::shared_ptr n = std::make_shared(); node_ptr child = node::from_xml(xml); n->set_child(child); @@ -77,7 +76,7 @@ node_ptr layout_node::from_xml(xml_node const& xml) n->rotate_displacement = xml.get_opt_attr("rotate-displacement"); n->orientation = xml.get_opt_attr("orientation"); - return np; + return n; } void layout_node::apply(char_properties_ptr p, feature_impl const& feature, text_layout &output) const