Fixed buffer overrun in call to wxStripMenuCodes()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9202 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
George Tasker
2001-01-28 19:29:23 +00:00
parent 3377b96271
commit f2ab8671bf

View File

@@ -73,11 +73,7 @@ bool wxOwnerDrawn::OnMeasureItem(size_t *pwidth, size_t *pheight)
wxMemoryDC dc;
dc.SetFont(GetFont());
// ## ugly...
wxChar *szStripped = new wxChar[m_strName.Len()];
wxStripMenuCodes((wxChar *)m_strName.c_str(), szStripped);
wxString str = szStripped;
delete [] szStripped;
wxString str = wxStripMenuCodes(m_strName);
// # without this menu items look too tightly packed (at least under Windows)
str += wxT('W'); // 'W' is typically the widest letter