Compilation fix for STL build after ID range changes in XRC.

Fix compilation of the new code which relied on implicit conversion of
wxString to "const char *" which is unavailable when wxUSE_STL==1.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66066 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-11-07 22:13:55 +00:00
parent d807030e1e
commit e7cad4b7a1

View File

@@ -123,7 +123,7 @@ public:
int Find(const wxString& rangename) const; int Find(const wxString& rangename) const;
// Removes, if it exists, an entry from the XRCID table. Used in id-ranges // Removes, if it exists, an entry from the XRCID table. Used in id-ranges
// to replace defunct or statically-initialised entries with current values // to replace defunct or statically-initialised entries with current values
static void RemoveXRCIDEntry(const char *str_id); static void RemoveXRCIDEntry(const wxString& idstr);
protected: protected:
wxIdRange* FindRangeForItem(const wxXmlNode* node, wxIdRange* FindRangeForItem(const wxXmlNode* node,
@@ -1185,9 +1185,11 @@ void wxIdRange::Finalise(const wxXmlNode* node)
// Use the second parameter of GetXRCID to force it to take the value i // Use the second parameter of GetXRCID to force it to take the value i
wxXmlResource::GetXRCID(m_name + wxString::Format("[%i]", i-m_start), i); wxXmlResource::GetXRCID(m_name + wxString::Format("[%i]", i-m_start), i);
wxLogTrace("xrcrange","integer = %i %s now returns %i", i, wxLogTrace("xrcrange",
m_name + wxString::Format("[%i]", i-m_start).mb_str(), "integer = %i %s now returns %i",
XRCID(m_name + wxString::Format("[%i]", i-m_start).mb_str())); i,
m_name + wxString::Format("[%i]", i-m_start),
XRCID((m_name + wxString::Format("[%i]", i-m_start)).mb_str()));
} }
// and these special ones // and these special ones
wxIdRangeManager::RemoveXRCIDEntry(m_name + "[start]"); wxIdRangeManager::RemoveXRCIDEntry(m_name + "[start]");
@@ -2627,8 +2629,10 @@ wxString wxXmlResource::FindXRCIDById(int numId)
} }
/* static */ /* static */
void wxIdRangeManager::RemoveXRCIDEntry(const char *str_id) void wxIdRangeManager::RemoveXRCIDEntry(const wxString& idstr)
{ {
const char *str_id = idstr.mb_str();
const unsigned index = XRCIdHash(str_id); const unsigned index = XRCIdHash(str_id);
XRCID_record **p_previousrec = &XRCID_Records[index]; XRCID_record **p_previousrec = &XRCID_Records[index];