Fix drawing of grid cells appearing inside a multicell
Grid cells are considered for redrawing solely based on having
a (text) value. This can lead to infinite recursion with overflowing
inside cells if wxGridCellStringRenderer::Draw() wants to draw cells
appearing after this one but instead visits the same cell again (because
of a negative cell size as opposed to expected default cell size of 1x1
or a larger spanning size) and calls DrawCell() again for this cell
which will call the renderer's Draw() again etc...
Fix by not taking inside cells into consideration for redrawing. This
is the right thing to do as earlier on in the same function a cell is
not drawn for the same reason. Also the aforementioned Draw() mentions
it shouldn't be called for cell sizes <= 0.
Also fixes the crashing grid test just introduced in 6d3dbc3fe5
.
This commit is contained in:
@@ -6217,6 +6217,12 @@ void wxGrid::DrawGridCellArea( wxDC& dc, const wxGridCellCoordsArray& cells )
|
||||
{
|
||||
if (!m_table->IsEmptyCell(row + l, j))
|
||||
{
|
||||
int numRows, numCols;
|
||||
if ( GetCellSize(row + l, j, &numRows, &numCols)
|
||||
== wxGrid::CellSpan_Inside )
|
||||
// As above: don't bother drawing inside cells.
|
||||
continue;
|
||||
|
||||
if ( GetCellAttrPtr(row + l, j)->CanOverflow() )
|
||||
{
|
||||
wxGridCellCoords cell(row + l, j);
|
||||
|
Reference in New Issue
Block a user