Fixme removal.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31009 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
d76bb5b289
commit
50c6bf91c8
@ -646,14 +646,11 @@ void wxListBox::SetHorizontalExtent(const wxString& s)
|
||||
|
||||
GetTextMetrics(dc, &lpTextMetric);
|
||||
|
||||
// FIXME: buffer overflow!!
|
||||
wxChar buf[1024];
|
||||
for (int i = 0; i < m_noItems; i++)
|
||||
{
|
||||
int len = (int)SendMessage(GetHwnd(), LB_GETTEXT, i, (LPARAM)buf);
|
||||
buf[len] = 0;
|
||||
wxString str = GetString(i);
|
||||
SIZE extentXY;
|
||||
::GetTextExtentPoint(dc, buf, len, &extentXY);
|
||||
::GetTextExtentPoint(dc, str.c_str(), str.length(), &extentXY);
|
||||
int extentX = (int)(extentXY.cx + lpTextMetric.tmAveCharWidth);
|
||||
if (extentX > largestExtent)
|
||||
largestExtent = extentX;
|
||||
|
Loading…
Reference in New Issue
Block a user