X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/29efc6e4a478652d6f59fb3f5ca7990d78a8ead4..9d5cfd0e64a2c09d957517405758de680806e674:/src/generic/gridctrl.cpp?ds=sidebyside diff --git a/src/generic/gridctrl.cpp b/src/generic/gridctrl.cpp index d1df91d099..3098fd5ad5 100644 --- a/src/generic/gridctrl.cpp +++ b/src/generic/gridctrl.cpp @@ -24,6 +24,9 @@ #include "wx/textctrl.h" #include "wx/dc.h" #include "wx/combobox.h" + #include "wx/settings.h" + #include "wx/log.h" + #include "wx/checkbox.h" #endif // WX_PRECOMP #include "wx/tokenzr.h" @@ -277,9 +280,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 {