LCL: Fix range check error in StringGrid when sorting and RowCount=FixedRows, issue #21947

git-svn-id: trunk@37167 -
This commit is contained in:
juha 2012-05-05 23:38:50 +00:00
parent d17e688df7
commit ffa0f2e2dd

View File

@ -2890,12 +2890,14 @@ procedure TCustomGrid.Sort(ColSorting: Boolean; index, IndxFrom, IndxTo: Integer
until I>=R;
end;
begin
CheckIndex(ColSorting, Index);
CheckIndex(not ColSorting, IndxFrom);
CheckIndex(not ColSorting, IndxTo);
BeginUpdate;
QuickSort(IndxFrom, IndxTo);
EndUpdate;
if RowCount>FixedRows then begin
CheckIndex(ColSorting, Index);
CheckIndex(not ColSorting, IndxFrom);
CheckIndex(not ColSorting, IndxTo);
BeginUpdate;
QuickSort(IndxFrom, IndxTo);
EndUpdate;
end;
end;
procedure TCustomGrid.doTopleftChange(dimChg: Boolean);