From 07c18710a375e528fb4a5501b75ff5d7562959bf Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 25 Feb 2009 00:09:23 +0000 Subject: [PATCH] fix handling of long lines in wxGridCellAutoWrapStringRenderer git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@59121 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/generic/gridctrl.cpp | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index a682ea96ff..211a858bbc 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -133,6 +133,7 @@ All (GUI): - Use bitmap mask in wxSplashScreen. - Translate "(c)" and "(C)" to the real copyright sign in wxAboutBox. - Fix painting of highlight border for merged cells in wxGrid (K. Jones). +- Fix handling of long lines in wxGridCellAutoWrapStringRenderer. All (Unix): diff --git a/src/generic/gridctrl.cpp b/src/generic/gridctrl.cpp index a145b6507d..e964cebab6 100644 --- a/src/generic/gridctrl.cpp +++ b/src/generic/gridctrl.cpp @@ -357,9 +357,19 @@ wxGridCellAutoWrapStringRenderer::GetTextLines(wxGrid& grid, dc.GetTextExtent(tok, &x, &y); if ( curr_x + x > max_x) { - lines.Add( wxString(thisline) ); - thisline = tok; - curr_x=x; + 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; + curr_x = x; + } } else {