Replace remaining parse_expression() calls.

Closes #1168.
This commit is contained in:
Hermann Kraus 2012-07-04 20:59:36 +02:00
parent dd9276b1ef
commit 82d7a63ef6
2 changed files with 6 additions and 7 deletions

View file

@ -74,8 +74,8 @@ node_ptr expression_format::from_xml(xml_node const& xml)
expression_ptr expression_format::get_expression(xml_node const& xml, std::string name)
{
boost::optional<std::string> tmp = xml.get_opt_attr<std::string>(name);
if (tmp) return parse_expression(*tmp);
boost::optional<expression_ptr> tmp = xml.get_opt_attr<expression_ptr>(name);
if (tmp) return *tmp;
return expression_ptr();
}

View file

@ -110,9 +110,8 @@ void text_symbolizer_properties::from_xml(xml_node const &sym, fontset_map const
if (halign_) halign = *halign_;
optional<justify_alignment_e> jalign_ = sym.get_opt_attr<justify_alignment_e>("justify-alignment");
if (jalign_) jalign = *jalign_;
/* Attributes needing special care */
optional<std::string> orientation_ = sym.get_opt_attr<std::string>("orientation");
if (orientation_) orientation = parse_expression(*orientation_, "utf8");
optional<expression_ptr> orientation_ = sym.get_opt_attr<expression_ptr>("orientation");
if (orientation_) orientation = *orientation_;
optional<double> dx = sym.get_opt_attr<double>("dx");
if (dx) displacement.first = *dx;
optional<double> dy = sym.get_opt_attr<double>("dy");
@ -120,12 +119,12 @@ void text_symbolizer_properties::from_xml(xml_node const &sym, fontset_map const
optional<double> max_char_angle_delta_ = sym.get_opt_attr<double>("max-char-angle-delta");
if (max_char_angle_delta_) max_char_angle_delta=(*max_char_angle_delta_)*(M_PI/180);
optional<std::string> name_ = sym.get_opt_attr<std::string>("name");
optional<expression_ptr> name_ = sym.get_opt_attr<expression_ptr>("name");
if (name_)
{
MAPNIK_LOG_WARN(text_placements) << "Using 'name' in TextSymbolizer/ShieldSymbolizer is deprecated!";
set_old_style_expression(parse_expression(*name_, "utf8"));
set_old_style_expression(*name_);
}
format.from_xml(sym, fontsets);