Avoid accessing grid data array elements over its bounds in Datagrid.OnBeforeCellPaint, while painting NULL cell background. Can happen as RootNodeCount is set asynchronously to scrolling. Fixes issue #1497 and friends.

This commit is contained in:
Ansgar Becker
2009-12-01 13:16:43 +00:00
parent 96f0478cb0
commit 14ff384039

View File

@@ -7411,6 +7411,7 @@ begin
Exit;
gr := GridResult(Sender);
EnsureChunkLoaded(Sender, Node);
if Node.Index >= Cardinal(Length(gr.Rows)) then Exit;
if (Node = Sender.FocusedNode) and (Column = Sender.FocusedColumn) then begin
if not Sender.IsEditing then begin
// Editors may not cover the whole cell rectangle, so any colored area looks broken then