Skip to content
Browse files

Replace remaining parse_expression() calls.

Closes #1168.
  • Loading branch information...
1 parent dd9276b commit 82d7a63ef6562d26b37a13aff23cd5007420cba1 @herm herm committed Jul 4, 2012
Showing with 6 additions and 7 deletions.
  1. +2 −2 src/formatting/expression.cpp
  2. +4 −5 src/text_properties.cpp
View
4 src/formatting/expression.cpp
@@ -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
9 src/text_properties.cpp
@@ -110,22 +110,21 @@ 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");
if (dy) displacement.second = *dy;
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);

0 comments on commit 82d7a63

Please sign in to comment.
Something went wrong with that request. Please try again.