diff --git a/components/buildintf/ideexterntoolintf.pas b/components/buildintf/ideexterntoolintf.pas index 5e7ad4963a..bc023db12c 100644 --- a/components/buildintf/ideexterntoolintf.pas +++ b/components/buildintf/ideexterntoolintf.pas @@ -14,7 +14,7 @@ unit IDEExternToolIntf; interface uses - Classes, SysUtils, Math, Laz_AVL_Tree, + Classes, SysUtils, Math, AVL_Tree, // LazUtils UTF8Process, LazFileUtils, LazFileCache, LazMethodList, LazLoggerBase, // BuildIntf diff --git a/components/codetools/basiccodetools.pas b/components/codetools/basiccodetools.pas index f664afeff4..4b7fea8f9f 100644 --- a/components/codetools/basiccodetools.pas +++ b/components/codetools/basiccodetools.pas @@ -39,7 +39,7 @@ unit BasicCodeTools; interface uses - Classes, SysUtils, StrUtils, Laz_AVL_Tree, + Classes, SysUtils, StrUtils, AVL_Tree, // LazUtils LazFileUtils, LazStringUtils, LazUTF8, // Codetools diff --git a/components/codetools/cachecodetools.pas b/components/codetools/cachecodetools.pas index 5bda5c5fec..bf5365d096 100644 --- a/components/codetools/cachecodetools.pas +++ b/components/codetools/cachecodetools.pas @@ -30,7 +30,7 @@ unit CacheCodeTools; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // Codetools FileProcs, CodeCache, KeywordFuncLists, CustomCodeTool, BasicCodeTools, FindDeclarationTool; diff --git a/components/codetools/ccodeparsertool.pas b/components/codetools/ccodeparsertool.pas index 5f1ba5d343..3a8bf9d650 100644 --- a/components/codetools/ccodeparsertool.pas +++ b/components/codetools/ccodeparsertool.pas @@ -111,7 +111,7 @@ uses MemCheck, {$ENDIF} // RTL + FCL - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // CodeTools FileProcs, BasicCodeTools, KeywordFuncLists, CodeCache, CodeTree, NonPascalCodeTools, CodeToolsStructs, diff --git a/components/codetools/changedeclarationtool.pas b/components/codetools/changedeclarationtool.pas index a54bd58f3a..8d0165efb7 100644 --- a/components/codetools/changedeclarationtool.pas +++ b/components/codetools/changedeclarationtool.pas @@ -33,7 +33,7 @@ unit ChangeDeclarationTool; interface uses - Classes, SysUtils, Laz_AVL_Tree, contnrs, + Classes, SysUtils, Contnrs, AVL_Tree, // Codetools CodeAtom, CodeCache, FileProcs, CodeTree, ExtractProcTool, FindDeclarationTool, BasicCodeTools, KeywordFuncLists, LinkScanner, SourceChanger; diff --git a/components/codetools/codebeautifier.pas b/components/codetools/codebeautifier.pas index ff403ad6f6..0c33701560 100644 --- a/components/codetools/codebeautifier.pas +++ b/components/codetools/codebeautifier.pas @@ -109,7 +109,7 @@ interface {$ENDIF} uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // Codetools FileProcs, KeywordFuncLists, CodeCache, BasicCodeTools, // LazUtils diff --git a/components/codetools/codecache.pas b/components/codetools/codecache.pas index 1d02c58b6e..48d36c76af 100644 --- a/components/codetools/codecache.pas +++ b/components/codetools/codecache.pas @@ -37,7 +37,7 @@ uses {$IFDEF MEM_CHECK} MemCheck, {$ENDIF} - Classes, SysUtils, Laz_Avl_Tree, + Classes, SysUtils, Avl_Tree, // Codetools SourceLog, LinkScanner, FileProcs, DirectoryCacher, // LazUtils diff --git a/components/codetools/codecompletiontool.pas b/components/codetools/codecompletiontool.pas index 14a209c727..406744c35f 100644 --- a/components/codetools/codecompletiontool.pas +++ b/components/codetools/codecompletiontool.pas @@ -85,7 +85,7 @@ uses MemCheck, {$ENDIF} // RTL + FCL - Classes, SysUtils, contnrs, Laz_AVL_Tree, + Classes, SysUtils, Contnrs, AVL_Tree, // CodeTools FileProcs, CodeToolsStrConsts, StdCodeTools, CodeTree, CodeAtom, CodeCache, CustomCodeTool, PascalParserTool, MethodJumpTool, diff --git a/components/codetools/codegraph.pas b/components/codetools/codegraph.pas index d042b4961d..45ba1950be 100644 --- a/components/codetools/codegraph.pas +++ b/components/codetools/codegraph.pas @@ -30,7 +30,7 @@ unit CodeGraph; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // Codetools CodeTree, FileProcs; diff --git a/components/codetools/codeindex.pas b/components/codetools/codeindex.pas index 7ee15c6fdb..5af53fd482 100644 --- a/components/codetools/codeindex.pas +++ b/components/codetools/codeindex.pas @@ -30,7 +30,7 @@ unit CodeIndex; interface uses - SysUtils, Laz_AVL_Tree, + SysUtils, AVL_Tree, // LazUtils LazFileUtils, // Codetools diff --git a/components/codetools/codetoolmanager.pas b/components/codetools/codetoolmanager.pas index 3088350fd1..41011916f2 100644 --- a/components/codetools/codetoolmanager.pas +++ b/components/codetools/codetoolmanager.pas @@ -40,7 +40,7 @@ uses {$IFDEF MEM_CHECK} MemCheck, {$ENDIF} - Classes, SysUtils, contnrs, TypInfo, types, Laz_AVL_Tree, + Classes, SysUtils, Contnrs, TypInfo, Types, AVL_Tree, // LazUtils LazFileUtils, LazFileCache, LazMethodList, LazDbgLog, AvgLvlTree, LazStringUtils, diff --git a/components/codetools/codetoolscfgscript.pas b/components/codetools/codetoolscfgscript.pas index 19c94bfd7a..2e796ce9a4 100644 --- a/components/codetools/codetoolscfgscript.pas +++ b/components/codetools/codetoolscfgscript.pas @@ -53,7 +53,7 @@ unit CodeToolsCfgScript; interface uses - Classes, SysUtils, typinfo, Laz_AVL_Tree, + Classes, SysUtils, TypInfo, AVL_Tree, // Codetools BasicCodeTools, KeywordFuncLists, FileProcs, CodeToolsStrConsts; diff --git a/components/codetools/codetoolsfpcmsgs.pas b/components/codetools/codetoolsfpcmsgs.pas index b9cbb41b79..c6a0bbb457 100644 --- a/components/codetools/codetoolsfpcmsgs.pas +++ b/components/codetools/codetoolsfpcmsgs.pas @@ -42,7 +42,7 @@ unit CodeToolsFPCMsgs; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // Codetools FileProcs; diff --git a/components/codetools/codetoolsstructs.pas b/components/codetools/codetoolsstructs.pas index 641edd8b4a..0c08c13f7a 100644 --- a/components/codetools/codetoolsstructs.pas +++ b/components/codetools/codetoolsstructs.pas @@ -32,7 +32,7 @@ unit CodeToolsStructs; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LazUtils LazUtilities, LazDbgLog, AvgLvlTree, // Codetools diff --git a/components/codetools/codetree.pas b/components/codetools/codetree.pas index a404366761..a144392c92 100644 --- a/components/codetools/codetree.pas +++ b/components/codetools/codetree.pas @@ -42,7 +42,7 @@ uses {$IFDEF MEM_CHECK} MemCheck, {$ENDIF} - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LazUtils LazDbgLog, // Codetools diff --git a/components/codetools/ctunitgraph.pas b/components/codetools/ctunitgraph.pas index c4166ddd95..4d96756811 100644 --- a/components/codetools/ctunitgraph.pas +++ b/components/codetools/ctunitgraph.pas @@ -30,7 +30,7 @@ unit CTUnitGraph; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LazUtils LazFileUtils, LazStringUtils, // Codetools diff --git a/components/codetools/ctunitgroupgraph.pas b/components/codetools/ctunitgroupgraph.pas index 6abf3ddfd3..ee72ed8c9e 100644 --- a/components/codetools/ctunitgroupgraph.pas +++ b/components/codetools/ctunitgroupgraph.pas @@ -30,7 +30,7 @@ unit CTUnitGroupGraph; interface uses - Classes, SysUtils, Laz_AVL_Tree, CTUnitGraph; + Classes, SysUtils, AVL_Tree, CTUnitGraph; type TUGGroup = class; diff --git a/components/codetools/customcodetool.pas b/components/codetools/customcodetool.pas index 932f8f41ee..80bacfec7a 100644 --- a/components/codetools/customcodetool.pas +++ b/components/codetools/customcodetool.pas @@ -43,7 +43,7 @@ uses {$IFDEF MEM_CHECK} MemCheck, {$ENDIF} - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // Codetools FileProcs, CodeToolsStrConsts, CodeTree, CodeAtom, KeywordFuncLists, BasicCodeTools, LinkScanner, CodeCache, diff --git a/components/codetools/definetemplates.pas b/components/codetools/definetemplates.pas index a0c28ed90e..b88dff19d5 100644 --- a/components/codetools/definetemplates.pas +++ b/components/codetools/definetemplates.pas @@ -54,7 +54,7 @@ interface uses // RTL + FCL - Classes, SysUtils, contnrs, process, Laz_AVL_Tree, + Classes, SysUtils, Contnrs, process, AVL_Tree, // CodeTools CodeToolsStrConsts, ExprEval, DirectoryCacher, BasicCodeTools, CodeToolsStructs, KeywordFuncLists, LinkScanner, FileProcs, diff --git a/components/codetools/directivestree.pas b/components/codetools/directivestree.pas index 4aef01a77d..785f1cbcd8 100644 --- a/components/codetools/directivestree.pas +++ b/components/codetools/directivestree.pas @@ -37,7 +37,7 @@ uses {$IFDEF MEM_CHECK} MemCheck, {$ENDIF} - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // Codetools FileProcs, BasicCodeTools, KeywordFuncLists, CodeCache, ExprEval, CodeTree; diff --git a/components/codetools/directorycacher.pas b/components/codetools/directorycacher.pas index 5132a334cc..07a349d5ee 100644 --- a/components/codetools/directorycacher.pas +++ b/components/codetools/directorycacher.pas @@ -40,7 +40,7 @@ interface uses // RTL + FCL - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // CodeTools FileProcs, // LazUtils diff --git a/components/codetools/eventcodetool.pas b/components/codetools/eventcodetool.pas index 128f5b1ae4..c3750be201 100644 --- a/components/codetools/eventcodetool.pas +++ b/components/codetools/eventcodetool.pas @@ -43,7 +43,7 @@ uses {$IFDEF MEM_CHECK} MemCheck, {$ENDIF} - Classes, SysUtils, TypInfo, Laz_AVL_Tree, + Classes, SysUtils, TypInfo, AVL_Tree, // LazUtils LazFileUtils, // Codetools diff --git a/components/codetools/examples/addmethodassign.lpr b/components/codetools/examples/addmethodassign.lpr index 6de42ce85c..ecd8a5822d 100644 --- a/components/codetools/examples/addmethodassign.lpr +++ b/components/codetools/examples/addmethodassign.lpr @@ -28,9 +28,7 @@ program AddMethodAssign; {$mode objfpc}{$H+} uses - Classes, SysUtils, - // LazUtils - Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // CodeTools CodeCache, CodeToolManager, FileProcs, BasicCodeTools, CodeTree, FindDeclarationTool, AssignExample1; diff --git a/components/codetools/examples/findreferences.lpr b/components/codetools/examples/findreferences.lpr index 4e5617f682..7bc7830210 100644 --- a/components/codetools/examples/findreferences.lpr +++ b/components/codetools/examples/findreferences.lpr @@ -35,9 +35,9 @@ program findreferences; {$mode objfpc}{$H+} uses - Classes, SysUtils, + Classes, SysUtils, AVL_Tree, // LazUtils - LazFileUtils, Laz_AVL_Tree, + LazFileUtils, // CodeTools CodeCache, CodeToolManager, CTUnitGraph; diff --git a/components/codetools/examples/testfpcsrcunitrules.lpr b/components/codetools/examples/testfpcsrcunitrules.lpr index 4756b12255..52827b0da3 100644 --- a/components/codetools/examples/testfpcsrcunitrules.lpr +++ b/components/codetools/examples/testfpcsrcunitrules.lpr @@ -28,7 +28,7 @@ program TestFPCSrcUnitRules; {$mode objfpc}{$H+} uses - Classes, SysUtils, CustApp, Laz_AVL_Tree, + Classes, SysUtils, CustApp, AVL_Tree, // LazUtils LazFileUtils, AvgLvlTree, LazLogger, // CodeTools diff --git a/components/codetools/examples/unitdicttest.lpr b/components/codetools/examples/unitdicttest.lpr index 75ab797923..e1209317a1 100644 --- a/components/codetools/examples/unitdicttest.lpr +++ b/components/codetools/examples/unitdicttest.lpr @@ -28,7 +28,7 @@ program unitdicttest; {$mode objfpc}{$H+} uses - SysUtils, Laz_AVL_Tree, + SysUtils, AVL_Tree, // LazUtils LazFileUtils, AvgLvlTree, // CodeTools diff --git a/components/codetools/examples/usedbyunits.lpr b/components/codetools/examples/usedbyunits.lpr index 23de64a5ca..5d06171bc1 100644 --- a/components/codetools/examples/usedbyunits.lpr +++ b/components/codetools/examples/usedbyunits.lpr @@ -28,7 +28,7 @@ program UsedByUnits; {$mode objfpc}{$H+} uses - SysUtils, Laz_AVL_Tree, + SysUtils, AVL_Tree, // LazUtils LazFileUtils, LazFileCache, // CodeTools diff --git a/components/codetools/extractproctool.pas b/components/codetools/extractproctool.pas index d962d58b71..2b3f6bf883 100644 --- a/components/codetools/extractproctool.pas +++ b/components/codetools/extractproctool.pas @@ -51,7 +51,7 @@ unit ExtractProcTool; interface uses - Classes, SysUtils, math, Laz_AVL_Tree, + Classes, SysUtils, Math, AVL_Tree, // Codetools FileProcs, CodeToolsStrConsts, CodeTree, CodeAtom, CodeCache, CustomCodeTool, PascalReaderTool, diff --git a/components/codetools/fileprocs.pas b/components/codetools/fileprocs.pas index 27e6d9d4c0..0017ab4065 100644 --- a/components/codetools/fileprocs.pas +++ b/components/codetools/fileprocs.pas @@ -40,7 +40,7 @@ uses Windows, {$ENDIF} // RTL + FCL - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // CodeTools CodeToolsStrConsts, // LazUtils diff --git a/components/codetools/finddeclarationcache.pas b/components/codetools/finddeclarationcache.pas index 2c8b896c03..5b9b724440 100644 --- a/components/codetools/finddeclarationcache.pas +++ b/components/codetools/finddeclarationcache.pas @@ -37,7 +37,7 @@ interface { $DEFINE HardExceptions} uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // Codetools FileProcs, BasicCodeTools, CodeTree, LinkScanner, PascalParserTool, KeywordFuncLists, CodeToolMemManager; diff --git a/components/codetools/finddeclarationtool.pas b/components/codetools/finddeclarationtool.pas index 5a97d12aaf..bcf7a954d1 100644 --- a/components/codetools/finddeclarationtool.pas +++ b/components/codetools/finddeclarationtool.pas @@ -78,7 +78,7 @@ uses {$IFDEF MEM_CHECK} MemCheck, {$ENDIF} - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LazUtils LazFileUtils, LazStringUtils, LazUtilities, // Codetools diff --git a/components/codetools/findoverloads.pas b/components/codetools/findoverloads.pas index eec27877c0..57bf6147f1 100644 --- a/components/codetools/findoverloads.pas +++ b/components/codetools/findoverloads.pas @@ -33,7 +33,7 @@ unit FindOverloads; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // Codetools FileProcs, BasicCodeTools, CodeTree, CodeGraph, CodeCache, FindDeclarationTool, FindDeclarationCache, StdCodeTools; diff --git a/components/codetools/h2pastool.pas b/components/codetools/h2pastool.pas index 70a4e5b7e7..213ef3fb84 100644 --- a/components/codetools/h2pastool.pas +++ b/components/codetools/h2pastool.pas @@ -94,7 +94,7 @@ unit H2PasTool; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LazUtils AvgLvlTree, // Codetools diff --git a/components/codetools/ide/addassignmethoddlg.pas b/components/codetools/ide/addassignmethoddlg.pas index f421d7f523..2a5ee34f9f 100644 --- a/components/codetools/ide/addassignmethoddlg.pas +++ b/components/codetools/ide/addassignmethoddlg.pas @@ -30,7 +30,7 @@ unit AddAssignMethodDlg; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL LResources, Forms, Controls, Graphics, Dialogs, ButtonPanel, StdCtrls, ComCtrls, Menus, diff --git a/components/codetools/ide/codyfindoverloads.pas b/components/codetools/ide/codyfindoverloads.pas index 5fa4008552..b83815737f 100644 --- a/components/codetools/ide/codyfindoverloads.pas +++ b/components/codetools/ide/codyfindoverloads.pas @@ -44,7 +44,7 @@ unit CodyFindOverloads; interface uses - Classes, SysUtils, contnrs, Laz_AVL_Tree, + Classes, SysUtils, contnrs, AVL_Tree, // LazUtils FileUtil, LazLoggerBase, LazUtilities, // LCL diff --git a/components/codetools/ide/codyidentifiersdlg.pas b/components/codetools/ide/codyidentifiersdlg.pas index a357c95942..b81ea417e8 100644 --- a/components/codetools/ide/codyidentifiersdlg.pas +++ b/components/codetools/ide/codyidentifiersdlg.pas @@ -37,7 +37,7 @@ unit CodyIdentifiersDlg; interface uses - Classes, SysUtils, Math, LCLProc, contnrs, Laz_AVL_Tree, + Classes, SysUtils, Math, LCLProc, contnrs, AVL_Tree, // LCL Forms, Controls, Dialogs, ButtonPanel, StdCtrls, ExtCtrls, LCLType, Buttons, Menus, // IdeIntf diff --git a/components/codetools/ide/codynodeinfodlg.pas b/components/codetools/ide/codynodeinfodlg.pas index 1abbc07b58..5109943e0b 100644 --- a/components/codetools/ide/codynodeinfodlg.pas +++ b/components/codetools/ide/codynodeinfodlg.pas @@ -30,7 +30,7 @@ unit CodyNodeInfoDlg; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Forms, Controls, Graphics, Dialogs, ButtonPanel, ComCtrls, StdCtrls, // IDEIntf diff --git a/components/codetools/ide/ppulistdlg.lfm b/components/codetools/ide/ppulistdlg.lfm index 4db27c18d0..7cf4feddf0 100644 --- a/components/codetools/ide/ppulistdlg.lfm +++ b/components/codetools/ide/ppulistdlg.lfm @@ -10,17 +10,21 @@ object PPUListDialog: TPPUListDialog OnCreate = FormCreate OnDestroy = FormDestroy Position = poScreenCenter - LCLVersion = '0.9.31' + LCLVersion = '3.99.0.0' object ButtonPanel1: TButtonPanel Left = 6 - Height = 42 - Top = 483 + Height = 37 + Top = 488 Width = 728 OKButton.Name = 'OKButton' + OKButton.DefaultCaption = True HelpButton.Name = 'HelpButton' + HelpButton.DefaultCaption = True HelpButton.OnClick = HelpButtonClick CloseButton.Name = 'CloseButton' + CloseButton.DefaultCaption = True CancelButton.Name = 'CancelButton' + CancelButton.DefaultCaption = True TabOrder = 0 ShowButtons = [pbClose, pbHelp] end @@ -36,7 +40,7 @@ object PPUListDialog: TPPUListDialog end object PageControl1: TPageControl Left = 0 - Height = 447 + Height = 452 Top = 30 Width = 740 ActivePage = UnitsTabSheet @@ -45,7 +49,7 @@ object PPUListDialog: TPPUListDialog TabOrder = 1 object UnitsTabSheet: TTabSheet Caption = 'UnitsTabSheet' - ClientHeight = 414 + ClientHeight = 417 ClientWidth = 736 object UnitsStringGrid: TStringGrid Left = 6 @@ -84,7 +88,7 @@ object PPUListDialog: TPPUListDialog end item Title.Caption = 'Package' - Width = 122 + Width = 120 end> DefaultColWidth = 150 FixedCols = 0 @@ -99,7 +103,7 @@ object PPUListDialog: TPPUListDialog 120 120 120 - 122 + 120 ) end object Splitter1: TSplitter @@ -113,33 +117,33 @@ object PPUListDialog: TPPUListDialog end object UnitGroupBox: TGroupBox Left = 6 - Height = 176 + Height = 179 Top = 232 Width = 724 Align = alClient BorderSpacing.Around = 6 Caption = 'UnitGroupBox' - ClientHeight = 155 - ClientWidth = 716 + ClientHeight = 149 + ClientWidth = 720 TabOrder = 2 object UnitPageControl: TPageControl Left = 0 - Height = 155 + Height = 149 Top = 0 - Width = 716 + Width = 720 ActivePage = UnitLinkedFilesTabSheet Align = alClient TabIndex = 4 TabOrder = 0 object InfoTabSheet: TTabSheet Caption = 'InfoTabSheet' - ClientHeight = 128 - ClientWidth = 712 + ClientHeight = 114 + ClientWidth = 716 object SourceFileLabel: TLabel Left = 9 Height = 18 Top = 14 - Width = 109 + Width = 96 Caption = 'SourceFileLabel' ParentColor = False end @@ -149,7 +153,7 @@ object PPUListDialog: TPPUListDialog Left = 9 Height = 18 Top = 38 - Width = 91 + Width = 79 BorderSpacing.Top = 6 Caption = 'PPUFileLabel' ParentColor = False @@ -157,114 +161,114 @@ object PPUListDialog: TPPUListDialog end object UsesTabSheet: TTabSheet Caption = 'UsesTabSheet' - ClientHeight = 128 - ClientWidth = 712 + ClientHeight = 114 + ClientWidth = 716 object UsesStringGrid: TStringGrid Left = 0 - Height = 128 + Height = 114 Top = 0 - Width = 712 + Width = 716 Align = alClient AutoFillColumns = True ColCount = 1 Columns = < item Title.Caption = 'Unit' - Width = 710 + Width = 712 end> FixedCols = 0 Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, goThumbTracking, goSmoothScroll] TabOrder = 0 OnMouseDown = UnitStringGridMouseDown ColWidths = ( - 710 + 712 ) end end object UsedByTabSheet: TTabSheet Caption = 'UsedByTabSheet' - ClientHeight = 128 - ClientWidth = 712 + ClientHeight = 114 + ClientWidth = 716 object UsedByStringGrid: TStringGrid Left = 0 - Height = 128 + Height = 114 Top = 0 - Width = 712 + Width = 716 Align = alClient AutoFillColumns = True ColCount = 1 Columns = < item Title.Caption = 'Unit' - Width = 710 + Width = 712 end> FixedCols = 0 Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, goThumbTracking, goSmoothScroll] TabOrder = 0 OnMouseDown = UnitStringGridMouseDown ColWidths = ( - 710 + 712 ) end end object UsesPathTabSheet: TTabSheet Caption = 'UsesPathTabSheet' - ClientHeight = 128 - ClientWidth = 712 + ClientHeight = 114 + ClientWidth = 716 object UsesPathStringGrid: TStringGrid Left = 0 - Height = 128 + Height = 114 Top = 0 - Width = 712 + Width = 716 Align = alClient AutoFillColumns = True ColCount = 1 Columns = < item Title.Caption = 'Unit' - Width = 710 + Width = 712 end> FixedCols = 0 Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, goSmoothScroll] TabOrder = 0 OnMouseDown = UnitStringGridMouseDown ColWidths = ( - 710 + 712 ) end end object UnitLinkedFilesTabSheet: TTabSheet Caption = 'UnitLinkedFilesTabSheet' - ClientHeight = 122 - ClientWidth = 712 + ClientHeight = 114 + ClientWidth = 716 object UnitLinkedFilesStringGrid: TStringGrid Left = 0 - Height = 122 + Height = 114 Top = 0 - Width = 712 + Width = 716 Align = alClient AutoFillColumns = True ColCount = 3 Columns = < item Title.Caption = 'Type' - Width = 236 + Width = 231 end item Title.Caption = 'File' - Width = 236 + Width = 230 end item Title.Caption = 'Flags' - Width = 238 + Width = 230 end> FixedCols = 0 Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, goColSizing, goThumbTracking, goColSpanning, goSmoothScroll] TabOrder = 0 ColWidths = ( - 236 - 236 - 238 + 231 + 230 + 230 ) end end @@ -273,15 +277,14 @@ object PPUListDialog: TPPUListDialog end object LinkedFilesTabSheet: TTabSheet Caption = 'LinkedFilesTabSheet' - ClientHeight = 414 + ClientHeight = 417 ClientWidth = 736 object LinkedFilesTreeView: TTreeView Left = 0 - Height = 414 + Height = 417 Top = 0 Width = 736 Align = alClient - DefaultItemHeight = 19 ReadOnly = True TabOrder = 0 OnDblClick = LinkedFilesTreeViewDblClick diff --git a/components/codetools/ide/ppulistdlg.pas b/components/codetools/ide/ppulistdlg.pas index 98c8d13612..1cfc64cb86 100644 --- a/components/codetools/ide/ppulistdlg.pas +++ b/components/codetools/ide/ppulistdlg.pas @@ -30,9 +30,9 @@ unit PPUListDlg; interface uses - Classes, SysUtils, contnrs, math, Laz_AVL_Tree, + Classes, SysUtils, contnrs, math, AVL_Tree, // LCL - LCLProc, FileUtil, Forms, Controls, Dialogs, ButtonPanel, Grids, StdCtrls, + FileUtil, Forms, Controls, Dialogs, ButtonPanel, Grids, StdCtrls, ExtCtrls, ComCtrls, // LazUtils AvgLvlTree, LazUTF8, diff --git a/components/codetools/identcompletiontool.pas b/components/codetools/identcompletiontool.pas index f643921489..7c224f58e9 100644 --- a/components/codetools/identcompletiontool.pas +++ b/components/codetools/identcompletiontool.pas @@ -50,7 +50,7 @@ uses {$IFDEF MEM_CHECK} MemCheck, {$ENDIF} - Classes, SysUtils, typinfo, crc, Laz_AVL_Tree, + Classes, SysUtils, typinfo, crc, AVL_Tree, // LazUtils LazFileUtils, LazDbgLog, AvgLvlTree, // Codetools diff --git a/components/codetools/lfmtrees.pas b/components/codetools/lfmtrees.pas index 1f3eb93dbd..6b225fd245 100644 --- a/components/codetools/lfmtrees.pas +++ b/components/codetools/lfmtrees.pas @@ -30,7 +30,7 @@ unit LFMTrees; interface uses - Classes, SysUtils, TypInfo, Laz_AVL_Tree, + Classes, SysUtils, TypInfo, AVL_Tree, // LazUtils LazUtilities, // Codetools diff --git a/components/codetools/linkscanner.pas b/components/codetools/linkscanner.pas index 4dbeff446e..4c8fd570b1 100644 --- a/components/codetools/linkscanner.pas +++ b/components/codetools/linkscanner.pas @@ -47,7 +47,7 @@ uses MemCheck, {$ENDIF} // RTL + FCL - Classes, SysUtils, math, Laz_AVL_Tree, + Classes, SysUtils, Math, AVL_Tree, // CodeTools CodeToolsStrConsts, CodeToolMemManager, FileProcs, ExprEval, SourceLog, KeywordFuncLists, BasicCodeTools, DirectoryCacher, diff --git a/components/codetools/methodjumptool.pas b/components/codetools/methodjumptool.pas index 37bb48cf24..d5808af41e 100644 --- a/components/codetools/methodjumptool.pas +++ b/components/codetools/methodjumptool.pas @@ -40,7 +40,7 @@ uses {$IFDEF MEM_CHECK} MemCheck, {$ENDIF} - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LazUtils LazFileUtils, // Codetools diff --git a/components/codetools/ppucodetools.pas b/components/codetools/ppucodetools.pas index 526b294659..6ba27fd63f 100644 --- a/components/codetools/ppucodetools.pas +++ b/components/codetools/ppucodetools.pas @@ -30,7 +30,9 @@ unit PPUCodeTools; interface uses - Classes, SysUtils, Laz_AVL_Tree, PPUParser, FileProcs, LazFileUtils, LazFileCache; + Classes, SysUtils, AVL_Tree, + PPUParser, FileProcs, + LazFileUtils, LazFileCache; type diff --git a/components/codetools/ppugraph.pas b/components/codetools/ppugraph.pas index 02fc34f169..bf84669bd2 100644 --- a/components/codetools/ppugraph.pas +++ b/components/codetools/ppugraph.pas @@ -30,7 +30,7 @@ unit PPUGraph; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, {$IFnDEF HASAMIGA} dynlibs, {$ENDIF} diff --git a/components/codetools/sourcechanger.pas b/components/codetools/sourcechanger.pas index b3da86a2e2..6267a58935 100644 --- a/components/codetools/sourcechanger.pas +++ b/components/codetools/sourcechanger.pas @@ -42,7 +42,7 @@ interface {off $DEFINE VerboseSrcChanger} uses - Classes, SysUtils, typinfo, Laz_AVL_Tree, + Classes, SysUtils, TypInfo, AVL_Tree, // LazUtils LazDbgLog, // Codetools diff --git a/components/codetools/stdcodetools.pas b/components/codetools/stdcodetools.pas index ff4d2b91af..cd3cd40765 100644 --- a/components/codetools/stdcodetools.pas +++ b/components/codetools/stdcodetools.pas @@ -50,7 +50,7 @@ uses {$IFDEF MEM_CHECK} MemCheck, {$ENDIF} - Classes, SysUtils, TypInfo, Laz_AVL_Tree, + Classes, SysUtils, TypInfo, AVL_Tree, // Codetools CodeToolsStrConsts, FileProcs, CodeTree, CodeAtom, FindDeclarationTool, IdentCompletionTool, PascalReaderTool, PascalParserTool, diff --git a/components/codetools/tests/testdesignerformtools.pas b/components/codetools/tests/testdesignerformtools.pas index 986725dcd8..7fa25faf41 100644 --- a/components/codetools/tests/testdesignerformtools.pas +++ b/components/codetools/tests/testdesignerformtools.pas @@ -6,7 +6,7 @@ interface uses Classes, SysUtils, CodeToolManager, CodeCache, DefineTemplates, - LazLogger, LazFileUtils, AvgLvlTree, Laz_AVL_Tree, fpcunit, testregistry, + LazLogger, LazFileUtils, AvgLvlTree, AVL_Tree, fpcunit, testregistry, TestFinddeclaration, TestStdCodetools, Dsgn_AmbigBearBtn, Dsgn_BearControls, Dsgn_BearButtons; diff --git a/components/codetools/tests/testrefactoring.pas b/components/codetools/tests/testrefactoring.pas index 9438dd8cb6..03b91a7f3a 100644 --- a/components/codetools/tests/testrefactoring.pas +++ b/components/codetools/tests/testrefactoring.pas @@ -11,7 +11,7 @@ interface uses Classes, SysUtils, CodeToolManager, CodeCache, CodeTree, BasicCodeTools, - CTUnitGraph, LazLogger, LazFileUtils, Laz_AVL_Tree, fpcunit, testregistry, + CTUnitGraph, LazLogger, LazFileUtils, AVL_Tree, fpcunit, testregistry, TestFinddeclaration; const diff --git a/components/codetools/unitdictionary.pas b/components/codetools/unitdictionary.pas index c428df2cf7..fc719d5b9d 100644 --- a/components/codetools/unitdictionary.pas +++ b/components/codetools/unitdictionary.pas @@ -30,7 +30,7 @@ unit UnitDictionary; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LazUtils LazFileUtils, AvgLvlTree, // Codetools diff --git a/components/education/educomppalette.pas b/components/education/educomppalette.pas index 364a802572..c6de431926 100644 --- a/components/education/educomppalette.pas +++ b/components/education/educomppalette.pas @@ -18,7 +18,7 @@ unit EduCompPalette; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL LCLProc, LCLType, LResources, Forms, Controls, Graphics, Dialogs, ComCtrls, ExtCtrls, StdCtrls, diff --git a/components/education/edumenu.pas b/components/education/edumenu.pas index 1d90c86688..e0f8ae3e4f 100644 --- a/components/education/edumenu.pas +++ b/components/education/edumenu.pas @@ -18,7 +18,7 @@ unit EduMenu; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL LCLProc, LResources, Forms, StdCtrls, ComCtrls, Controls, ExtCtrls, // LazUtils diff --git a/components/education/eduspeedbuttons.pas b/components/education/eduspeedbuttons.pas index 4b5ba43777..1b69bdca26 100644 --- a/components/education/eduspeedbuttons.pas +++ b/components/education/eduspeedbuttons.pas @@ -18,7 +18,7 @@ unit EduSpeedButtons; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Controls, Graphics, LResources, Forms, StdCtrls, ExtCtrls, Dialogs, ComCtrls, Buttons, diff --git a/components/fpdebug/fpdmemorytools.pas b/components/fpdebug/fpdmemorytools.pas index f4523698c5..1defb47a66 100644 --- a/components/fpdebug/fpdmemorytools.pas +++ b/components/fpdebug/fpdmemorytools.pas @@ -27,7 +27,7 @@ interface uses Classes, SysUtils, math, DbgIntfBaseTypes, FpErrorMessages, LazClasses, - Laz_AVL_Tree, {$ifdef FORCE_LAZLOGGER_DUMMY} LazLoggerDummy {$else} LazLoggerBase {$endif}; + AVL_Tree, {$ifdef FORCE_LAZLOGGER_DUMMY} LazLoggerDummy {$else} LazLoggerBase {$endif}; const MINIMUM_MEMREAD_LIMIT = 1024; diff --git a/components/freetype/easylazfreetype.pas b/components/freetype/easylazfreetype.pas index 6a56b61beb..82ec1efc5e 100644 --- a/components/freetype/easylazfreetype.pas +++ b/components/freetype/easylazfreetype.pas @@ -19,7 +19,7 @@ unit EasyLazFreeType; interface uses - Classes, SysUtils, fpimage, Laz_AVL_Tree, + Classes, SysUtils, fpimage, AVL_Tree, // LazUtils LazUTF8, // FreeType diff --git a/components/freetype/lazfreetypefontcollection.pas b/components/freetype/lazfreetypefontcollection.pas index 61aa7e3225..3af2bede7f 100644 --- a/components/freetype/lazfreetypefontcollection.pas +++ b/components/freetype/lazfreetypefontcollection.pas @@ -13,7 +13,7 @@ unit LazFreeTypeFontCollection; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LazUtils LazStringUtils, LazUTF8, // FreeType diff --git a/components/h2pas/h2pasconvert.pas b/components/h2pas/h2pasconvert.pas index b9ce1a1089..7ca2d26437 100644 --- a/components/h2pas/h2pasconvert.pas +++ b/components/h2pas/h2pasconvert.pas @@ -23,7 +23,7 @@ unit H2PasConvert; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL LResources, Forms, Controls, Dialogs, XMLPropStorage, // LazUtils diff --git a/components/ideintf/componentreg.pas b/components/ideintf/componentreg.pas index 3885875a6b..3ac827ccf8 100644 --- a/components/ideintf/componentreg.pas +++ b/components/ideintf/componentreg.pas @@ -24,7 +24,7 @@ unit ComponentReg; interface uses - Classes, SysUtils, typinfo, Contnrs, Laz_AVL_Tree, fgl, + Classes, SysUtils, TypInfo, AVL_Tree, fgl, // LCL Controls, // LazUtils diff --git a/components/ideintf/componenttreeview.pas b/components/ideintf/componenttreeview.pas index 2e867fcb87..d3d7ac2110 100644 --- a/components/ideintf/componenttreeview.pas +++ b/components/ideintf/componenttreeview.pas @@ -24,7 +24,7 @@ unit ComponentTreeView; interface uses - Classes, SysUtils, TypInfo, Laz_AVL_Tree, + Classes, SysUtils, TypInfo, AVL_Tree, // LazUtils LazUtilities, LazLoggerBase, LazTracer, AvgLvlTree, // LCL diff --git a/components/ideintf/graphpropedits.pas b/components/ideintf/graphpropedits.pas index 04a9d648bd..9a0b546a2e 100644 --- a/components/ideintf/graphpropedits.pas +++ b/components/ideintf/graphpropedits.pas @@ -16,7 +16,7 @@ unit GraphPropEdits; interface uses - Types, Classes, TypInfo, SysUtils, Math, System.UITypes, + Types, Classes, TypInfo, SysUtils, System.UITypes, // LCL LCLType, Forms, Graphics, Buttons, Menus, Dialogs, Grids, ImgList, EditBtn, // LazUtils diff --git a/components/ideintf/lazideintf.pas b/components/ideintf/lazideintf.pas index 3a8202346d..a0ec28eff2 100644 --- a/components/ideintf/lazideintf.pas +++ b/components/ideintf/lazideintf.pas @@ -16,9 +16,9 @@ unit LazIDEIntf; interface uses - Classes, SysUtils, System.UITypes, + Classes, SysUtils, // LCL - Forms, Controls, LazHelpHTML, + Forms, Controls, // LazUtils LazMethodList, AvgLvlTree, // BuildIntf diff --git a/components/ideintf/unitresources.pas b/components/ideintf/unitresources.pas index 25aa7ef692..01c5362fa8 100644 --- a/components/ideintf/unitresources.pas +++ b/components/ideintf/unitresources.pas @@ -19,7 +19,7 @@ unit UnitResources; interface uses - Classes, SysUtils, System.UITypes, + Classes, SysUtils, // LCL LCLMemManager, Forms, LResources; diff --git a/components/lazcontrols/lvlgraphctrl.pas b/components/lazcontrols/lvlgraphctrl.pas index d8fd59fc01..7d20648281 100644 --- a/components/lazcontrols/lvlgraphctrl.pas +++ b/components/lazcontrols/lvlgraphctrl.pas @@ -22,7 +22,7 @@ unit LvlGraphCtrl; interface uses - Classes, SysUtils, types, math, typinfo, FPimage, FPCanvas, Laz_AVL_Tree, + Classes, SysUtils, Types, Math, TypInfo, FPimage, FPCanvas, AVL_Tree, // LCL LMessages, LCLType, LCLIntf, Graphics, Controls, ImgList, Forms, Themes, // LazUtils @@ -556,7 +556,6 @@ type procedure WMHScroll(var Msg: TLMScroll); message LM_HSCROLL; procedure WMVScroll(var Msg: TLMScroll); message LM_VSCROLL; procedure WMMouseWheel(var Message: TLMMouseEvent); message LM_MOUSEWHEEL; - procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; procedure ImageListChange(Sender: TObject); protected procedure GraphInvalidate(Sender: TObject); virtual; @@ -573,8 +572,8 @@ type procedure Paint; override; function Draw(Step: TLvlGraphDrawStep): boolean; virtual; procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; - procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer - ); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; procedure CreateWnd; override; procedure HighlightConnectedEgdes(Element: TObject); procedure DoOnShowHint(HintInfo: PHintInfo); override; @@ -1682,7 +1681,6 @@ end; procedure TMinXGraph.BindPairs; var i: Integer; - Level: TMinXLevel; Pair: TMinXPair; begin for i:=0 to length(Pairs)-1 do begin diff --git a/components/lazutils/avglvltree.pas b/components/lazutils/avglvltree.pas index 7c53b6d38f..83a127e59f 100644 --- a/components/lazutils/avglvltree.pas +++ b/components/lazutils/avglvltree.pas @@ -20,7 +20,7 @@ unit AvgLvlTree; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, LazFileUtils, LazDbgLog; type diff --git a/components/lazutils/filereferencelist.pas b/components/lazutils/filereferencelist.pas index 083a73476f..fd0382bc41 100644 --- a/components/lazutils/filereferencelist.pas +++ b/components/lazutils/filereferencelist.pas @@ -31,7 +31,7 @@ unit FileReferenceList; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LazUtils LazFileUtils, LazFileCache, LazTracer; diff --git a/components/lazutils/fpmake.pp b/components/lazutils/fpmake.pp index 29b4821448..27d6f9c5d4 100644 --- a/components/lazutils/fpmake.pp +++ b/components/lazutils/fpmake.pp @@ -73,7 +73,6 @@ begin D := T.Dependencies.AddUnit('laz2_xmlutils'); D := T.Dependencies.AddUnit('laz2_XMLWrite'); D := T.Dependencies.AddUnit('laz2_xpath'); - D := T.Dependencies.AddUnit('Laz_AVL_Tree'); D := T.Dependencies.AddUnit('Laz_DOM'); D := T.Dependencies.AddUnit('Laz_XMLCfg'); D := T.Dependencies.AddUnit('Laz_XMLRead'); @@ -143,7 +142,6 @@ begin T := P.Targets.AddImplicitUnit('laz2_xmlutils.pas'); T := P.Targets.AddImplicitUnit('laz2_xmlwrite.pas'); T := P.Targets.AddImplicitUnit('laz2_xpath.pas'); - T := P.Targets.AddImplicitUnit('laz_avl_tree.pp'); T := P.Targets.AddImplicitUnit('laz_dom.pas'); T := P.Targets.AddImplicitUnit('laz_xmlcfg.pas'); T := P.Targets.AddImplicitUnit('laz_xmlread.pas'); diff --git a/components/lazutils/laz_avl_tree.pp b/components/lazutils/laz_avl_tree.pp deleted file mode 100644 index c3d1b96727..0000000000 --- a/components/lazutils/laz_avl_tree.pp +++ /dev/null @@ -1,1565 +0,0 @@ -{ ********************************************************************** - This file is part of the Free Component Library (FCL) - Copyright (c) 2017 by Mattias Gaertner - - Average Level Tree implementation by Mattias Gaertner - - See the file COPYING.FPC, included in this distribution, - for details about the copyright. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - ********************************************************************** - - Author: Mattias Gaertner - - Abstract: - TAVLTree is an Average Level binary Tree. This binary tree is always - balanced, so that inserting, deleting and finding a node is performed in - O(log(#Nodes)). - - Note! This is a copy of avl_tree unit from FPC trunk from Apr 2023. - Can be removed when FPC 3.2 is the minimun requirement for Lazarus and LazUtils. -} -unit Laz_AVL_Tree; - -{$ifdef FPC}{$mode objfpc}{$endif}{$H+} - -interface - -{off $DEFINE MEM_CHECK} -{off $DEFINE CheckAVLTreeNodeManager} - -uses - {$IFDEF MEM_CHECK}MemCheck,{$ENDIF} - Classes, SysUtils; - -type - TAVLTree = class; - - TObjectSortCompare = function(Tree: TAVLTree; Data1, Data2: Pointer): integer of object; - - { TAVLTreeNode } - - TAVLTreeNode = class - public - Parent, Left, Right: TAVLTreeNode; - Balance: integer; // = RightDepth-LeftDepth -2..+2, after balancing: -1,0,+1 - Data: Pointer; - function Successor: TAVLTreeNode; // next right - function Precessor: TAVLTreeNode; // next left - procedure Clear; - function TreeDepth: integer; // longest WAY down. e.g. only one node => 0 ! - procedure ConsistencyCheck(Tree: TAVLTree); virtual; - function GetCount: SizeInt; - end; - TAVLTreeNodeClass = class of TAVLTreeNode; - PAVLTreeNode = ^TAVLTreeNode; - - { TBaseAVLTreeNodeManager } - - TBaseAVLTreeNodeManager = class - public - procedure DisposeNode(ANode: TAVLTreeNode); virtual; abstract; - function NewNode: TAVLTreeNode; virtual; abstract; - end; - - { TAVLTreeNodeEnumerator } - - TAVLTreeNodeEnumerator = class - protected - FCurrent: TAVLTreeNode; - FLowToHigh: boolean; - FTree: TAVLTree; - public - constructor Create(Tree: TAVLTree; aLowToHigh: boolean = true); - function GetEnumerator: TAVLTreeNodeEnumerator; inline; - function MoveNext: Boolean; - property Current: TAVLTreeNode read FCurrent; - property LowToHigh: boolean read FLowToHigh; - end; - - TAVLTree = class - protected - FCount: SizeInt; - FNodeClass: TAVLTreeNodeClass; - fNodeMgr: TBaseAVLTreeNodeManager; - fNodeMgrAutoFree: boolean; - FOnCompare: TListSortCompare; - FOnObjectCompare: TObjectSortCompare; - FRoot: TAVLTreeNode; - procedure BalanceAfterInsert(ANode: TAVLTreeNode); - procedure BalanceAfterDelete(ANode: TAVLTreeNode); - procedure DeletingNode({%H-}aNode: TAVLTreeNode); virtual; - function FindInsertPos(Data: Pointer): TAVLTreeNode; - procedure Init; virtual; - procedure NodeAdded({%H-}aNode: TAVLTreeNode); virtual; - procedure RotateLeft(aNode: TAVLTreeNode); virtual; - procedure RotateRight(aNode: TAVLTreeNode); virtual; - procedure SwitchPositionWithSuccessor(aNode, aSuccessor: TAVLTreeNode); virtual; - procedure SetOnCompare(const AValue: TListSortCompare); - procedure SetOnObjectCompare(const AValue: TObjectSortCompare); - procedure SetCompares(const NewCompare: TListSortCompare; - const NewObjectCompare: TObjectSortCompare); - procedure SetNodeClass(const AValue: TAVLTreeNodeClass); - public - constructor Create(const OnCompareMethod: TListSortCompare); - constructor CreateObjectCompare(const OnCompareMethod: TObjectSortCompare); - constructor Create; - destructor Destroy; override; - property OnCompare: TListSortCompare read FOnCompare write SetOnCompare; - property OnObjectCompare: TObjectSortCompare read FOnObjectCompare write SetOnObjectCompare; - property NodeClass: TAVLTreeNodeClass read FNodeClass write SetNodeClass; // used for new nodes - procedure SetNodeManager(NewMgr: TBaseAVLTreeNodeManager; - AutoFree: boolean = false); - function NewNode: TAVLTreeNode; virtual; // create a node outside the tree - procedure DisposeNode(ANode: TAVLTreeNode); virtual; // free the node outside the tree - - // add, delete, remove, move - procedure Add(ANode: TAVLTreeNode); - function Add(Data: Pointer): TAVLTreeNode; - function AddAscendingSequence(Data: Pointer; LastAdded: TAVLTreeNode; - var Successor: TAVLTreeNode): TAVLTreeNode; - procedure Delete(ANode: TAVLTreeNode); - function Remove(Data: Pointer): boolean; - function RemovePointer(Data: Pointer): boolean; - procedure MoveDataLeftMost(var ANode: TAVLTreeNode); - procedure MoveDataRightMost(var ANode: TAVLTreeNode); - procedure Clear; - procedure FreeAndClear; - procedure FreeAndDelete(ANode: TAVLTreeNode); virtual; - function Equals(Obj: TObject): boolean; override; // same as IsEqual(aTree,false) - function IsEqual(aTree: TAVLTree; CheckDataPointer: boolean): boolean; // checks only keys or Data (references), not the data itself, O(n) - procedure Assign(aTree: TAVLTree); virtual; // clear and copy all Data (references), O(n) - - // search - property Root: TAVLTreeNode read fRoot; - property Count: SizeInt read FCount; - function Compare(Data1, Data2: Pointer): integer; - function Find(Data: Pointer): TAVLTreeNode; // O(log(n)) - function FindKey(Key: Pointer; - const OnCompareKeyWithData: TListSortCompare): TAVLTreeNode; // O(log(n)) - function FindNearestKey(Key: Pointer; - const OnCompareKeyWithData: TListSortCompare): TAVLTreeNode; // O(log(n)) - function FindSuccessor(ANode: TAVLTreeNode): TAVLTreeNode; inline; - function FindPrecessor(ANode: TAVLTreeNode): TAVLTreeNode; inline; - function FindLowest: TAVLTreeNode; // O(log(n)) - function FindHighest: TAVLTreeNode; // O(log(n)) - function FindNearest(Data: Pointer): TAVLTreeNode; - // search in a tree with duplicates (duplicate means here: Compare function returns 0) - function FindPointer(Data: Pointer): TAVLTreeNode; - function FindLeftMost(Data: Pointer): TAVLTreeNode; - function FindRightMost(Data: Pointer): TAVLTreeNode; - function FindLeftMostKey(Key: Pointer; - const OnCompareKeyWithData: TListSortCompare): TAVLTreeNode; - function FindRightMostKey(Key: Pointer; - const OnCompareKeyWithData: TListSortCompare): TAVLTreeNode; - function FindLeftMostSameKey(ANode: TAVLTreeNode): TAVLTreeNode; - function FindRightMostSameKey(ANode: TAVLTreeNode): TAVLTreeNode; - - // enumerators - function GetEnumerator: TAVLTreeNodeEnumerator; - function GetEnumeratorHighToLow: TAVLTreeNodeEnumerator; - - // consistency - procedure ConsistencyCheck; virtual; // JuMa: changed to procedure and added "virtual". - procedure WriteReportToStream(s: TStream); - function NodeToReportStr(aNode: TAVLTreeNode): string; virtual; - function ReportAsString: string; - end; - TAVLTreeClass = class of TAVLTree; - - { TAVLTreeNodeMemManager } - - TAVLTreeNodeMemManager = class(TBaseAVLTreeNodeManager) - private - FFirstFree: TAVLTreeNode; - FFreeCount: SizeInt; - FCount: SizeInt; - FMinFree: SizeInt; - FMaxFreeRatio: SizeInt; - {$IFDEF CheckAVLTreeNodeManager} - FThreadId: TThreadID; - {$ENDIF} - procedure SetMaxFreeRatio(NewValue: SizeInt); - procedure SetMinFree(NewValue: SizeInt); - procedure DisposeFirstFreeNode; - public - procedure DisposeNode(ANode: TAVLTreeNode); override; - function NewNode: TAVLTreeNode; override; - property MinimumFreeNode: SizeInt read FMinFree write SetMinFree; - property MaximumFreeNodeRatio: SizeInt - read FMaxFreeRatio write SetMaxFreeRatio; // in one eighth steps - property Count: SizeInt read FCount; - procedure Clear; - constructor Create; - destructor Destroy; override; - end; - -var - LazNodeMemManager: TAVLTreeNodeMemManager; - -implementation - -function ComparePointer(Data1, Data2: Pointer): integer; -begin - if Data1>Data2 then Result:=-1 - else if Data1nil then - FCurrent:=FCurrent.Successor - else - FCurrent:=FTree.FindLowest; - end else begin - if FCurrent<>nil then - FCurrent:=FCurrent.Precessor - else - FCurrent:=FTree.FindHighest; - end; - Result:=FCurrent<>nil; -end; - -{ TAVLTree } - -function TAVLTree.Add(Data: Pointer): TAVLTreeNode; -begin - Result:=NewNode; - Result.Data:=Data; - Add(Result); -end; - -function TAVLTree.AddAscendingSequence(Data: Pointer; LastAdded: TAVLTreeNode; - var Successor: TAVLTreeNode): TAVLTreeNode; -{ This is an optimized version of "Add" for adding an ascending sequence of - nodes. - It uses the LastAdded and Successor to skip searching for an insert position. - For nodes with same value the order of the sequence is kept. - - Usage: - LastNode:=nil; // TAvlTreeNode - Successor:=nil; // TAvlTreeNode - for i:=1 to 1000 do - LastNode:=Tree.AddAscendingSequence(TItem.Create(i),LastNode,Successor); -} -var - InsertPos: TAVLTreeNode; -begin - Result:=NewNode; - Result.Data:=Data; - if (LastAdded<>nil) and (Compare(LastAdded.Data,Data)<=0) - and ((Successor=nil) or (Compare(Data,Successor.Data)<=0)) then begin - // Data is between LastAdded and Successor - inc(FCount); - if LastAdded.Right=nil then begin - Result.Parent:=LastAdded; - LastAdded.Right:=Result; - end else begin - InsertPos:=LastAdded.Right; - while InsertPos.Left<>nil do - InsertPos:=InsertPos.Left; - Result.Parent:=InsertPos; - InsertPos.Left:=Result; - end; - NodeAdded(Result); - BalanceAfterInsert(Result); - end else begin - // normal Add - Add(Result); - Successor:=Result.Successor; - end; -end; - -function TAVLTree.NewNode: TAVLTreeNode; -begin - if fNodeMgr<>nil then - Result:=fNodeMgr.NewNode - else - Result:=NodeClass.Create; -end; - -procedure TAVLTree.DisposeNode(ANode: TAVLTreeNode); -begin - if fNodeMgr<>nil then - fNodeMgr.DisposeNode(ANode) - else - ANode.Free; -end; - -procedure TAVLTree.Add(ANode: TAVLTreeNode); -// add a node. If there are already nodes with the same value it will be -// inserted rightmost -var InsertPos: TAVLTreeNode; - InsertComp: integer; -begin - ANode.Left:=nil; - ANode.Right:=nil; - inc(FCount); - if Root<>nil then begin - InsertPos:=FindInsertPos(ANode.Data); - InsertComp:=Compare(ANode.Data,InsertPos.Data); - ANode.Parent:=InsertPos; - if InsertComp<0 then begin - // insert to the left - InsertPos.Left:=ANode; - end else begin - // insert to the right - InsertPos.Right:=ANode; - end; - NodeAdded(ANode); - BalanceAfterInsert(ANode); - end else begin - fRoot:=ANode; - ANode.Parent:=nil; - NodeAdded(ANode); - end; -end; - -function TAVLTree.FindLowest: TAVLTreeNode; -begin - Result:=Root; - if Result<>nil then - while Result.Left<>nil do Result:=Result.Left; -end; - -function TAVLTree.FindHighest: TAVLTreeNode; -begin - Result:=Root; - if Result<>nil then - while Result.Right<>nil do Result:=Result.Right; -end; - -procedure TAVLTree.BalanceAfterDelete(ANode: TAVLTreeNode); -var - OldParent, OldRight, OldRightLeft, OldLeft, OldLeftRight: TAVLTreeNode; -begin - while ANode<>nil do begin - if ((ANode.Balance=+1) or (ANode.Balance=-1)) then exit; - OldParent:=ANode.Parent; - if (ANode.Balance=0) then begin - // Treeheight has decreased by one - if (OldParent=nil) then - exit; - if(OldParent.Left=ANode) then - Inc(OldParent.Balance) - else - Dec(OldParent.Balance); - ANode:=OldParent; - end else if (ANode.Balance=+2) then begin - // Node is overweighted to the right - OldRight:=ANode.Right; - if (OldRight.Balance>=0) then begin - // OldRight.Balance is 0 or -1 - // rotate ANode,OldRight left - RotateLeft(ANode); - ANode.Balance:=(1-OldRight.Balance); // toggle 0 and 1 - Dec(OldRight.Balance); - ANode:=OldRight; - end else begin - // OldRight.Balance=-1 - { double rotate - = rotate OldRightLeft,OldRight right - and then rotate ANode,OldRightLeft left - OldParent OldParent - | | - ANode OldRightLeft - \ / \ - OldRight => ANode OldRight - / \ / - OldRightLeft OldRightLeftLeft OldRightLeftRight - / \ - OldRightLeftLeft OldRightLeftRight - } - OldRightLeft:=OldRight.Left; - RotateRight(OldRight); - RotateLeft(ANode); - if (OldRightLeft.Balance<=0) then - ANode.Balance:=0 - else - ANode.Balance:=-1; - if (OldRightLeft.Balance>=0) then - OldRight.Balance:=0 - else - OldRight.Balance:=+1; - OldRightLeft.Balance:=0; - ANode:=OldRightLeft; - end; - end else begin - // Node.Balance=-2 - // Node is overweighted to the left - OldLeft:=ANode.Left; - if (OldLeft.Balance<=0) then begin - // rotate OldLeft,ANode right - RotateRight(ANode); - ANode.Balance:=(-1-OldLeft.Balance); // toggle 0 and -1 - Inc(OldLeft.Balance); - ANode:=OldLeft; - end else begin - // OldLeft.Balance = 1 - { double rotate left right - = rotate OldLeft,OldLeftRight left - and then rotate OldLeft,ANode right - OldParent OldParent - | | - ANode OldLeftRight - / / \ - OldLeft => OldLeft ANode - \ \ / - OldLeftRight OldLeftRightLeft OldLeftRightRight - / \ - OldLeftRightLeft OldLeftRightRight - } - OldLeftRight:=OldLeft.Right; - RotateLeft(OldLeft); - RotateRight(ANode); - if (OldLeftRight.Balance>=0) then - ANode.Balance:=0 - else - ANode.Balance:=+1; - if (OldLeftRight.Balance<=0) then - OldLeft.Balance:=0 - else - OldLeft.Balance:=-1; - OldLeftRight.Balance:=0; - ANode:=OldLeftRight; - end; - end; - end; -end; - -procedure TAVLTree.DeletingNode(aNode: TAVLTreeNode); -// called by Delete -// Node.Left=nil or Node.Right=nil -begin - // for descendants to override -end; - -procedure TAVLTree.SetOnObjectCompare(const AValue: TObjectSortCompare); -begin - if AValue=nil then - SetCompares(FOnCompare,nil) - else - SetCompares(nil,AValue); -end; - -procedure TAVLTree.SetCompares(const NewCompare: TListSortCompare; - const NewObjectCompare: TObjectSortCompare); -var List: PPointer; - ANode: TAVLTreeNode; - i, OldCount: integer; -begin - if (FOnCompare=NewCompare) and (FOnObjectCompare=NewObjectCompare) then exit; - if Count<=1 then begin - FOnCompare:=NewCompare; - FOnObjectCompare:=NewObjectCompare; - exit; - end; - // sort the tree again - OldCount:=Count; - GetMem(List,SizeOf(Pointer)*OldCount); - try - // save the data in a list - ANode:=FindLowest; - i:=0; - while ANode<>nil do begin - List[i]:=ANode.Data; - inc(i); - ANode:=ANode.Successor; - end; - // clear the tree - Clear; - // set the new compare function - FOnCompare:=NewCompare; - FOnObjectCompare:=NewObjectCompare; - // re-add all nodes - for i:=0 to OldCount-1 do - Add(List[i]); - finally - FreeMem(List); - end; -end; - -procedure TAVLTree.SetNodeClass(const AValue: TAVLTreeNodeClass); -begin - if FNodeClass=AValue then Exit; - if Count>0 then - raise Exception.Create(ClassName+'.SetNodeClass Count='+IntToStr(Count) - +' Old='+fNodeMgr.ClassName+' New='+AValue.ClassName); - FNodeClass:=AValue; - if fNodeMgr=LazNodeMemManager then - fNodeMgr:=nil; -end; - -procedure TAVLTree.BalanceAfterInsert(ANode: TAVLTreeNode); -var - OldParent, OldRight, OldLeft: TAVLTreeNode; -begin - OldParent:=ANode.Parent; - while (OldParent<>nil) do begin - if (OldParent.Left=ANode) then begin - // Node is left child - dec(OldParent.Balance); - if (OldParent.Balance=0) then exit; - if (OldParent.Balance=-1) then begin - ANode:=OldParent; - OldParent:=ANode.Parent; - continue; - end; - // OldParent.Balance=-2 - if (ANode.Balance=-1) then begin - { rotate ANode,ANode.Parent right - OldParentParent OldParentParent - | | - OldParent => ANode - / \ - ANode OldParent - \ / - OldRight OldRight } - RotateRight(OldParent); - ANode.Balance:=0; - OldParent.Balance:=0; - end else begin - // Node.Balance = +1 - { double rotate - = rotate ANode,OldRight left and then rotate OldRight,OldParent right - OldParentParent OldParentParent - | | - OldParent OldRight - / => / \ - ANode ANode OldParent - \ \ / - OldRight OldRightLeft OldRightRight - / \ - OldRightLeft OldRightRight - } - OldRight:=ANode.Right; - RotateLeft(ANode); - RotateRight(OldParent); - if (OldRight.Balance<=0) then - ANode.Balance:=0 - else - ANode.Balance:=-1; - if (OldRight.Balance=-1) then - OldParent.Balance:=1 - else - OldParent.Balance:=0; - OldRight.Balance:=0; - end; - exit; - end else begin - // Node is right child - Inc(OldParent.Balance); - if (OldParent.Balance=0) then exit; - if (OldParent.Balance=+1) then begin - ANode:=OldParent; - OldParent:=ANode.Parent; - continue; - end; - // OldParent.Balance = +2 - if(ANode.Balance=+1) then begin - { rotate OldParent,ANode left - OldParentParent OldParentParent - | | - OldParent => ANode - \ / - ANode OldParent - / \ - OldLeft OldLeft } - RotateLeft(OldParent); - ANode.Balance:=0; - OldParent.Balance:=0; - end else begin - // Node.Balance = -1 - { double rotate - = rotate OldLeft,ANode right and then rotate OldParent,OldLeft right - OldParentParent OldParentParent - | | - OldParent OldLeft - \ => / \ - ANode OldParent ANode - / \ / - OldLeft OldLeftLeft OldLeftRight - / \ - OldLeftLeft OldLeftRight - } - OldLeft:=ANode.Left; - RotateRight(ANode); - RotateLeft(OldParent); - if (OldLeft.Balance>=0) then - ANode.Balance:=0 - else - ANode.Balance:=+1; - if (OldLeft.Balance=+1) then - OldParent.Balance:=-1 - else - OldParent.Balance:=0; - OldLeft.Balance:=0; - end; - exit; - end; - end; -end; - -procedure TAVLTree.Clear; - - procedure DeleteNode(ANode: TAVLTreeNode); - begin - if ANode<>nil then begin - if ANode.Left<>nil then DeleteNode(ANode.Left); - if ANode.Right<>nil then DeleteNode(ANode.Right); - end; - DisposeNode(ANode); - end; - -// Clear -begin - DeleteNode(Root); - fRoot:=nil; - FCount:=0; -end; - -constructor TAVLTree.Create(const OnCompareMethod: TListSortCompare); -begin - FOnCompare:=OnCompareMethod; - Init; -end; - -constructor TAVLTree.CreateObjectCompare( - const OnCompareMethod: TObjectSortCompare); -begin - FOnObjectCompare:=OnCompareMethod; - Init; -end; - -constructor TAVLTree.Create; -begin - Create(@ComparePointer); -end; - -procedure TAVLTree.Delete(ANode: TAVLTreeNode); -var - OldParent, Child: TAVLTreeNode; -begin - {$IFDEF CheckAVLTreeNodeManager} - OldParent:=ANode; - while OldParent.Parent<>nil do OldParent:=OldParent.Parent; - if OldParent<>Root then - raise Exception.Create('TAVLTree.Delete'); // not my node - {$ENDIF} - if (ANode.Left<>nil) and (ANode.Right<>nil) then begin - // ANode has both: Left and Right - // Switch ANode position with Successor - // Because ANode.Right<>nil the Successor is a child of ANode - SwitchPositionWithSuccessor(ANode,ANode.Successor); - end; - // left or right is nil - DeletingNode(aNode); - OldParent:=ANode.Parent; - ANode.Parent:=nil; - if ANode.Left<>nil then - Child:=ANode.Left - else - Child:=ANode.Right; - if Child<>nil then - Child.Parent:=OldParent; - if (OldParent<>nil) then begin - // Node has parent - if (OldParent.Left=ANode) then begin - // Node is left child of OldParent - OldParent.Left:=Child; - Inc(OldParent.Balance); - end else begin - // Node is right child of OldParent - OldParent.Right:=Child; - Dec(OldParent.Balance); - end; - BalanceAfterDelete(OldParent); - end else begin - // Node was Root - fRoot:=Child; - end; - dec(FCount); - DisposeNode(ANode); -end; - -function TAVLTree.Remove(Data: Pointer): boolean; -var - ANode: TAvlTreeNode; -begin - ANode:=Find(Data); - if ANode<>nil then begin - Delete(ANode); - Result:=true; - end else - Result:=false; -end; - -function TAVLTree.RemovePointer(Data: Pointer): boolean; -var - ANode: TAvlTreeNode; -begin - ANode:=FindPointer(Data); - if ANode<>nil then begin - Delete(ANode); - Result:=true; - end else - Result:=false; -end; - -destructor TAVLTree.Destroy; -begin - Clear; - if fNodeMgrAutoFree then - FreeAndNil(fNodeMgr); - inherited Destroy; -end; - -function TAVLTree.GetEnumerator: TAVLTreeNodeEnumerator; -begin - Result:=TAVLTreeNodeEnumerator.Create(Self,true); -end; - -function TAVLTree.GetEnumeratorHighToLow: TAVLTreeNodeEnumerator; -begin - Result:=TAVLTreeNodeEnumerator.Create(Self,false); -end; - -function TAVLTree.Find(Data: Pointer): TAVLTreeNode; -var Comp: integer; -begin - Result:=Root; - while (Result<>nil) do begin - Comp:=Compare(Data,Result.Data); - if Comp=0 then exit; - if Comp<0 then begin - Result:=Result.Left - end else begin - Result:=Result.Right - end; - end; -end; - -function TAVLTree.FindKey(Key: Pointer; const OnCompareKeyWithData: TListSortCompare - ): TAVLTreeNode; -var Comp: integer; -begin - Result:=Root; - while (Result<>nil) do begin - Comp:=OnCompareKeyWithData(Key,Result.Data); - if Comp=0 then exit; - if Comp<0 then begin - Result:=Result.Left - end else begin - Result:=Result.Right - end; - end; -end; - -function TAVLTree.FindNearestKey(Key: Pointer; - const OnCompareKeyWithData: TListSortCompare): TAVLTreeNode; -var Comp: integer; -begin - Result:=fRoot; - while (Result<>nil) do begin - Comp:=OnCompareKeyWithData(Key,Result.Data); - if Comp=0 then exit; - if Comp<0 then begin - if Result.Left<>nil then - Result:=Result.Left - else - exit; - end else begin - if Result.Right<>nil then - Result:=Result.Right - else - exit; - end; - end; -end; - -function TAVLTree.FindLeftMostKey(Key: Pointer; - const OnCompareKeyWithData: TListSortCompare): TAVLTreeNode; -var - LeftNode: TAVLTreeNode; -begin - Result:=FindKey(Key,OnCompareKeyWithData); - if Result=nil then exit; - repeat - LeftNode:=Result.Precessor; - if (LeftNode=nil) or (OnCompareKeyWithData(Key,LeftNode.Data)<>0) then exit; - Result:=LeftNode; - until false; -end; - -function TAVLTree.FindRightMostKey(Key: Pointer; - const OnCompareKeyWithData: TListSortCompare): TAVLTreeNode; -var - RightNode: TAVLTreeNode; -begin - Result:=FindKey(Key,OnCompareKeyWithData); - if Result=nil then exit; - repeat - RightNode:=Result.Successor; - if (RightNode=nil) or (OnCompareKeyWithData(Key,RightNode.Data)<>0) then exit; - Result:=RightNode; - until false; -end; - -function TAVLTree.FindLeftMostSameKey(ANode: TAVLTreeNode): TAVLTreeNode; -var - LeftNode: TAVLTreeNode; - Data: Pointer; -begin - if ANode<>nil then begin - Data:=ANode.Data; - Result:=ANode; - repeat - LeftNode:=Result.Precessor; - if (LeftNode=nil) or (Compare(Data,LeftNode.Data)<>0) then break; - Result:=LeftNode; - until false; - end else begin - Result:=nil; - end; -end; - -function TAVLTree.FindRightMostSameKey(ANode: TAVLTreeNode): TAVLTreeNode; -var - RightNode: TAVLTreeNode; - Data: Pointer; -begin - if ANode<>nil then begin - Data:=ANode.Data; - Result:=ANode; - repeat - RightNode:=Result.Successor; - if (RightNode=nil) or (Compare(Data,RightNode.Data)<>0) then break; - Result:=RightNode; - until false; - end else begin - Result:=nil; - end; -end; - -function TAVLTree.FindNearest(Data: Pointer): TAVLTreeNode; -var Comp: integer; -begin - Result:=Root; - while (Result<>nil) do begin - Comp:=Compare(Data,Result.Data); - if Comp=0 then exit; - if Comp<0 then begin - if Result.Left<>nil then - Result:=Result.Left - else - exit; - end else begin - if Result.Right<>nil then - Result:=Result.Right - else - exit; - end; - end; -end; - -function TAVLTree.FindPointer(Data: Pointer): TAVLTreeNode; -// same as Find, but not comparing for key, but same Data too -begin - Result:=FindLeftMost(Data); - while (Result<>nil) do begin - if Result.Data=Data then break; - Result:=Result.Successor; - if Result=nil then exit; - if Compare(Data,Result.Data)<>0 then exit(nil); - end; -end; - -function TAVLTree.FindLeftMost(Data: Pointer): TAVLTreeNode; -var - Left: TAVLTreeNode; -begin - Result:=Find(Data); - while (Result<>nil) do begin - Left:=Result.Precessor; - if (Left=nil) or (Compare(Data,Left.Data)<>0) then break; - Result:=Left; - end; -end; - -function TAVLTree.FindRightMost(Data: Pointer): TAVLTreeNode; -var - Right: TAVLTreeNode; -begin - Result:=Find(Data); - while (Result<>nil) do begin - Right:=Result.Successor; - if (Right=nil) or (Compare(Data,Right.Data)<>0) then break; - Result:=Right; - end; -end; - -function TAVLTree.FindInsertPos(Data: Pointer): TAVLTreeNode; -var Comp: integer; -begin - Result:=Root; - while (Result<>nil) do begin - Comp:=Compare(Data,Result.Data); - if Comp<0 then begin - if Result.Left<>nil then - Result:=Result.Left - else - exit; - end else begin - if Result.Right<>nil then - Result:=Result.Right - else - exit; - end; - end; -end; - -procedure TAVLTree.Init; -begin - FNodeClass:=TAVLTreeNode; -end; - -procedure TAVLTree.NodeAdded(aNode: TAVLTreeNode); -begin - // for descendants to override -end; - -procedure TAVLTree.RotateLeft(aNode: TAVLTreeNode); -{ Parent Parent - | | - Node => OldRight - / \ / - Left OldRight Node - / / \ - OldRightLeft Left OldRightLeft } -var - AParent, OldRight, OldRightLeft: TAVLTreeNode; -begin - OldRight:=aNode.Right; - OldRightLeft:=OldRight.Left; - AParent:=aNode.Parent; - if AParent<>nil then begin - if AParent.Left=aNode then - AParent.Left:=OldRight - else - AParent.Right:=OldRight; - end else - fRoot:=OldRight; - OldRight.Parent:=AParent; - aNode.Parent:=OldRight; - aNode.Right:=OldRightLeft; - if OldRightLeft<>nil then - OldRightLeft.Parent:=aNode; - OldRight.Left:=aNode; -end; - -procedure TAVLTree.RotateRight(aNode: TAVLTreeNode); -{ Parent Parent - | | - Node => OldLeft - / \ \ - OldLeft Right Node - \ / \ - OldLeftRight OldLeftRight Right } -var - AParent, OldLeft, OldLeftRight: TAVLTreeNode; -begin - OldLeft:=aNode.Left; - OldLeftRight:=OldLeft.Right; - AParent:=aNode.Parent; - if AParent<>nil then begin - if AParent.Left=aNode then - AParent.Left:=OldLeft - else - AParent.Right:=OldLeft; - end else - fRoot:=OldLeft; - OldLeft.Parent:=AParent; - aNode.Parent:=OldLeft; - aNode.Left:=OldLeftRight; - if OldLeftRight<>nil then - OldLeftRight.Parent:=aNode; - OldLeft.Right:=aNode; -end; - -procedure TAVLTree.SwitchPositionWithSuccessor(aNode, aSuccessor: TAVLTreeNode); -{ called by delete, when aNode.Left<>nil and aNode.Right<>nil - Switch ANode position with Successor - Because ANode.Right<>nil the Successor is a child of ANode } -var - OldBalance: Integer; - OldParent, OldLeft, OldRight, - OldSuccParent, OldSuccLeft, OldSuccRight: TAVLTreeNode; -begin - OldBalance:=aNode.Balance; - aNode.Balance:=aSuccessor.Balance; - aSuccessor.Balance:=OldBalance; - - OldParent:=aNode.Parent; - OldLeft:=aNode.Left; - OldRight:=aNode.Right; - OldSuccParent:=aSuccessor.Parent; - OldSuccLeft:=aSuccessor.Left; - OldSuccRight:=aSuccessor.Right; - - if OldParent<>nil then begin - if OldParent.Left=aNode then - OldParent.Left:=aSuccessor - else - OldParent.Right:=aSuccessor; - end else - fRoot:=aSuccessor; - aSuccessor.Parent:=OldParent; - - if OldSuccParent<>aNode then begin - if OldSuccParent.Left=aSuccessor then - OldSuccParent.Left:=aNode - else - OldSuccParent.Right:=aNode; - aSuccessor.Right:=OldRight; - aNode.Parent:=OldSuccParent; - if OldRight<>nil then - OldRight.Parent:=aSuccessor; - end else begin - { aNode aSuccessor - \ => \ - aSuccessor aNode } - aSuccessor.Right:=aNode; - aNode.Parent:=aSuccessor; - end; - - aNode.Left:=OldSuccLeft; - if OldSuccLeft<>nil then - OldSuccLeft.Parent:=aNode; - aNode.Right:=OldSuccRight; - if OldSuccRight<>nil then - OldSuccRight.Parent:=aNode; - aSuccessor.Left:=OldLeft; - if OldLeft<>nil then - OldLeft.Parent:=aSuccessor; -end; - -function TAVLTree.FindSuccessor(ANode: TAVLTreeNode): TAVLTreeNode; -begin - if ANode<>nil then - Result:=ANode.Successor - else - Result:=nil; -end; - -function TAVLTree.FindPrecessor(ANode: TAVLTreeNode): TAVLTreeNode; -begin - if ANode<>nil then - Result:=ANode.Precessor - else - Result:=nil; -end; - -procedure TAVLTree.MoveDataLeftMost(var ANode: TAVLTreeNode); -var - LeftMost, PreNode: TAVLTreeNode; - Data: Pointer; -begin - if ANode=nil then exit; - LeftMost:=ANode; - repeat - PreNode:=FindPrecessor(LeftMost); - if (PreNode=nil) or (Compare(ANode,PreNode)<>0) then break; - LeftMost:=PreNode; - until false; - if LeftMost=ANode then exit; - Data:=LeftMost.Data; - LeftMost.Data:=ANode.Data; - ANode.Data:=Data; - ANode:=LeftMost; -end; - -procedure TAVLTree.MoveDataRightMost(var ANode: TAVLTreeNode); -var - RightMost, PostNode: TAVLTreeNode; - Data: Pointer; -begin - if ANode=nil then exit; - RightMost:=ANode; - repeat - PostNode:=FindSuccessor(RightMost); - if (PostNode=nil) or (Compare(ANode,PostNode)<>0) then break; - RightMost:=PostNode; - until false; - if RightMost=ANode then exit; - Data:=RightMost.Data; - RightMost.Data:=ANode.Data; - ANode.Data:=Data; - ANode:=RightMost; -end; - -procedure TAVLTree.ConsistencyCheck; - - procedure E(const Msg: string); - begin - raise Exception.Create('TAVLTree.ConsistencyCheck: '+Msg); - end; - -var - RealCount: SizeInt; -begin - RealCount:=0; - if FRoot<>nil then begin - FRoot.ConsistencyCheck(Self); - RealCount:=FRoot.GetCount; - end; - if Count<>RealCount then - E('Count<>RealCount'); -end; - -procedure TAVLTree.FreeAndClear; - - procedure FreeNodeData(ANode: TAVLTreeNode); - begin - if ANode=nil then exit; - FreeNodeData(ANode.Left); - FreeNodeData(ANode.Right); - if ANode.Data<>nil then TObject(ANode.Data).Free; - ANode.Data:=nil; - end; - -// TAVLTree.FreeAndClear -var - r: TAVLTreeNode; -begin - // free all data - r := Root; - FRoot := nil; // Prevent any being-destroyed object from removing its node. - try - FreeNodeData(r); - finally - FRoot := r; - end; - // free all nodes - Clear; -end; - -procedure TAVLTree.FreeAndDelete(ANode: TAVLTreeNode); -var OldData: TObject; -begin - OldData:=TObject(ANode.Data); - Delete(ANode); - OldData.Free; -end; - -function TAVLTree.Equals(Obj: TObject): boolean; -begin - if Obj is TAVLTree then - Result:=IsEqual(TAVLTree(Obj),false) - else - Result:=inherited Equals(Obj); -end; - -function TAVLTree.IsEqual(aTree: TAVLTree; CheckDataPointer: boolean): boolean; -var - MyNode, OtherNode: TAVLTreeNode; -begin - if aTree=Self then exit(true); - Result:=false; - if aTree=nil then exit; - if Count<>aTree.Count then exit; - if OnCompare<>aTree.OnCompare then exit; - if OnObjectCompare<>aTree.OnObjectCompare then exit; - if NodeClass<>aTree.NodeClass then exit; - MyNode:=FindLowest; - OtherNode:=aTree.FindLowest; - while MyNode<>nil do begin - if OtherNode=nil then exit; - if CheckDataPointer then begin - if MyNode.Data<>OtherNode.Data then exit; - end else begin - if Compare(MyNode.Data,OtherNode.Data)<>0 then exit; - end; - MyNode:=MyNode.Successor; - OtherNode:=OtherNode.Successor; - end; - if OtherNode<>nil then exit; - Result:=true; -end; - -procedure TAVLTree.Assign(aTree: TAVLTree); - - procedure AssignNode(var MyNode: TAVLTreeNode; OtherNode: TAVLTreeNode); - begin - MyNode:=NewNode; - MyNode.Data:=OtherNode.Data; - MyNode.Balance:=OtherNode.Balance; - if OtherNode.Left<>nil then begin - AssignNode(MyNode.Left,OtherNode.Left); - MyNode.Left.Parent:=MyNode; - end; - if OtherNode.Right<>nil then begin - AssignNode(MyNode.Right,OtherNode.Right); - MyNode.Right.Parent:=MyNode; - end; - end; - -begin - if aTree=nil then - raise Exception.Create('TAVLTree.Assign aTree=nil'); - if IsEqual(aTree,true) then exit; - Clear; - SetCompares(aTree.OnCompare,aTree.OnObjectCompare); - NodeClass:=aTree.NodeClass; - if aTree.Root<>nil then - AssignNode(fRoot,aTree.Root); - FCount:=aTree.Count; -end; - -function TAVLTree.Compare(Data1, Data2: Pointer): integer; -begin - if Assigned(FOnCompare) then - Result:=FOnCompare(Data1,Data2) - else - Result:=FOnObjectCompare(Self,Data1,Data2); -end; - -procedure TAVLTree.WriteReportToStream(s: TStream); - - procedure WriteStr(const Txt: string); - begin - if Txt='' then exit; - s.Write(Txt[1],length(Txt)); - end; - - procedure WriteTreeNode(ANode: TAVLTreeNode); - var - b: String; - IsLeft: boolean; - AParent: TAVLTreeNode; - WasLeft: Boolean; - begin - if ANode=nil then exit; - WriteTreeNode(ANode.Right); - AParent:=ANode; - WasLeft:=false; - b:=''; - while AParent<>nil do begin - if AParent.Parent=nil then begin - if AParent=ANode then - b:='--'+b - else - b:=' '+b; - break; - end; - IsLeft:=AParent.Parent.Left=AParent; - if AParent=ANode then begin - if IsLeft then - b:='\-' - else - b:='/-'; - end else begin - if WasLeft=IsLeft then - b:=' '+b - else - b:='| '+b; - end; - WasLeft:=IsLeft; - AParent:=AParent.Parent; - end; - b:=b+NodeToReportStr(ANode)+LineEnding; - WriteStr(b); - WriteTreeNode(ANode.Left); - end; - -// TAVLTree.WriteReportToStream -begin - WriteStr('-Start-of-AVL-Tree-------------------'+LineEnding); - WriteTreeNode(fRoot); - WriteStr('-End-Of-AVL-Tree---------------------'+LineEnding); -end; - -function TAVLTree.NodeToReportStr(aNode: TAVLTreeNode): string; -begin - Result:=Format('%p Self=%p Parent=%p Balance=%d', - [aNode.Data, Pointer(aNode),Pointer(aNode.Parent), aNode.Balance]); -end; - -function TAVLTree.ReportAsString: string; -var ms: TMemoryStream; -begin - Result:=''; - ms:=TMemoryStream.Create; - try - WriteReportToStream(ms); - ms.Position:=0; - SetLength(Result,ms.Size); - if Result<>'' then - ms.Read(Result[1],length(Result)); - finally - ms.Free; - end; -end; - -procedure TAVLTree.SetOnCompare(const AValue: TListSortCompare); -begin - if AValue=nil then - SetCompares(nil,FOnObjectCompare) - else - SetCompares(AValue,nil); -end; - -procedure TAVLTree.SetNodeManager(NewMgr: TBaseAVLTreeNodeManager; - AutoFree: boolean); -// only allowed just after create. -begin - if fNodeMgr=NewMgr then exit; - if Count>0 then - raise Exception.Create('TAVLTree.SetNodeManager'); - if fNodeMgrAutoFree then - FreeAndNil(fNodeMgr); - fNodeMgr:=NewMgr; - fNodeMgrAutoFree:=AutoFree; -end; - -{ TAVLTreeNode } - -function TAVLTreeNode.TreeDepth: integer; -// longest WAY down. e.g. only one node => 0 ! -var LeftDepth, RightDepth: integer; -begin - if Left<>nil then - LeftDepth:=Left.TreeDepth+1 - else - LeftDepth:=0; - if Right<>nil then - RightDepth:=Right.TreeDepth+1 - else - RightDepth:=0; - if LeftDepth>RightDepth then - Result:=LeftDepth - else - Result:=RightDepth; -end; - -procedure TAVLTreeNode.ConsistencyCheck(Tree: TAVLTree); - - procedure E(const Msg: string); - begin - raise Exception.Create('TAVLTreeNode.ConsistencyCheck: '+Msg); - end; - -var - LeftDepth: SizeInt; - RightDepth: SizeInt; -begin - // test left child - if Left<>nil then begin - if Left.Parent<>Self then - E('Left.Parent<>Self'); - if Tree.Compare(Left.Data,Data)>0 then - E('Compare(Left.Data,Data)>0'); - Left.ConsistencyCheck(Tree); - end; - // test right child - if Right<>nil then begin - if Right.Parent<>Self then - E('Right.Parent<>Self'); - if Tree.Compare(Data,Right.Data)>0 then - E('Compare(Data,Right.Data)>0'); - Right.ConsistencyCheck(Tree); - end; - // test balance - if Left<>nil then - LeftDepth:=Left.TreeDepth+1 - else - LeftDepth:=0; - if Right<>nil then - RightDepth:=Right.TreeDepth+1 - else - RightDepth:=0; - if Balance<>(RightDepth-LeftDepth) then - E('Balance['+IntToStr(Balance)+']<>(RightDepth['+IntToStr(RightDepth)+']-LeftDepth['+IntToStr(LeftDepth)+'])'); -end; - -function TAVLTreeNode.GetCount: SizeInt; -begin - Result:=1; - if Left<>nil then inc(Result,Left.GetCount); - if Right<>nil then inc(Result,Right.GetCount); -end; - -function TAVLTreeNode.Successor: TAVLTreeNode; -begin - Result:=Right; - if Result<>nil then begin - while (Result.Left<>nil) do Result:=Result.Left; - end else begin - Result:=Self; - while (Result.Parent<>nil) and (Result.Parent.Right=Result) do - Result:=Result.Parent; - Result:=Result.Parent; - end; -end; - -function TAVLTreeNode.Precessor: TAVLTreeNode; -begin - Result:=Left; - if Result<>nil then begin - while (Result.Right<>nil) do Result:=Result.Right; - end else begin - Result:=Self; - while (Result.Parent<>nil) and (Result.Parent.Left=Result) do - Result:=Result.Parent; - Result:=Result.Parent; - end; -end; - -procedure TAVLTreeNode.Clear; -begin - Parent:=nil; - Left:=nil; - Right:=nil; - Balance:=0; - Data:=nil; -end; - - - -{ TAVLTreeNodeMemManager } - -constructor TAVLTreeNodeMemManager.Create; -begin - {$IFDEF CheckAVLTreeNodeManager} - FThreadId:=GetCurrentThreadId; - {$ENDIF} - inherited Create; - FFirstFree:=nil; - FFreeCount:=0; - FCount:=0; - FMinFree:=100; - FMaxFreeRatio:=8; // 1:1 -end; - -destructor TAVLTreeNodeMemManager.Destroy; -begin - Clear; - inherited Destroy; -end; - -procedure TAVLTreeNodeMemManager.DisposeNode(ANode: TAVLTreeNode); -begin - if ANode=nil then exit; - {$IFDEF CheckAVLTreeNodeManager} - if GetCurrentThreadId<>FThreadId then - raise Exception.Create('TAVLTreeNodeMemManager.DisposeNode not thread safe!'); - {$ENDIF} - if FCount < 0 then - raise Exception.CreateFmt( - '%s.DisposeNode: FCount (%d) is negative. Should not happen.' - +' FFreeCount=%d, FMinFree=%d, FMaxFreeRatio=%d.', - [ClassName, FCount, FFreeCount, FMinFree, FMaxFreeRatio]); - if (FFreeCount(((8+FMaxFreeRatio)*FCount) shr 3)) then begin - DisposeFirstFreeNode; - DisposeFirstFreeNode; - end; - end else begin - // free list full -> free the ANode - ANode.Free; - end; - dec(FCount); -end; - -function TAVLTreeNodeMemManager.NewNode: TAVLTreeNode; -begin - {$IFDEF CheckAVLTreeNodeManager} - if GetCurrentThreadId<>FThreadId then - raise Exception.Create('TAVLTreeNodeMemManager.NewNode: not thread safe!'); - {$ENDIF} - if FFirstFree<>nil then begin - // take from free list - Result:=FFirstFree; - FFirstFree:=FFirstFree.Right; - Result.Right:=nil; - dec(FFreeCount); - end else begin - // free list empty -> create new node - Result:=TAVLTreeNode.Create; - end; - inc(FCount); -end; - -procedure TAVLTreeNodeMemManager.Clear; -var ANode: TAVLTreeNode; -begin - {$IFDEF CheckAVLTreeNodeManager} - if GetCurrentThreadId<>FThreadId then - raise Exception.Create('TAVLTreeNodeMemManager.Clear: not thread safe!'); - {$ENDIF} - while FFirstFree<>nil do begin - ANode:=FFirstFree; - FFirstFree:=FFirstFree.Right; - ANode.Right:=nil; - ANode.Free; - end; - FFreeCount:=0; -end; - -procedure TAVLTreeNodeMemManager.SetMaxFreeRatio(NewValue: SizeInt); -begin - if NewValue<0 then NewValue:=0; - if NewValue=FMaxFreeRatio then exit; - FMaxFreeRatio:=NewValue; -end; - -procedure TAVLTreeNodeMemManager.SetMinFree(NewValue: SizeInt); -begin - if NewValue<0 then NewValue:=0; - if NewValue=FMinFree then exit; - FMinFree:=NewValue; -end; - -procedure TAVLTreeNodeMemManager.DisposeFirstFreeNode; -var OldNode: TAVLTreeNode; -begin - if FFirstFree=nil then exit; - OldNode:=FFirstFree; - FFirstFree:=FFirstFree.Right; - dec(FFreeCount); - OldNode.Right:=nil; - OldNode.Free; -end; - - -initialization - LazNodeMemManager:=TAVLTreeNodeMemManager.Create; - -finalization - LazNodeMemManager.Free; - LazNodeMemManager:=nil; -end. diff --git a/components/lazutils/lazconfigstorage.pas b/components/lazutils/lazconfigstorage.pas index 18f5f7fe8b..208f507440 100644 --- a/components/lazutils/lazconfigstorage.pas +++ b/components/lazutils/lazconfigstorage.pas @@ -18,7 +18,7 @@ unit LazConfigStorage; interface uses - Classes, SysUtils, typinfo, Laz_AVL_Tree, + Classes, SysUtils, TypInfo, AVL_Tree, // LazUtils LazLoggerBase, AvgLvlTree, LazStringUtils; diff --git a/components/lazutils/lazfilecache.pas b/components/lazutils/lazfilecache.pas index d9814caadb..1d0f35e3f6 100644 --- a/components/lazutils/lazfilecache.pas +++ b/components/lazutils/lazfilecache.pas @@ -13,7 +13,7 @@ unit LazFileCache; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, LazDbgLog, LazFileUtils; type diff --git a/components/lazutils/laztracer.pas b/components/lazutils/laztracer.pas index 7246951fcc..318aed5573 100644 --- a/components/lazutils/laztracer.pas +++ b/components/lazutils/laztracer.pas @@ -13,7 +13,7 @@ unit LazTracer; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LazUtils LazLoggerBase, LazUtilities, LazUtilsStrConsts; diff --git a/components/lazutils/lazutils.lpk b/components/lazutils/lazutils.lpk index 8e7bddb881..862d4d50b1 100644 --- a/components/lazutils/lazutils.lpk +++ b/components/lazutils/lazutils.lpk @@ -134,10 +134,6 @@ - - - - diff --git a/components/lazutils/lazutils.pas b/components/lazutils/lazutils.pas index 1d6249f5f8..6f97633594 100644 --- a/components/lazutils/lazutils.pas +++ b/components/lazutils/lazutils.pas @@ -12,10 +12,10 @@ uses DynHashArray, DynQueue, ExtendedStrings, FileReferenceList, FileUtil, FPCAdds, GraphMath, GraphType, HTML2TextRender, IntegerList, Laz2_DOM, Laz2_XMLCfg, Laz2_XMLRead, Laz2_XMLUtils, Laz2_XMLWrite, Laz2_XPath, - Laz_AVL_Tree, Laz_DOM, Laz_XMLCfg, Laz_XMLRead, Laz_XMLStreaming, - Laz_XMLWrite, LazClasses, lazCollections, LazConfigStorage, LazDbgLog, - LazFglHash, LazFileCache, LazFileUtils, LazLinkedList, LazListClasses, - LazLogger, LazLoggerBase, LazLoggerDummy, LazLoggerProfiling, LazMethodList, + Laz_DOM, Laz_XMLCfg, Laz_XMLRead, Laz_XMLStreaming, Laz_XMLWrite, + LazClasses, lazCollections, LazConfigStorage, LazDbgLog, LazFglHash, + LazFileCache, LazFileUtils, LazLinkedList, LazListClasses, LazLogger, + LazLoggerBase, LazLoggerDummy, LazLoggerProfiling, LazMethodList, LazPasReadUtil, LazStringUtils, LazSysUtils, LazTracer, LazUnicode, LazUTF16, LazUTF8, LazUtilities, LazUtilsStrConsts, LazVersion, LConvEncoding, LCSVUtils, LookupStringList, Maps, Masks, ObjectLists, diff --git a/components/lazutils/maps.pp b/components/lazutils/maps.pp index 2f5e54602b..9d9daec568 100644 --- a/components/lazutils/maps.pp +++ b/components/lazutils/maps.pp @@ -24,7 +24,7 @@ unit Maps; interface uses - Classes, SysUtils, Math, typinfo, Laz_AVL_Tree, + Classes, SysUtils, Math, TypInfo, AVL_Tree, // LazUtils FPCAdds; diff --git a/components/synedit/synbeautifier.pas b/components/synedit/synbeautifier.pas index f2db827809..74b9de42b4 100644 --- a/components/synedit/synbeautifier.pas +++ b/components/synedit/synbeautifier.pas @@ -40,9 +40,9 @@ unit SynBeautifier; interface uses - Classes, SysUtils, StrUtils, + Classes, SysUtils, LazStringUtils, - SynEditMiscClasses, SynEditMiscProcs, LazSynEditText, SynEditPointClasses, + SynEditMiscClasses, LazSynEditText, SynEditPointClasses, SynEditKeyCmds, SynEditTypes; type diff --git a/components/synedit/synedithighlighterfoldbase.pas b/components/synedit/synedithighlighterfoldbase.pas index a6f2dd1ce0..c42533105b 100644 --- a/components/synedit/synedithighlighterfoldbase.pas +++ b/components/synedit/synedithighlighterfoldbase.pas @@ -57,7 +57,7 @@ unit SynEditHighlighterFoldBase; interface uses - SysUtils, Classes, math, Laz_AVL_Tree, + SysUtils, Classes, Math, AVL_Tree, // LazUtils LazClasses, LazLoggerBase, LazTracer, // SynEdit diff --git a/components/synedit/syneditmarkuphighall.pp b/components/synedit/syneditmarkuphighall.pp index 1c552c1650..f522c2829b 100644 --- a/components/synedit/syneditmarkuphighall.pp +++ b/components/synedit/syneditmarkuphighall.pp @@ -26,11 +26,11 @@ unit SynEditMarkupHighAll; interface uses - Classes, SysUtils, StrUtils, + Classes, SysUtils, // LCL LCLProc, Controls, ExtCtrls, // LazUtils - LazClasses, LazUTF8, LazMethodList, LazStringUtils, + LazClasses, LazUTF8, LazMethodList, // SynEdit SynEditMarkup, SynEditTypes, SynEditSearch, SynEditMiscClasses, SynEditHighlighter, SynEditPointClasses, SynEditMiscProcs, diff --git a/components/todolist/todolist.pas b/components/todolist/todolist.pas index 560a22a55c..dddcae6c99 100644 --- a/components/todolist/todolist.pas +++ b/components/todolist/todolist.pas @@ -61,7 +61,7 @@ interface uses // FCL, RTL - Classes, SysUtils, Math, Laz_AVL_Tree, + Classes, SysUtils, Math, AVL_Tree, // LCL LCLType, LclIntf, Forms, Controls, StdCtrls, Dialogs, ComCtrls, ActnList, XMLPropStorage, ExtCtrls, diff --git a/components/todolist/todolistcore.pas b/components/todolist/todolistcore.pas index cf7f7383ae..fa42b47c40 100644 --- a/components/todolist/todolistcore.pas +++ b/components/todolist/todolistcore.pas @@ -36,7 +36,7 @@ interface uses // FCL, RTL - Classes, SysUtils, StrUtils, Laz_AVL_Tree, + Classes, SysUtils, StrUtils, AVL_Tree, // LCL LCLType, LclIntf, Controls, Dialogs, ComCtrls, // LazUtils diff --git a/components/wiki/lazwiki/wikiformat.pas b/components/wiki/lazwiki/wikiformat.pas index 24210248ad..5521af4cb4 100644 --- a/components/wiki/lazwiki/wikiformat.pas +++ b/components/wiki/lazwiki/wikiformat.pas @@ -27,7 +27,7 @@ unit WikiFormat; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LazUtils LazFileUtils, Laz2_XMLRead, Laz2_DOM, LazLoggerBase, AvgLvlTree, LazUTF8, LazStringUtils, // Codetools diff --git a/components/wiki/wikiget.lpr b/components/wiki/wikiget.lpr index 0759246a33..4ce257f4ca 100644 --- a/components/wiki/wikiget.lpr +++ b/components/wiki/wikiget.lpr @@ -29,7 +29,7 @@ uses {$IFDEF UNIX} cthreads, {$ENDIF} - Classes, SysUtils, CustApp, strutils, Laz_AVL_Tree, + Classes, SysUtils, CustApp, strutils, AVL_Tree, // LazUtils LazFileUtils, Laz2_XMLRead, Laz2_DOM, Laz2_XMLWrite, LazLogger, avglvltree, LazUTF8, LazStringUtils, diff --git a/converter/chgencodingdlg.pas b/converter/chgencodingdlg.pas index 92d21d57ed..15e8ecd805 100644 --- a/converter/chgencodingdlg.pas +++ b/converter/chgencodingdlg.pas @@ -31,7 +31,7 @@ interface uses // RTL + FCL - Classes, SysUtils, RegExpr, Laz_AVL_Tree, + Classes, SysUtils, RegExpr, AVL_Tree, // LCL Forms, Controls, ExtCtrls, StdCtrls, ComCtrls, Buttons, // CodeTools diff --git a/converter/convertsettings.pas b/converter/convertsettings.pas index 068c5ed429..999158b1f7 100644 --- a/converter/convertsettings.pas +++ b/converter/convertsettings.pas @@ -30,7 +30,7 @@ unit ConvertSettings; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Forms, Controls, Dialogs, StdCtrls, Buttons, ButtonPanel, ComCtrls, // LazUtils diff --git a/converter/usedunits.pas b/converter/usedunits.pas index d5eb473169..43c2c3d957 100644 --- a/converter/usedunits.pas +++ b/converter/usedunits.pas @@ -31,7 +31,7 @@ unit UsedUnits; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Forms, Controls, // LazUtils diff --git a/designer/jitforms.pp b/designer/jitforms.pp index d6a48bd6c0..1c8fc7eaef 100644 --- a/designer/jitforms.pp +++ b/designer/jitforms.pp @@ -42,7 +42,7 @@ uses {$IFDEF IDE_MEM_CHECK} MemCheck, {$ENDIF} - Classes, SysUtils, TypInfo, Laz_AVL_Tree, + Classes, SysUtils, TypInfo, AVL_Tree, // LCL Forms, Controls, Dialogs, LResources, LCLMemManager, LCLProc, //LazUtils diff --git a/designer/taborderdlg.pas b/designer/taborderdlg.pas index f21a119a22..14a6e636fa 100644 --- a/designer/taborderdlg.pas +++ b/designer/taborderdlg.pas @@ -32,7 +32,7 @@ unit TabOrderDlg; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Forms, Controls, Dialogs, Buttons, ExtCtrls, StdCtrls, ComCtrls, LCLType, // LazUtils diff --git a/ide/buildmanager.pas b/ide/buildmanager.pas index b019ee0a63..4a395c884d 100644 --- a/ide/buildmanager.pas +++ b/ide/buildmanager.pas @@ -35,7 +35,7 @@ interface uses // RTL + FCL - Classes, SysUtils, Types, Laz_AVL_Tree, + Classes, SysUtils, Types, AVL_Tree, // LCL InterfaceBase, LCLPlatformDef, Dialogs, Forms, Controls, // CodeTools diff --git a/ide/buildprojectdlg.pas b/ide/buildprojectdlg.pas index 01c7a97a43..f1354c33eb 100644 --- a/ide/buildprojectdlg.pas +++ b/ide/buildprojectdlg.pas @@ -28,7 +28,7 @@ unit BuildProjectDlg; interface uses - Classes, SysUtils, Math, Laz_AVL_Tree, + Classes, SysUtils, Math, AVL_Tree, // LCL Forms, Controls, Dialogs, ButtonPanel, StdCtrls, ComCtrls, Masks, LCLIntf, // LazUtils diff --git a/ide/checkcompileropts.pas b/ide/checkcompileropts.pas index f4d1ec29b5..841728d78d 100644 --- a/ide/checkcompileropts.pas +++ b/ide/checkcompileropts.pas @@ -32,7 +32,7 @@ unit CheckCompilerOpts; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Forms, Controls, Dialogs, Clipbrd, StdCtrls, Menus, ExtCtrls, ButtonPanel, ComCtrls, // LazUtils diff --git a/ide/codebrowser.pas b/ide/codebrowser.pas index a226bbee05..80d23f3a5b 100644 --- a/ide/codebrowser.pas +++ b/ide/codebrowser.pas @@ -47,7 +47,7 @@ interface uses // RTL + FCL - Classes, SysUtils, Types, Laz_AVL_Tree, + Classes, SysUtils, Types, AVL_Tree, // LCL Forms, Controls, Graphics, Dialogs, Clipbrd, StdCtrls, ExtCtrls, ComCtrls, Buttons, Menus, HelpIntfs, diff --git a/ide/codeexplopts.pas b/ide/codeexplopts.pas index f7fd2ff805..2bea3f6c64 100644 --- a/ide/codeexplopts.pas +++ b/ide/codeexplopts.pas @@ -35,7 +35,7 @@ interface uses // RTL + FCL - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Forms, Controls, Graphics, Dialogs, Buttons, // CodeTools diff --git a/ide/codeexplorer.pas b/ide/codeexplorer.pas index 9543f8dc83..362e681720 100644 --- a/ide/codeexplorer.pas +++ b/ide/codeexplorer.pas @@ -39,7 +39,7 @@ interface uses // RTL+FCL - Classes, SysUtils, types, Laz_AVL_Tree, + Classes, SysUtils, Types, AVL_Tree, // LazUtils LazStringUtils, LazLoggerBase, // LCL diff --git a/ide/codehelp.pas b/ide/codehelp.pas index 7d54b3dacb..2829cd6be1 100644 --- a/ide/codehelp.pas +++ b/ide/codehelp.pas @@ -40,7 +40,7 @@ interface uses // RTL + FCL - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Forms, Controls, Dialogs, // CodeTools diff --git a/ide/codetoolsdefpreview.pas b/ide/codetoolsdefpreview.pas index 7e70622f3c..362c38d5db 100644 --- a/ide/codetoolsdefpreview.pas +++ b/ide/codetoolsdefpreview.pas @@ -30,7 +30,7 @@ unit CodeToolsDefPreview; interface uses - Classes, SysUtils, Math, Laz_AVL_Tree, + Classes, SysUtils, Math, AVL_Tree, // LCL Forms, Dialogs, ButtonPanel, StdCtrls, ComCtrls, ExtCtrls, // LazUtils diff --git a/ide/compileroptions.pp b/ide/compileroptions.pp index b2d404e4e6..ca8b210274 100644 --- a/ide/compileroptions.pp +++ b/ide/compileroptions.pp @@ -42,7 +42,7 @@ unit CompilerOptions; interface uses - Classes, SysUtils, Laz_AVL_Tree, System.UITypes, + Classes, SysUtils, AVL_Tree, System.UITypes, // LazUtils FileUtil, LazFileUtils, LazUTF8, Laz2_XMLCfg, Laz2_DOM, LazUtilities, LazTracer, LazStringUtils, FPCAdds, LazVersion, diff --git a/ide/componentpalette.pas b/ide/componentpalette.pas index dd9b91f54a..d979358823 100644 --- a/ide/componentpalette.pas +++ b/ide/componentpalette.pas @@ -38,7 +38,7 @@ unit ComponentPalette; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Controls, Forms, Graphics, ComCtrls, Buttons, Menus, ExtCtrls, ImgList, // LazUtils diff --git a/ide/customformeditor.pp b/ide/customformeditor.pp index 6f721089f2..b175b4b0ac 100644 --- a/ide/customformeditor.pp +++ b/ide/customformeditor.pp @@ -39,7 +39,7 @@ uses MemCheck, {$ENDIF} // RTL+FCL - Classes, SysUtils, TypInfo, Math, Laz_AVL_Tree, + Classes, SysUtils, TypInfo, Math, AVL_Tree, // LCL LCLIntf, LCLType, LResources, LCLMemManager, Controls, Graphics, Forms, Menus, Dialogs, diff --git a/ide/etmessageframe.pas b/ide/etmessageframe.pas index f0d9414cf9..db8687d9ec 100644 --- a/ide/etmessageframe.pas +++ b/ide/etmessageframe.pas @@ -32,7 +32,7 @@ unit etMessageFrame; interface uses - Math, StrUtils, Classes, SysUtils, Laz_AVL_Tree, + Math, StrUtils, Classes, SysUtils, AVL_Tree, // LCL Forms, Buttons, ExtCtrls, Controls, LMessages, LCLType, LCLIntf, Graphics, Themes, ImgList, Menus, Clipbrd, Dialogs, StdCtrls, diff --git a/ide/etquickfixes.pas b/ide/etquickfixes.pas index b172ded2b5..69ff5c65b4 100644 --- a/ide/etquickfixes.pas +++ b/ide/etquickfixes.pas @@ -53,7 +53,7 @@ unit etQuickFixes; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Menus, Dialogs, Controls, // LazUtils diff --git a/ide/etsrceditmarks.pas b/ide/etsrceditmarks.pas index 11286226d5..8b0f668c9a 100644 --- a/ide/etsrceditmarks.pas +++ b/ide/etsrceditmarks.pas @@ -32,7 +32,7 @@ unit etSrcEditMarks; interface uses - Classes, SysUtils, math, Laz_AVL_Tree, + Classes, SysUtils, Math, AVL_Tree, // LCL Graphics, Controls, Forms, ImgList, // LazUtils diff --git a/ide/extractprocdlg.pas b/ide/extractprocdlg.pas index dd89924b60..e856129fd7 100644 --- a/ide/extractprocdlg.pas +++ b/ide/extractprocdlg.pas @@ -32,7 +32,7 @@ unit ExtractProcDlg; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Forms, Controls, Dialogs, ExtCtrls, StdCtrls, ButtonPanel, LCLProc, // LazUtils diff --git a/ide/exttools.pas b/ide/exttools.pas index 01bdb7e012..66092065bb 100644 --- a/ide/exttools.pas +++ b/ide/exttools.pas @@ -35,7 +35,7 @@ interface uses // RTL + FCL - Classes, SysUtils, math, process, Pipes, Laz_AVL_Tree, System.UITypes, + Classes, SysUtils, math, process, Pipes, AVL_Tree, System.UITypes, // LazUtils FileUtil, LazFileUtils, LazUtilities, LazLoggerBase, UTF8Process, LazUTF8, AvgLvlTree, diff --git a/ide/findoverloadsdlg.pas b/ide/findoverloadsdlg.pas index 4f5882ab90..8c6dc028f3 100644 --- a/ide/findoverloadsdlg.pas +++ b/ide/findoverloadsdlg.pas @@ -37,7 +37,7 @@ unit FindOverloadsDlg; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Forms, Controls, StdCtrls, ButtonPanel, ComCtrls, // LazUtils diff --git a/ide/findrenameidentifier.pas b/ide/findrenameidentifier.pas index 0bf5ec5735..c25d8be7dd 100644 --- a/ide/findrenameidentifier.pas +++ b/ide/findrenameidentifier.pas @@ -31,7 +31,7 @@ interface uses // RTL + FCL - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Forms, Controls, Dialogs, StdCtrls, ExtCtrls, ComCtrls, ButtonPanel, LclIntf, // CodeTools diff --git a/ide/fpdocselectlink.pas b/ide/fpdocselectlink.pas index 3a0ebd6bdf..75a5ffcadb 100644 --- a/ide/fpdocselectlink.pas +++ b/ide/fpdocselectlink.pas @@ -30,7 +30,7 @@ unit FPDocSelectLink; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL LCLType, Forms, Controls, Graphics, ExtCtrls, StdCtrls, ButtonPanel, // LazUtils diff --git a/ide/frames/compiler_other_options.pas b/ide/frames/compiler_other_options.pas index 101dbb384e..de6e54c12d 100644 --- a/ide/frames/compiler_other_options.pas +++ b/ide/frames/compiler_other_options.pas @@ -28,7 +28,7 @@ unit Compiler_Other_Options; interface uses - Classes, SysUtils, math, Laz_AVL_Tree, + Classes, SysUtils, Math, AVL_Tree, // LCL Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls, ExtCtrls, Buttons, LCLType, // LazUtils diff --git a/ide/idehelpmanager.pas b/ide/idehelpmanager.pas index 03716a0314..e5ce026333 100644 --- a/ide/idehelpmanager.pas +++ b/ide/idehelpmanager.pas @@ -33,7 +33,7 @@ interface uses // RTL + FCL - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL LCLIntf, LCLType, FileProcs, Forms, Controls, ComCtrls, StdCtrls, Dialogs, Graphics, Buttons, ButtonPanel, LazHelpHTML, HelpIntfs, diff --git a/ide/ideinfoneedbuild.pas b/ide/ideinfoneedbuild.pas index bacb6ff446..7b1dad25ae 100644 --- a/ide/ideinfoneedbuild.pas +++ b/ide/ideinfoneedbuild.pas @@ -30,7 +30,7 @@ unit IDEInfoNeedBuild; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Forms, Controls, StdCtrls, ButtonPanel, LCLType, // LazUtils diff --git a/ide/ideprocs.pp b/ide/ideprocs.pp index 676da83511..057886d9d4 100644 --- a/ide/ideprocs.pp +++ b/ide/ideprocs.pp @@ -31,7 +31,7 @@ interface uses // RTL - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LazUtils FileUtil, LazFileUtils, LazUtilities, LazFileCache, LazUTF8, Laz2_XMLCfg, LazLoggerBase, LazTracer, diff --git a/ide/inputhistory.pas b/ide/inputhistory.pas index 81ccef376c..c9ca7a7ffa 100644 --- a/ide/inputhistory.pas +++ b/ide/inputhistory.pas @@ -37,7 +37,7 @@ interface uses // RTL + LCL - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Dialogs, // LazUtils diff --git a/ide/keymapping.pp b/ide/keymapping.pp index ed3ca87446..fa8687877a 100644 --- a/ide/keymapping.pp +++ b/ide/keymapping.pp @@ -32,7 +32,7 @@ unit KeyMapping; interface uses - Classes, SysUtils, contnrs, Laz_AVL_Tree, + Classes, SysUtils, Contnrs, AVL_Tree, // LCL Forms, LCLType, LCLProc, // LazUtils diff --git a/ide/lfmunitresource.pas b/ide/lfmunitresource.pas index e497d16406..d62dae72fd 100644 --- a/ide/lfmunitresource.pas +++ b/ide/lfmunitresource.pas @@ -30,7 +30,7 @@ unit lfmUnitResource; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Forms, // LazUtils diff --git a/ide/main.pp b/ide/main.pp index a42367a70f..00cc05028a 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -59,7 +59,7 @@ uses MemCheck, {$ENDIF} // fpc packages - Math, Classes, SysUtils, TypInfo, types, strutils, Contnrs, process, Laz_AVL_Tree, + Math, Classes, SysUtils, TypInfo, Types, StrUtils, Contnrs, process, AVL_Tree, // LCL LCLProc, LCLType, LCLIntf, LResources, HelpIntfs, InterfaceBase, LCLPlatformDef, ComCtrls, Forms, Buttons, Menus, Controls, Graphics, ExtCtrls, Dialogs, LclStrConsts, diff --git a/ide/packages/ideconfig/idexmlconfigprocs.pas b/ide/packages/ideconfig/idexmlconfigprocs.pas index 08696b57c1..565e5df7aa 100644 --- a/ide/packages/ideconfig/idexmlconfigprocs.pas +++ b/ide/packages/ideconfig/idexmlconfigprocs.pas @@ -5,7 +5,7 @@ unit IdeXmlConfigProcs; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LazUtils Laz2_XMLCfg, AvgLvlTree; diff --git a/ide/packages/idedebugger/inputhistorycopy.pas b/ide/packages/idedebugger/inputhistorycopy.pas index 2714566f1f..5461dfbd70 100644 --- a/ide/packages/idedebugger/inputhistorycopy.pas +++ b/ide/packages/idedebugger/inputhistorycopy.pas @@ -34,7 +34,7 @@ interface uses // RTL + LCL - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Dialogs, // LazUtils diff --git a/ide/projectresources.pas b/ide/projectresources.pas index fd1a09aca7..05a5da2004 100644 --- a/ide/projectresources.pas +++ b/ide/projectresources.pas @@ -37,7 +37,7 @@ unit ProjectResources; interface uses - Classes, SysUtils, resource, reswriter, fgl, Laz_AVL_Tree, + Classes, SysUtils, resource, reswriter, fgl, AVL_Tree, // LCL Controls, LResources, // LazUtils diff --git a/ide/searchresultview.pp b/ide/searchresultview.pp index 972d3e89aa..7fc269d470 100644 --- a/ide/searchresultview.pp +++ b/ide/searchresultview.pp @@ -37,7 +37,7 @@ unit SearchResultView; interface uses - Classes, SysUtils, Math, StrUtils, Laz_AVL_Tree, + Classes, SysUtils, Math, StrUtils, AVL_Tree, // LCL LCLProc, LCLType, Forms, Controls, Graphics, ComCtrls, Menus, Clipbrd, ActnList, ExtCtrls, StdCtrls, Dialogs, LCLIntf, diff --git a/ide/sortselectiondlg.pas b/ide/sortselectiondlg.pas index 6081968d9b..fc0cb0d91e 100644 --- a/ide/sortselectiondlg.pas +++ b/ide/sortselectiondlg.pas @@ -39,7 +39,7 @@ unit SortSelectionDlg; interface uses - SysUtils, Laz_AVL_Tree, + SysUtils, AVL_Tree, // LCL Forms, Controls, StdCtrls, ExtCtrls, ButtonPanel, // LazUtils diff --git a/ide/sourceeditor.pp b/ide/sourceeditor.pp index 7430d24da0..ac535d552a 100644 --- a/ide/sourceeditor.pp +++ b/ide/sourceeditor.pp @@ -44,7 +44,7 @@ uses {$ENDIF} SynEditMouseCmds, // RTL + FCL - Classes, SysUtils, StrUtils, Types, Contnrs, Math, fgl, RegExpr, Laz_AVL_Tree, + Classes, SysUtils, StrUtils, Types, Contnrs, Math, fgl, RegExpr, AVL_Tree, // LCL Controls, Forms, ComCtrls, StdCtrls, Graphics, Dialogs, Extctrls, Menus, LCLProc, LCLType, LCLIntf, ClipBrd, HelpIntfs, Messages, LMessages, diff --git a/ide/sourcefilemanager.pas b/ide/sourcefilemanager.pas index bd5a71efb8..07230350c0 100644 --- a/ide/sourcefilemanager.pas +++ b/ide/sourcefilemanager.pas @@ -32,7 +32,7 @@ unit SourceFileManager; interface uses - Classes, SysUtils, TypInfo, Math, fpjson, Laz_AVL_Tree, + Classes, SysUtils, TypInfo, Math, fpjson, AVL_Tree, // LCL Controls, Forms, Dialogs, LCLIntf, LCLType, LclStrConsts, LResources, LCLMemManager, diff --git a/ide/sourcemarks.pas b/ide/sourcemarks.pas index 269968224b..9c283b6c3c 100644 --- a/ide/sourcemarks.pas +++ b/ide/sourcemarks.pas @@ -38,7 +38,7 @@ unit SourceMarks; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Graphics, Controls, // LazUtils diff --git a/ide/unitdependencies.pas b/ide/unitdependencies.pas index bda5e70a14..bb7168e648 100644 --- a/ide/unitdependencies.pas +++ b/ide/unitdependencies.pas @@ -36,7 +36,7 @@ interface uses // RTL + FCL - Classes, SysUtils, types, math, Laz_AVL_Tree, + Classes, SysUtils, Types, Math, AVL_Tree, // LCL Forms, Controls, ExtCtrls, ComCtrls, StdCtrls, Buttons, Dialogs, Menus, Clipbrd, CheckLst, diff --git a/ide/viewunit_dlg.pp b/ide/viewunit_dlg.pp index 9b11414b39..b167b82bd0 100644 --- a/ide/viewunit_dlg.pp +++ b/ide/viewunit_dlg.pp @@ -40,7 +40,7 @@ unit ViewUnit_Dlg; interface uses - SysUtils, Classes, Laz_AVL_Tree, + SysUtils, Classes, AVL_Tree, // LCL LCLType, LCLIntf, Controls, Forms, Buttons, StdCtrls, ExtCtrls, ButtonPanel, Menus, ComCtrls, diff --git a/lcl/comctrls.pp b/lcl/comctrls.pp index ddfd9037a3..78eadf8f17 100644 --- a/lcl/comctrls.pp +++ b/lcl/comctrls.pp @@ -29,7 +29,7 @@ unit ComCtrls; interface uses - SysUtils, Types, Classes, Math, Laz_AVL_Tree, + SysUtils, Types, Classes, Math, AVL_Tree, // LCL LCLStrConsts, LResources, LCLIntf, LCLType, LCLProc, LMessages, WSLCLClasses, WSReferences, Graphics, ImgList, ActnList, Themes, Menus, diff --git a/lcl/controls.pp b/lcl/controls.pp index 7ed05ac986..8b2004bb16 100644 --- a/lcl/controls.pp +++ b/lcl/controls.pp @@ -37,7 +37,7 @@ interface {$INTERFACES CORBA} uses - System.UITypes, Classes, SysUtils, TypInfo, Types, Laz_AVL_Tree, + System.UITypes, Classes, SysUtils, TypInfo, Types, AVL_Tree, // LCL LCLStrConsts, LCLType, LCLProc, Graphics, LMessages, LCLIntf, InterfaceBase, ImgList, PropertyStorage, Menus, ActnList, LCLClasses, LResources, LCLPlatformDef, diff --git a/lcl/graphics.pp b/lcl/graphics.pp index b4ffc0487f..e30c28b00b 100644 --- a/lcl/graphics.pp +++ b/lcl/graphics.pp @@ -31,7 +31,7 @@ interface uses // RTL + FCL - SysUtils, Math, Types, Classes, Contnrs, Laz_AVL_Tree, + SysUtils, Math, Types, Classes, Contnrs, AVL_Tree, FPImage, FPCanvas, FPWriteBMP, // bmp support FPWritePNG, PNGComn, // png support diff --git a/lcl/imglist.pp b/lcl/imglist.pp index 3f4884db84..10abc11353 100644 --- a/lcl/imglist.pp +++ b/lcl/imglist.pp @@ -46,7 +46,7 @@ interface uses // RTL + FCL - Types, math, SysUtils, Classes, RtlConsts, Contnrs, zstream, Laz_AVL_Tree, + Types, Math, SysUtils, Classes, RtlConsts, Contnrs, ZStream, AVL_Tree, FPReadBMP, FPimage, FPImgCanv, FPCanvas, // LCL LCLStrConsts, LCLIntf, LResources, LCLType, LCLProc, LCLClasses, diff --git a/lcl/interfaces/carbon/carbondef.pp b/lcl/interfaces/carbon/carbondef.pp index fc0840aa27..58ccc41c2b 100644 --- a/lcl/interfaces/carbon/carbondef.pp +++ b/lcl/interfaces/carbon/carbondef.pp @@ -29,8 +29,7 @@ interface uses // libs MacOSAll, - Classes, SysUtils, Controls, - Laz_AVL_Tree, + Classes, SysUtils, Controls, AVL_Tree, // lcl LCLType, LCLProc, Graphics, Contnrs, LMessages, LCLMessageGlue, LazLoggerBase, diff --git a/lcl/interfaces/gtk/gtkfontcache.pas b/lcl/interfaces/gtk/gtkfontcache.pas index 15a74984fb..395c409426 100644 --- a/lcl/interfaces/gtk/gtkfontcache.pas +++ b/lcl/interfaces/gtk/gtkfontcache.pas @@ -13,7 +13,7 @@ unit GtkFontCache; interface uses - Classes, SysUtils, FPCAdds, LCLProc, LCLType, Laz_AVL_Tree, gtkdef, + Classes, SysUtils, FPCAdds, LCLProc, LCLType, AVL_Tree, gtkdef, {$IFDEF Gtk1} gdk, {$ELSE} diff --git a/lcl/interfaces/gtk2/gtk2fontcache.pas b/lcl/interfaces/gtk2/gtk2fontcache.pas index 97fa2b9314..05065df658 100644 --- a/lcl/interfaces/gtk2/gtk2fontcache.pas +++ b/lcl/interfaces/gtk2/gtk2fontcache.pas @@ -14,7 +14,7 @@ interface uses // RTL - Classes, SysUtils, glib2, pango, Laz_AVL_Tree, + Classes, SysUtils, glib2, pango, AVL_Tree, // LazUtils LazUtilities, LazLoggerBase, LazTracer, // LCL diff --git a/lcl/interfaces/gtk3/gtk3widgets.pas b/lcl/interfaces/gtk3/gtk3widgets.pas index c233c2d8bc..4af623d02b 100644 --- a/lcl/interfaces/gtk3/gtk3widgets.pas +++ b/lcl/interfaces/gtk3/gtk3widgets.pas @@ -4728,7 +4728,7 @@ begin begin GetContainerWidget^.get_allocation(@AAlloc); Result := RectFromGtkAllocation(AAlloc); - OffsetRect(Result, -Result.Left, -Result.Top); + Types.OffsetRect(Result, -Result.Left, -Result.Top); end else begin ACurrentPage := PGtkNoteBook(GetContainerWidget)^.get_current_page; @@ -4740,7 +4740,7 @@ begin else GetContainerWidget^.get_allocation(@AAlloc); Result := RectFromGtkAllocation(AAlloc); - OffsetRect(Result, -Result.Left, -Result.Top); + Types.OffsetRect(Result, -Result.Left, -Result.Top); end; end; // DebugLn('TGtk3NoteBook.getClientRect Result ',dbgs(Result)); diff --git a/lcl/intfgraphics.pas b/lcl/intfgraphics.pas index a9f9db3e3d..7e1959560d 100644 --- a/lcl/intfgraphics.pas +++ b/lcl/intfgraphics.pas @@ -32,7 +32,7 @@ uses {$IFNDEF DisableLCLTIFF} FPReadTiff, FPWriteTiff, FPTiffCmn, {$ENDIF} - Laz_AVL_Tree, + AVL_Tree, // LazUtils GraphType, FPCAdds, LazLoggerBase, LazTracer, // LCL diff --git a/lcl/lclproc.pas b/lcl/lclproc.pas index c1645c16d6..12b7be9f9d 100644 --- a/lcl/lclproc.pas +++ b/lcl/lclproc.pas @@ -26,7 +26,7 @@ interface uses {$IFDEF Darwin}MacOSAll, {$ENDIF} - Classes, SysUtils, Math, Types, Laz_AVL_Tree, + Classes, SysUtils, Math, Types, AVL_Tree, // LazUtils LazFileUtils, LazUtilities, LazMethodList, LazUTF8, LazUTF16, LazLoggerBase, LazTracer, GraphMath, diff --git a/lcl/lclrescache.pas b/lcl/lclrescache.pas index 32ee16f152..94a3f9f4ab 100644 --- a/lcl/lclrescache.pas +++ b/lcl/lclrescache.pas @@ -19,7 +19,7 @@ unit LCLResCache; interface uses - Classes, SysUtils, Types, Laz_AVL_Tree, + Classes, SysUtils, Types, AVL_Tree, // LazUtils FPCAdds, LazLoggerBase, LazTracer, // LCL diff --git a/lcl/shellctrls.pas b/lcl/shellctrls.pas index 63943c3760..4328e4cac5 100644 --- a/lcl/shellctrls.pas +++ b/lcl/shellctrls.pas @@ -22,7 +22,7 @@ unit ShellCtrls; interface uses - Classes, SysUtils, Types, Math, Laz_AVL_Tree, + Classes, SysUtils, Types, Math, AVL_Tree, // LCL Forms, Graphics, ComCtrls, LCLStrConsts, // LazUtils diff --git a/packager/addfiletoapackagedlg.pas b/packager/addfiletoapackagedlg.pas index ae601e8386..fa33757d87 100644 --- a/packager/addfiletoapackagedlg.pas +++ b/packager/addfiletoapackagedlg.pas @@ -39,7 +39,7 @@ unit AddFileToAPackageDlg; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Forms, Controls, StdCtrls, Dialogs, ButtonPanel, // LazUtils diff --git a/packager/addpkgdependencydlg.pas b/packager/addpkgdependencydlg.pas index c03b910019..645317af00 100644 --- a/packager/addpkgdependencydlg.pas +++ b/packager/addpkgdependencydlg.pas @@ -5,7 +5,7 @@ unit AddPkgDependencyDlg; interface uses - Classes, SysUtils, Laz_AVL_Tree, fgl, + Classes, SysUtils, AVL_Tree, fgl, // LCL LCLType, LCLIntf, Forms, Controls, Dialogs, StdCtrls, ButtonPanel, Graphics, ExtCtrls, // LazControls diff --git a/packager/addtopackagedlg.pas b/packager/addtopackagedlg.pas index 7046509e78..2ab967f027 100644 --- a/packager/addtopackagedlg.pas +++ b/packager/addtopackagedlg.pas @@ -30,7 +30,7 @@ unit AddToPackageDlg; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL LCLType, Forms, Controls, Buttons, ExtDlgs, StdCtrls, ExtCtrls, Dialogs, ComCtrls, ButtonPanel, diff --git a/packager/cleanpkgdeps.pas b/packager/cleanpkgdeps.pas index 17f46eee8a..d53042854c 100644 --- a/packager/cleanpkgdeps.pas +++ b/packager/cleanpkgdeps.pas @@ -32,7 +32,7 @@ unit CleanPkgDeps; interface uses - Classes, SysUtils, contnrs, Laz_AVL_Tree, + Classes, SysUtils, Contnrs, AVL_Tree, // LCL Forms, Controls, ComCtrls, ExtCtrls, StdCtrls, Buttons, // IdeIntf diff --git a/packager/installpkgsetdlg.pas b/packager/installpkgsetdlg.pas index a3bfb6fee6..ec990ac183 100644 --- a/packager/installpkgsetdlg.pas +++ b/packager/installpkgsetdlg.pas @@ -37,7 +37,7 @@ unit InstallPkgSetDlg; interface uses - Classes, SysUtils, contnrs, Laz_AVL_Tree, + Classes, SysUtils, Contnrs, AVL_Tree, // LCL LCLType, Forms, Controls, Graphics, Dialogs, StdCtrls, Buttons, ExtCtrls, ComCtrls, ImgList, diff --git a/packager/interpkgconflictfiles.pas b/packager/interpkgconflictfiles.pas index e377ea81cc..7ab7718e3f 100644 --- a/packager/interpkgconflictfiles.pas +++ b/packager/interpkgconflictfiles.pas @@ -53,7 +53,7 @@ interface uses // RTL + FCL - Classes, SysUtils, types, math, contnrs, Laz_AVL_Tree, + Classes, SysUtils, Types, Math, Contnrs, AVL_Tree, // LCL Forms, ComCtrls, Controls, ButtonPanel, Themes, Graphics, StdCtrls, Buttons, InterfaceBase, diff --git a/packager/lpkcache.pas b/packager/lpkcache.pas index bd7120a93b..5c8fb47781 100644 --- a/packager/lpkcache.pas +++ b/packager/lpkcache.pas @@ -51,7 +51,7 @@ unit LPKCache; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LazUtils LazFileUtils, Laz2_XMLCfg, LazLoggerBase, LazTracer, LazMethodList, // IdeIntf diff --git a/packager/packagedefs.pas b/packager/packagedefs.pas index 1975e603c4..495be559eb 100644 --- a/packager/packagedefs.pas +++ b/packager/packagedefs.pas @@ -38,7 +38,7 @@ interface uses // FCL - Classes, SysUtils, Contnrs, TypInfo, Laz_AVL_Tree, + Classes, SysUtils, Contnrs, TypInfo, AVL_Tree, System.UITypes, // LCL Forms, ImgList, diff --git a/packager/packagelinks.pas b/packager/packagelinks.pas index 5e15499f95..b0933ef0b5 100644 --- a/packager/packagelinks.pas +++ b/packager/packagelinks.pas @@ -39,7 +39,7 @@ unit PackageLinks; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Forms, // LazUtils diff --git a/packager/packagesystem.pas b/packager/packagesystem.pas index 4922cec6be..577ad7253d 100644 --- a/packager/packagesystem.pas +++ b/packager/packagesystem.pas @@ -45,7 +45,7 @@ uses MemCheck, {$ENDIF} // FPC - Classes, SysUtils, contnrs, strutils, Laz_AVL_Tree, fpmkunit, + Classes, SysUtils, Contnrs, StrUtils, AVL_Tree, fpmkunit, // LCL Forms, Controls, Dialogs, LCLProc, // LazUtils diff --git a/packager/pkggraphexplorer.pas b/packager/pkggraphexplorer.pas index 702fae3054..cfab4f289d 100644 --- a/packager/pkggraphexplorer.pas +++ b/packager/pkggraphexplorer.pas @@ -37,7 +37,7 @@ unit PkgGraphExplorer; interface uses - Classes, SysUtils, contnrs, Laz_AVL_Tree, + Classes, SysUtils, Contnrs, AVL_Tree, // LCL LCLType, LCLIntf, Forms, Controls, ComCtrls, StdCtrls, ExtCtrls, Menus, ButtonPanel, diff --git a/packager/pkglinksdlg.pas b/packager/pkglinksdlg.pas index 194d9d7d11..ec8cd60809 100644 --- a/packager/pkglinksdlg.pas +++ b/packager/pkglinksdlg.pas @@ -37,7 +37,7 @@ unit PkgLinksDlg; interface uses - Classes, SysUtils, Laz_AVL_Tree, + Classes, SysUtils, AVL_Tree, // LCL Forms, Controls, StdCtrls, Buttons, Grids, ExtCtrls, ComCtrls, Menus, Dialogs, // Codetools diff --git a/packager/pkgmanager.pas b/packager/pkgmanager.pas index 166ee27c2a..4656756491 100644 --- a/packager/pkgmanager.pas +++ b/packager/pkgmanager.pas @@ -47,7 +47,7 @@ uses MemCheck, {$ENDIF} // RTL, FCL - TypInfo, math, Classes, SysUtils, contnrs, Laz_AVL_Tree, + TypInfo, Math, Classes, SysUtils, Contnrs, AVL_Tree, // LCL Forms, Controls, Dialogs, Menus, ComCtrls, LResources, // LazUtils diff --git a/test/lazutils/testavglvltree.pas b/test/lazutils/testavglvltree.pas index f82ab89306..c4c8239d1d 100644 --- a/test/lazutils/testavglvltree.pas +++ b/test/lazutils/testavglvltree.pas @@ -19,7 +19,6 @@ interface uses Classes, SysUtils, fpcunit, testglobals, LazLogger, AVL_Tree, // the unit from FPC - // Laz_AVL_Tree, the unit copied from FPC when compiling Lazarus for older compilers AvgLvlTree // unit from LazUtils, an extended version ;