From 0500052f061bfd55cac7ec4a5e28d83f6a388c28 Mon Sep 17 00:00:00 2001 From: juha Date: Tue, 24 Jul 2018 17:49:11 +0000 Subject: [PATCH] Move functions CompareCaret and CompareBoolean away from IDEProcs, to LCLProc and LazUtilities respectively. git-svn-id: trunk@58618 - --- components/lazutils/lazutilities.pas | 11 ++++++++ ide/extractprocdlg.pas | 2 +- ide/fpdoceditwindow.pas | 4 +-- ide/ideprocs.pp | 38 ---------------------------- lcl/lclproc.pas | 15 +++++++++++ 5 files changed, 29 insertions(+), 41 deletions(-) diff --git a/components/lazutils/lazutilities.pas b/components/lazutils/lazutilities.pas index 46f0c7f667..9589c1098c 100644 --- a/components/lazutils/lazutilities.pas +++ b/components/lazutils/lazutilities.pas @@ -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 diff --git a/ide/extractprocdlg.pas b/ide/extractprocdlg.pas index e1708c9037..50af2e9963 100644 --- a/ide/extractprocdlg.pas +++ b/ide/extractprocdlg.pas @@ -40,7 +40,7 @@ uses // IdeIntf IDEHelpIntf, IDEDialogs, // IDE - LazarusIDEStrConsts, IDEProcs, MiscOptions; + LazarusIDEStrConsts, MiscOptions; type diff --git a/ide/fpdoceditwindow.pas b/ide/fpdoceditwindow.pas index de0704f18a..89d503f8ae 100644 --- a/ide/fpdoceditwindow.pas +++ b/ide/fpdoceditwindow.pas @@ -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 diff --git a/ide/ideprocs.pp b/ide/ideprocs.pp index 844c2325d7..533a4bd933 100644 --- a/ide/ideprocs.pp +++ b/ide/ideprocs.pp @@ -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.YSecondCaret.Y) then - Result:=-1 - else if (FirstCaret.XSecondCaret.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; diff --git a/lcl/lclproc.pas b/lcl/lclproc.pas index 680baafb2a..08713ce095 100644 --- a/lcl/lclproc.pas +++ b/lcl/lclproc.pas @@ -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.YSecondCaret.Y) then + Result:=-1 + else if (FirstCaret.XSecondCaret.X) then + Result:=-1 + else + Result:=0; +end; + function CompareMethods(const m1, m2: TMethod): boolean; begin Result:=LazMethodList.CompareMethods(m1, m2);