Fix compilation in wxUSE_STL case broken by r69663.

Don't rely on implicit wxString to char* conversion when calling
XRCID_Assign().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69721 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-11-10 00:30:10 +00:00
parent 4fb1e79b4d
commit 3cf2fe5444

View File

@@ -75,7 +75,7 @@ wxDateTime GetXRCFileModTime(const wxString& filename)
// Assign the given value to the specified entry or add a new value with this // Assign the given value to the specified entry or add a new value with this
// name. // name.
static void XRCID_Assign(const char *str_id, int value); static void XRCID_Assign(const wxString& str_id, int value);
class wxXmlResourceDataRecord class wxXmlResourceDataRecord
{ {
@@ -2491,15 +2491,16 @@ static inline unsigned XRCIdHash(const char *str_id)
return index; 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); wxScopedCharBuffer buf_id(str_id.mb_str());
const unsigned index = XRCIdHash(buf_id);
XRCID_record *oldrec = NULL; XRCID_record *oldrec = NULL;
for (XRCID_record *rec = XRCID_Records[index]; rec; rec = rec->next) 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; rec->id = value;
return; return;