X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aaa0312528610470651609e54cf0b9b80b260f2e..d863389f773348f5b6e06243050d4379d66de05d:/src/xrc/xmlres.cpp diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index dd6447b9fa..3a6cbefc6b 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -1031,13 +1031,17 @@ wxString wxXmlResourceHandler::GetName() +bool wxXmlResourceHandler::GetBoolAttr(const wxString& attr, bool defaultv) +{ + wxString v; + return m_node->GetAttribute(attr, &v) ? v == '1' : defaultv; +} + bool wxXmlResourceHandler::GetBool(const wxString& param, bool defaultv) { - wxString v = GetParamValue(param); - v.MakeLower(); - if (!v) return defaultv; + const wxString v = GetParamValue(param); - return (v == wxT("1")); + return v.empty() ? defaultv : (v == '1'); }