diff --git a/src/generic/gridctrl.cpp b/src/generic/gridctrl.cpp index 4e9dcd6e48..beeea9d250 100644 --- a/src/generic/gridctrl.cpp +++ b/src/generic/gridctrl.cpp @@ -301,6 +301,11 @@ wxGridCellAutoWrapStringRenderer::GetTextLines(wxGrid& grid, const wxArrayString logicalLines = wxSplit(grid.GetCellValue(row, col), '\n', '\0'); + // Trying to do anything if the column is hidden anyhow doesn't make sense + // and we run into problems in BreakLine() in this case. + if ( maxWidth <= 0 ) + return logicalLines; + wxArrayString physicalLines; for ( wxArrayString::const_iterator it = logicalLines.begin(); it != logicalLines.end();