diff --git a/include/mapnik/symbolizer.hpp b/include/mapnik/symbolizer.hpp index 5fbfae489..ab9a255c4 100644 --- a/include/mapnik/symbolizer.hpp +++ b/include/mapnik/symbolizer.hpp @@ -277,43 +277,26 @@ struct enum_traits } }; -template <> -struct enum_traits -{ - typedef boost::optional result_type; - static result_type from_string(std::string const& str) - { - enumeration e; - try - { - e.from_string(str); - return result_type(line_join_enum(e)); - } - catch (...) - { - return result_type(); - } - } -}; +#define ENUM_FROM_STRING( e ) \ +template <> struct enum_traits { \ + typedef boost::optional result_type; \ + static result_type from_string(std::string const& str) \ + { \ + enumeration enum_; \ + try \ + { \ + enum_.from_string(str); \ + return result_type(e(enum_)); \ + } \ + catch (...) \ + { \ + return result_type(); \ + } \ + } \ +};\ -template <> -struct enum_traits -{ - typedef boost::optional result_type; - static result_type from_string(std::string const& str) - { - enumeration e; - try - { - e.from_string(str); - return result_type(line_cap_enum(e)); - } - catch (...) - { - return result_type(); - } - } -}; +ENUM_FROM_STRING( line_join_enum ) +ENUM_FROM_STRING( line_cap_enum ) // enum template diff --git a/src/load_map.cpp b/src/load_map.cpp index 0b3647c06..f88d02378 100644 --- a/src/load_map.cpp +++ b/src/load_map.cpp @@ -891,12 +891,13 @@ struct set_symbolizer_property_impl { optional val = node.get_opt_attr(name); if (val) put(sym, key, *val); + else MAPNIK_LOG_ERROR(Symbolizer) << " failed to parse:" << name; } } } catch (config_error const& ex) { - MAPNIK_LOG_ERROR(composite_mode_e) << ex.what(); + MAPNIK_LOG_ERROR(Symbolizer) << ex.what(); } } };