From e68488229654fdc655fc5cc077b6479e75208159 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Wed, 15 Aug 2012 16:01:50 +0200 Subject: [PATCH] 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 --- code/nel/src/gui/interface_element.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/nel/src/gui/interface_element.cpp b/code/nel/src/gui/interface_element.cpp index 81dbb584f..c30ca09cc 100644 --- a/code/nel/src/gui/interface_element.cpp +++ b/code/nel/src/gui/interface_element.cpp @@ -997,9 +997,11 @@ namespace NLGUI // ------------------------------------------------------------------------------------------------ bool CInterfaceElement::convertBool (const char *ptr) { - string str= ptr; - NLMISC::strlwr(str); - return str=="true"?true:false; + std::string str = ptr; + NLMISC::strlwr( str ); + bool b = false; + fromString( str, b ); + return b; } // ------------------------------------------------------------------------------------------------