diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index ed11e6c7e0..09c4fde9d5 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -6086,7 +6086,11 @@ void wxGrid::DrawGridCellArea( wxDC& dc, const wxGridCellCoordsArray& cells ) { if (!m_table->IsEmptyCell(row + l, j)) { - if (GetCellOverflow(row + l, j)) + wxGridCellAttr *attr = GetCellAttr(row + l, j); + const bool canOverflow = attr->CanOverflow(); + attr->DecRef(); + + if ( canOverflow ) { wxGridCellCoords cell(row + l, j); bool marked = false; diff --git a/src/generic/gridctrl.cpp b/src/generic/gridctrl.cpp index 0efd1b499a..0d04d89e34 100644 --- a/src/generic/gridctrl.cpp +++ b/src/generic/gridctrl.cpp @@ -591,7 +591,7 @@ void wxGridCellStringRenderer::Draw(wxGrid& grid, // erase only this cells background, overflow cells should have been erased wxGridCellRenderer::Draw(grid, attr, dc, rectCell, row, col, isSelected); - if (attr.GetOverflow()) + if ( attr.CanOverflow() ) { int hAlign, vAlign; attr.GetAlignment(&hAlign, &vAlign);