X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d265ec6b0ebb945f23172f016782141adae33297..0f79c83f89a625c88fc95afd30a685c3124fe6c9:/src/xrc/xmlres.cpp diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index cce060b76e..fe712f89d5 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -75,7 +75,7 @@ wxDateTime GetXRCFileModTime(const wxString& filename) // Assign the given value to the specified entry or add a new value with this // name. -static void XRCID_Assign(const char *str_id, int value); +static void XRCID_Assign(const wxString& str_id, int value); class wxXmlResourceDataRecord { @@ -107,7 +107,7 @@ class wxXmlResourceDataRecords : public wxVector // this is a class so that it can be forward-declared }; -WX_DECLARE_HASH_SET_PTR(int, wxIntegerHash, wxIntegerEqual, wxHashSetInt); +WX_DECLARE_HASH_SET_PTR(int, ::wxIntegerHash, ::wxIntegerEqual, wxHashSetInt); class wxIdRange // Holds data for a particular rangename { @@ -1554,7 +1554,7 @@ wxString wxXmlResourceHandler::GetText(const wxString& param, bool translate) // like "&File..." -- this is illegal in XML, so we use "_File..."): if ( *dt == amp_char ) { - if ( *(++dt) == amp_char ) + if ( dt+1 == str1.end() || *(++dt) == amp_char ) str2 << amp_char; else str2 << wxT('&') << *dt; @@ -2491,15 +2491,16 @@ static inline unsigned XRCIdHash(const char *str_id) return index; } -static void XRCID_Assign(const char *str_id, int value) +static void XRCID_Assign(const wxString& str_id, int value) { - const unsigned index = XRCIdHash(str_id); + const wxCharBuffer buf_id(str_id.mb_str()); + const unsigned index = XRCIdHash(buf_id); XRCID_record *oldrec = NULL; for (XRCID_record *rec = XRCID_Records[index]; rec; rec = rec->next) { - if (wxStrcmp(rec->key, str_id) == 0) + if (wxStrcmp(rec->key, buf_id) == 0) { rec->id = value; return;