mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 23:58:06 +02:00
Move functions CompareCaret and CompareBoolean away from IDEProcs, to LCLProc and LazUtilities respectively.
git-svn-id: trunk@58618 -
This commit is contained in:
parent
1ff8e1a88e
commit
0500052f06
@ -17,6 +17,7 @@ uses
|
||||
|
||||
procedure FreeThenNil(var obj);
|
||||
function ComparePointers(p1, p2: Pointer): integer; inline;
|
||||
function CompareBoolean(b1, b2: boolean): integer;
|
||||
|
||||
{ MergeSortWithLen:
|
||||
sort ascending, e.g. Compare(List[0],List[1])<0
|
||||
@ -58,6 +59,16 @@ begin
|
||||
Result:=0;
|
||||
end;
|
||||
|
||||
function CompareBoolean(b1, b2: boolean): integer;
|
||||
begin
|
||||
if b1=b2 then
|
||||
Result:=0
|
||||
else if b1 then
|
||||
Result:=1
|
||||
else
|
||||
Result:=-1;
|
||||
end;
|
||||
|
||||
procedure MergeSortWithLen(List: PPointer; ListLength: PtrInt;
|
||||
const Compare: TListSortCompare);
|
||||
var
|
||||
|
@ -40,7 +40,7 @@ uses
|
||||
// IdeIntf
|
||||
IDEHelpIntf, IDEDialogs,
|
||||
// IDE
|
||||
LazarusIDEStrConsts, IDEProcs, MiscOptions;
|
||||
LazarusIDEStrConsts, MiscOptions;
|
||||
|
||||
type
|
||||
|
||||
|
@ -36,7 +36,7 @@ uses
|
||||
Laz2_DOM, Laz2_XMLRead, LazUtilities, LazTracer,
|
||||
// LCL
|
||||
LResources, StdCtrls, Buttons, ComCtrls, Controls, Dialogs,
|
||||
ExtCtrls, Forms, Graphics, LCLType,
|
||||
ExtCtrls, Forms, Graphics, LCLType, LCLProc,
|
||||
// Synedit
|
||||
SynEdit, SynHighlighterXML,
|
||||
// codetools
|
||||
@ -45,7 +45,7 @@ uses
|
||||
IDEWindowIntf, ProjectIntf, LazIDEIntf, IDEHelpIntf, Menus,
|
||||
SrcEditorIntf, IDEDialogs, LazFileUtils, IDEImagesIntf,
|
||||
// IDE
|
||||
IDEOptionDefs, EnvironmentOpts, PackageSystem, IDEProcs, LazarusIDEStrConsts,
|
||||
IDEOptionDefs, EnvironmentOpts, PackageSystem, LazarusIDEStrConsts,
|
||||
FPDocSelectInherited, FPDocSelectLink, CodeHelp;
|
||||
|
||||
type
|
||||
|
@ -254,8 +254,6 @@ function ProgramDirectory(BundleRoot: boolean): string;
|
||||
procedure RaiseException(const Msg: string);
|
||||
|
||||
// miscellaneous
|
||||
function CompareCaret(const FirstCaret, SecondCaret: TPoint): integer;
|
||||
function CompareBoolean(b1, b2: boolean): integer;
|
||||
procedure CheckList(List: TList; TestListNil, TestDoubles, TestNils: boolean);
|
||||
procedure CheckList(List: TFPList; TestListNil, TestDoubles, TestNils: boolean);
|
||||
procedure CheckEmptyListCut(List1, List2: TList);
|
||||
@ -1213,26 +1211,6 @@ begin
|
||||
Params:=RightStr(CmdLine,length(CmdLine)-p+1);
|
||||
end;
|
||||
|
||||
{-------------------------------------------------------------------------------
|
||||
function CompareCaret(const FirstCaret, SecondCaret: TPoint): integer;
|
||||
-------------------------------------------------------------------------------}
|
||||
function CompareCaret(const FirstCaret, SecondCaret: TPoint): integer;
|
||||
begin
|
||||
if (FirstCaret.Y<SecondCaret.Y) then
|
||||
Result:=1
|
||||
else if (FirstCaret.Y>SecondCaret.Y) then
|
||||
Result:=-1
|
||||
else if (FirstCaret.X<SecondCaret.X) then
|
||||
Result:=1
|
||||
else if (FirstCaret.X>SecondCaret.X) then
|
||||
Result:=-1
|
||||
else
|
||||
Result:=0;
|
||||
end;
|
||||
|
||||
{-------------------------------------------------------------------------------
|
||||
procedure CheckList(List: TList; TestListNil, TestDoubles, TestNils: boolean);
|
||||
-------------------------------------------------------------------------------}
|
||||
procedure CheckList(List: TList; TestListNil, TestDoubles, TestNils: boolean);
|
||||
var
|
||||
Cnt: Integer;
|
||||
@ -1291,9 +1269,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{-------------------------------------------------------------------------------
|
||||
procedure CheckEmptyListCut(List1, List2: TList);
|
||||
-------------------------------------------------------------------------------}
|
||||
procedure CheckEmptyListCut(List1, List2: TList);
|
||||
var
|
||||
Cnt1: Integer;
|
||||
@ -1307,19 +1282,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{-------------------------------------------------------------------------------
|
||||
function CompareBoolean(b1, b2: boolean): integer;
|
||||
-------------------------------------------------------------------------------}
|
||||
function CompareBoolean(b1, b2: boolean): integer;
|
||||
begin
|
||||
if b1=b2 then
|
||||
Result:=0
|
||||
else if b1 then
|
||||
Result:=1
|
||||
else
|
||||
Result:=-1;
|
||||
end;
|
||||
|
||||
procedure RemoveDoubles(List: TStrings);
|
||||
var
|
||||
i: Integer;
|
||||
|
@ -133,6 +133,7 @@ function ComparePointers(p1, p2: Pointer): integer; inline;
|
||||
function CompareHandles(h1, h2: THandle): integer;
|
||||
function CompareRect(R1, R2: PRect): Boolean;
|
||||
function ComparePoints(const p1, p2: TPoint): integer;
|
||||
function CompareCaret(const FirstCaret, SecondCaret: TPoint): integer;
|
||||
function CompareMethods(const m1, m2: TMethod): boolean; inline;
|
||||
|
||||
function RoundToInt(const e: Extended): integer;
|
||||
@ -1065,6 +1066,20 @@ begin
|
||||
Result:=0;
|
||||
end;
|
||||
|
||||
function CompareCaret(const FirstCaret, SecondCaret: TPoint): integer;
|
||||
begin
|
||||
if (FirstCaret.Y<SecondCaret.Y) then
|
||||
Result:=1
|
||||
else if (FirstCaret.Y>SecondCaret.Y) then
|
||||
Result:=-1
|
||||
else if (FirstCaret.X<SecondCaret.X) then
|
||||
Result:=1
|
||||
else if (FirstCaret.X>SecondCaret.X) then
|
||||
Result:=-1
|
||||
else
|
||||
Result:=0;
|
||||
end;
|
||||
|
||||
function CompareMethods(const m1, m2: TMethod): boolean;
|
||||
begin
|
||||
Result:=LazMethodList.CompareMethods(m1, m2);
|
||||
|
Loading…
Reference in New Issue
Block a user