LCL: Simplify TCustomGrid code a little.

git-svn-id: trunk@30536 -
This commit is contained in:
juha 2011-05-03 08:58:04 +00:00
parent 82fa636bdc
commit 112fd87d96

View File

@ -6462,7 +6462,6 @@ var
OldRange: TRect; OldRange: TRect;
ForceReset: boolean; ForceReset: boolean;
begin begin
Result:=TryMoveSelection(Relative,DCol,DRow); Result:=TryMoveSelection(Relative,DCol,DRow);
if (not Result) then Exit; if (not Result) then Exit;
@ -6492,8 +6491,8 @@ begin
if not ScrollToCell(DCol, DRow, ForceReset) then if not ScrollToCell(DCol, DRow, ForceReset) then
InvalidateMovement(DCol, DRow, OldRange); InvalidateMovement(DCol, DRow, OldRange);
SwapInt(DCol,FCol); FCol := DCol;
SwapInt(DRow,FRow); FRow := DRow;
MoveSelection; MoveSelection;
SelectEditor; SelectEditor;
@ -6581,17 +6580,18 @@ begin
if FixedGrid then if FixedGrid then
exit; exit;
dCol:=FCol*(1-Byte(not Relative))+DCol; if Relative then begin
dRow:=FRow*(1-Byte(not Relative))+DRow; Inc(DCol, FCol);
Inc(DRow, FRow);
end;
CheckLimits(DCol, DRow); CheckLimits(DCol, DRow);
// Change on Focused cell? // Change on Focused cell?
if (Dcol=FCol) and (DRow=FRow) then begin if (DCol=FCol) and (DRow=FRow) then
SelectCell(DCol,DRow); SelectCell(DCol,DRow)
end else begin else
Result:=SelectCell(DCol,DRow); Result:=SelectCell(DCol,DRow);
end;
end; end;
procedure TCustomGrid.UnLockEditor; procedure TCustomGrid.UnLockEditor;