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