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
This commit is contained in:
Vadim Zeitlin
2013-09-04 00:14:05 +00:00
parent bd21f7eaf0
commit 85d2dec9f0

View File

@@ -301,6 +301,11 @@ wxGridCellAutoWrapStringRenderer::GetTextLines(wxGrid& grid,
const wxArrayString const wxArrayString
logicalLines = wxSplit(grid.GetCellValue(row, col), '\n', '\0'); 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; wxArrayString physicalLines;
for ( wxArrayString::const_iterator it = logicalLines.begin(); for ( wxArrayString::const_iterator it = logicalLines.begin();
it != logicalLines.end(); it != logicalLines.end();