mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-07 22:38:17 +02:00
LCL/Grids: Remove internal function PointIgual(), use built-in TPoint operator <> instead, issue #39850.
This commit is contained in:
parent
6f93306bce
commit
024e28702a
@ -1985,11 +1985,6 @@ begin
|
|||||||
Result.Y := BidiFlipX(Result.Y, ParentRect, Flip);
|
Result.Y := BidiFlipX(Result.Y, ParentRect, Flip);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function PointIgual(const P1,P2: TPoint): Boolean;
|
|
||||||
begin
|
|
||||||
result:=(P1.X=P2.X)and(P1.Y=P2.Y);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function NormalizarRect(const R:TRect): TRect;
|
function NormalizarRect(const R:TRect): TRect;
|
||||||
begin
|
begin
|
||||||
Result.Left:=Min(R.Left, R.Right);
|
Result.Left:=Min(R.Left, R.Right);
|
||||||
@ -3730,13 +3725,12 @@ begin
|
|||||||
TLRowOffChanged := True;
|
TLRowOffChanged := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Result:=not PointIgual(OldTopleft,FTopLeft)
|
Result := (OldTopLeft <> FTopLeft) or TLColOffChanged or TLRowOffChanged;
|
||||||
or TLColOffChanged or TLRowOffChanged;
|
|
||||||
|
|
||||||
BeginUpdate;
|
BeginUpdate;
|
||||||
try
|
try
|
||||||
if Result then begin
|
if Result then begin
|
||||||
if not PointIgual(OldTopleft,FTopLeft) then
|
if (OldTopLeft <> FTopLeft) then
|
||||||
doTopleftChange(False)
|
doTopleftChange(False)
|
||||||
else
|
else
|
||||||
VisualChange;
|
VisualChange;
|
||||||
@ -5048,9 +5042,9 @@ var
|
|||||||
TLChange: Boolean;
|
TLChange: Boolean;
|
||||||
begin
|
begin
|
||||||
TryTL:=ScrollGrid(False,aCol, aRow);
|
TryTL:=ScrollGrid(False,aCol, aRow);
|
||||||
TLChange := not PointIgual(TryTL, FTopLeft);
|
TLChange := (TryTL <> FTopLeft);
|
||||||
if TLChange
|
if TLChange
|
||||||
or (not PointIgual(TryTL, Point(aCol, aRow)) and (goSmoothScroll in Options))
|
or ((TryTL <> Point(aCol, aRow)) and (goSmoothScroll in Options))
|
||||||
or (ClearColOff and (FGCache.TLColOff<>0))
|
or (ClearColOff and (FGCache.TLColOff<>0))
|
||||||
or (ClearRowOff and (FGCache.TLRowOff<>0)) then
|
or (ClearRowOff and (FGCache.TLRowOff<>0)) then
|
||||||
begin
|
begin
|
||||||
@ -5127,7 +5121,7 @@ begin
|
|||||||
if not GetSmoothScroll(SB_Vert) then
|
if not GetSmoothScroll(SB_Vert) then
|
||||||
FGCache.TLRowOff := 0;
|
FGCache.TLRowOff := 0;
|
||||||
|
|
||||||
if not PointIgual(OldTopleft,FTopLeft) then begin
|
if OldTopLeft <> FTopLeft then begin
|
||||||
TopLeftChanged;
|
TopLeftChanged;
|
||||||
if goScrollKeepVisible in Options then
|
if goScrollKeepVisible in Options then
|
||||||
MoveNextSelectable(False, FTopLeft.x - oldTopLeft.x + col,
|
MoveNextSelectable(False, FTopLeft.x - oldTopLeft.x + col,
|
||||||
@ -5138,8 +5132,7 @@ begin
|
|||||||
ScrollBy((OldTopLeftXY.x-NewTopLeftXY.x)*RTLSign, OldTopLeftXY.y-NewTopLeftXY.y);
|
ScrollBy((OldTopLeftXY.x-NewTopLeftXY.x)*RTLSign, OldTopLeftXY.y-NewTopLeftXY.y);
|
||||||
|
|
||||||
//Result is false if this function failed due to a too high/wide cell (applicable only if goSmoothScroll not used)
|
//Result is false if this function failed due to a too high/wide cell (applicable only if goSmoothScroll not used)
|
||||||
Result :=
|
Result := (OldTopLeftXY <> NewTopLeftXY)
|
||||||
not PointIgual(OldTopLeftXY, NewTopLeftXY)
|
|
||||||
or ((NewTopLeftXY.x = 0) and (aColDelta < 0))
|
or ((NewTopLeftXY.x = 0) and (aColDelta < 0))
|
||||||
or ((FTopLeft.x = FGCache.MaxTopLeft.x) and (FGCache.TLColOff = FGCache.MaxTLOffset.x) and (aColDelta > 0))
|
or ((FTopLeft.x = FGCache.MaxTopLeft.x) and (FGCache.TLColOff = FGCache.MaxTLOffset.x) and (aColDelta > 0))
|
||||||
or ((NewTopLeftXY.y = 0) and (aRowDelta < 0))
|
or ((NewTopLeftXY.y = 0) and (aRowDelta < 0))
|
||||||
@ -5502,7 +5495,7 @@ begin
|
|||||||
//DebugLn('TCustomGrid.CheckTopLeft A ',DbgSName(Self),' FTopLeft=',dbgs(FTopLeft));
|
//DebugLn('TCustomGrid.CheckTopLeft A ',DbgSName(Self),' FTopLeft=',dbgs(FTopLeft));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Result := not PointIgual(OldTopleft,FTopLeft);
|
Result := (OldTopLeft <> FTopLeft);
|
||||||
if Result then
|
if Result then
|
||||||
doTopleftChange(False)
|
doTopleftChange(False)
|
||||||
end;
|
end;
|
||||||
@ -8950,7 +8943,7 @@ var
|
|||||||
if OldTL.Y<FixedRows then
|
if OldTL.Y<FixedRows then
|
||||||
OldTL.Y:=FixedRows;
|
OldTL.Y:=FixedRows;
|
||||||
end;
|
end;
|
||||||
if not PointIgual(OldTL, FTopleft) then begin
|
if (OldTL <> FTopLeft) then begin
|
||||||
fTopLeft := OldTL;
|
fTopLeft := OldTL;
|
||||||
//DebugLn('TCustomGrid.FixPosition ',DbgSName(Self),' FTopLeft=',dbgs(FTopLeft));
|
//DebugLn('TCustomGrid.FixPosition ',DbgSName(Self),' FTopLeft=',dbgs(FTopLeft));
|
||||||
topleftChanged;
|
topleftChanged;
|
||||||
|
Loading…
Reference in New Issue
Block a user