Fixme removal.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31009 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba 2004-12-14 20:32:24 +00:00
parent d76bb5b289
commit 50c6bf91c8

View File

@ -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;