mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-25 08:16:16 +00:00
CHANGED: #1471 CInterfaceElement::convertBool is now implemented with NLMISC::fromString, and can convert both 0/1 and false/true style strings to boolean.
This commit is contained in:
parent
518ccded0b
commit
37f373fc44
1 changed files with 5 additions and 3 deletions
|
@ -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…
Reference in a new issue