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