From: Vadim Zeitlin Date: Wed, 4 Sep 2013 00:14:05 +0000 (+0000) Subject: Don't crash in wxGridCellAutoWrapStringRenderer when the column is hidden. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/85d2dec9f022748a678a3534851b8dcf76c56fa8 Don't crash in wxGridCellAutoWrapStringRenderer when the column is hidden. Our methods should arguably not be called at all in this case, but if this does happen, at least don't crash. Closes #15464. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74750 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- 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();