From 85d2dec9f022748a678a3534851b8dcf76c56fa8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 4 Sep 2013 00:14:05 +0000 Subject: [PATCH] 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 --- src/generic/gridctrl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/generic/gridctrl.cpp b/src/generic/gridctrl.cpp index 4e9dcd6..beeea9d 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(); -- 2.7.4