X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cc378c2d7521e58e6f067470b798e9c81dd08c61..c12822fec7f87e7734cabbfcf23b99685fc371ce:/src/xrc/xmlres.cpp?ds=sidebyside diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index bd6c432084..ae88b74358 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -497,7 +497,7 @@ bool wxXmlResource::UpdateResources() delete rec->Doc; rec->Doc = new wxXmlDocument; } - if (!stream || !rec->Doc->Load(*stream, encoding)) + if (!stream || !stream->IsOk() || !rec->Doc->Load(*stream, encoding)) { wxLogError(_("Cannot load resources from file '%s'."), rec->File); @@ -1193,14 +1193,20 @@ wxXmlNode *wxXmlResourceHandler::GetParamNode(const wxString& param) while (n) { if (n->GetType() == wxXML_ELEMENT_NODE && n->GetName() == param) + { + // TODO: check that there are no other properties/parameters with + // the same name and log an error if there are (can't do this + // right now as I'm not sure if it's not going to break code + // using this function in unintentional way (i.e. for + // accessing other things than properties), for example + // wxBitmapComboBoxXmlHandler almost surely does return n; + } n = n->GetNext(); } return NULL; } - - bool wxXmlResourceHandler::IsOfClass(wxXmlNode *node, const wxString& classname) { return node->GetAttribute(wxT("class"), wxEmptyString) == classname;