fix handling of long lines in wxGridCellAutoWrapStringRenderer
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59121 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -280,10 +280,20 @@ wxGridCellAutoWrapStringRenderer::GetTextLines(wxGrid& grid,
|
|||||||
dc.GetTextExtent(tok, &x, &y);
|
dc.GetTextExtent(tok, &x, &y);
|
||||||
if ( curr_x + x > max_x)
|
if ( curr_x + x > max_x)
|
||||||
{
|
{
|
||||||
lines.Add( wxString(thisline) );
|
if ( curr_x == 0 )
|
||||||
|
{
|
||||||
|
// this means that a single token is wider than the maximal
|
||||||
|
// width -- still use it as is as we need to show at least the
|
||||||
|
// part of it which fits
|
||||||
|
lines.Add(tok);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lines.Add(thisline);
|
||||||
thisline = tok;
|
thisline = tok;
|
||||||
curr_x = x;
|
curr_x = x;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
thisline+= tok;
|
thisline+= tok;
|
||||||
|
Reference in New Issue
Block a user