LCL, grids, check for column index growing too big. Which may cause exception on trying to get invalid column width

git-svn-id: trunk@46237 -
This commit is contained in:
jesus 2014-09-14 22:34:14 +00:00
parent 4145473e3d
commit 187a700a04

View File

@ -5516,11 +5516,20 @@ begin
end;
end;
while Offset>(integer(PtrUInt(AccumWidth[Index]))+GetColWidths(Index)-1) do
while Offset>(integer(PtrUInt(AccumWidth[Index]))+GetColWidths(Index)-1) do begin
Inc(Index);
if Index>=ColCount then begin
if AllowOutBoundEvents then
Index := ColCount-1
else
Index := -1;
exit;
end;
end;
Rest:=Offset;
if Index<>0 then Rest:=Offset-integer(PtrUInt(AccumWidth[Index]));
if Index<>0 then
Rest:=Offset-integer(PtrUInt(AccumWidth[Index]));
end else begin