CHANGED: #1471 CInterfaceElement::convertBool is now implemented with NLMISC::fromString, and can convert both 0/1 and false/true style strings to boolean.

--HG--
branch : gsoc2012-gui-editor
hg/feature/sse2
dfighter1985 12 years ago
parent 875f8814b7
commit e684882296

@ -997,9 +997,11 @@ namespace NLGUI
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
bool CInterfaceElement::convertBool (const char *ptr) bool CInterfaceElement::convertBool (const char *ptr)
{ {
string str= ptr; std::string str = ptr;
NLMISC::strlwr(str); NLMISC::strlwr( str );
return str=="true"?true:false; bool b = false;
fromString( str, b );
return b;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------

Loading…
Cancel
Save