SynEdit: fix compare function

git-svn-id: trunk@61157 -
This commit is contained in:
martin 2019-05-05 15:48:43 +00:00
parent 80f32f0ac9
commit eb2966c1f0

View File

@ -30,7 +30,7 @@ uses
Classes, Graphics, Controls, LCLProc, LCLType, LCLIntf, Forms, LMessages, Classes, Graphics, Controls, LCLProc, LCLType, LCLIntf, Forms, LMessages,
FPCanvas, sysutils, math, SynGutterBase, SynEditTypes, LazSynEditText, FPCanvas, sysutils, math, SynGutterBase, SynEditTypes, LazSynEditText,
SynEditTextBuffer, SynEditMarks, SynEditMiscClasses, SynEditFoldedView, SynEditTextBuffer, SynEditMarks, SynEditMiscClasses, SynEditFoldedView,
SynEditMouseCmds; SynEditMouseCmds, LazUtilities;
type type
TSynGutterLineOverview = class; TSynGutterLineOverview = class;
@ -349,9 +349,7 @@ begin
if Result <> 0 then exit; if Result <> 0 then exit;
Result := Column - Other.Column; Result := Column - Other.Column;
if Result <> 0 then exit; if Result <> 0 then exit;
{$PUSH}{$Q-} // Overflow is allowed to occur Result := ComparePointers(Pointer(self), PtrUInt(Other)));
Result := Integer(PtrUint(self) - PtrUInt(Other));
{$POP}
end; end;
function TSynGutterLOvMark.CompareByLine(Other: TSynGutterLOvMark): Integer; function TSynGutterLOvMark.CompareByLine(Other: TSynGutterLOvMark): Integer;
@ -362,9 +360,7 @@ begin
if Result <> 0 then exit; if Result <> 0 then exit;
Result := Priority - Other.Priority; Result := Priority - Other.Priority;
if Result <> 0 then exit; if Result <> 0 then exit;
{$PUSH}{$Q-} // Overflow is allowed to occur Result := ComparePointers(Pointer(self), PtrUInt(Other)));
Result := Integer(PtrUint(self) - PtrUInt(Other));
{$POP}
end; end;
procedure TSynGutterLOvMark.DoChange; procedure TSynGutterLOvMark.DoChange;
@ -463,9 +459,7 @@ function TSynGutterLOvLineMarks.Compare(Other: TSynGutterLOvLineMarks): Integer;
begin begin
Result := PixLine - Other.PixLine; Result := PixLine - Other.PixLine;
if Result <> 0 then exit; if Result <> 0 then exit;
{$PUSH}{$Q-} // Overflow is allowed to occur Result := ComparePointers(Pointer(self), PtrUInt(Other)));
Result := Integer(PtrUint(self) - PtrUInt(Other));
{$POP}
end; end;
constructor TSynGutterLOvLineMarks.Create; constructor TSynGutterLOvLineMarks.Create;