X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/355f240724ba1a4d9b4c7fc07766aa16883e436e..3faedeb065c67cb17ee8e271c9506e0477af5e3d:/src/generic/listctrl.cpp diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index b20d95fd8d..51af844c67 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -1808,13 +1808,17 @@ void wxListLineData::DrawTextFormatted(wxDC *dc, dc->GetTextExtent(ellipsis, &base_w, &h); // continue until we have enough space or only one character left - drawntext = text.Left(text.Length() - 1); - while (drawntext.Length() > 1) + wxCoord w_c, h_c; + size_t len = text.Length(); + drawntext = text.Left(len); + while (len > 1) { - dc->GetTextExtent(drawntext, &w, &h); + dc->GetTextExtent(drawntext.Last(), &w_c, &h_c); + drawntext.RemoveLast(); + len--; + w -= w_c; if (w + base_w <= width) break; - drawntext = drawntext.Left(drawntext.Length() - 1); } // if still not enough space, remove ellipsis characters @@ -4713,7 +4717,7 @@ bool wxGenericListCtrl::Create(wxWindow *parent, return FALSE; // don't create the inner window with the border - style &= ~wxSUNKEN_BORDER; + style &= ~wxBORDER_MASK; m_mainWin = new wxListMainWindow( this, -1, wxPoint(0,0), size, style );