Changed handling of enums not in the EnumBox

This commit is contained in:
Ingo Ruhnke 2010-11-22 16:00:04 +01:00
parent 2ab11f1798
commit 1bcf80ad84

View file

@ -52,9 +52,7 @@ public:
typename std::map<std::string, Enum>::const_iterator i = m_string2enum.find(str);
if (i == m_string2enum.end())
{
std::ostringstream out;
out << "Couldn't convert '" << str << "' to enum " << m_name << std::endl;
throw std::runtime_error(out.str());
return static_cast<Enum>(boost::lexical_cast<int>(str));
}
else
{
@ -67,8 +65,8 @@ public:
if (i == m_enum2string.end())
{
std::ostringstream out;
out << "Couldn't convert '" << v << "' to string" << std::endl;
throw std::runtime_error(out.str());
out << v;
return out.str();
}
else
{