diff --git a/.gitattributes b/.gitattributes
index 2eff0d6415..c41111c83f 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2858,13 +2858,7 @@ components/lazutils/Makefile.fpc svneol=native#text/plain
components/lazutils/asiancodepagefunctions.inc svneol=native#text/pascal
components/lazutils/asiancodepages.inc svneol=native#text/pascal
components/lazutils/avglvltree.pas svneol=native#text/pascal
-components/lazutils/dictionarystringlist.pas svneol=native#text/plain
components/lazutils/easylazfreetype.pas svneol=native#text/pascal
-components/lazutils/examples/DictionaryStringList/ReadMe.txt svneol=native#text/plain
-components/lazutils/examples/DictionaryStringList/TDictionaryStringListDemo.lpi svneol=native#text/plain
-components/lazutils/examples/DictionaryStringList/TDictionaryStringListDemo.lpr svneol=native#text/plain
-components/lazutils/examples/DictionaryStringList/main.lfm svneol=native#text/plain
-components/lazutils/examples/DictionaryStringList/main.pas svneol=native#text/plain
components/lazutils/examples/LookupStringList/ReadMe.txt svneol=native#text/plain
components/lazutils/examples/LookupStringList/TDedupeDemo.lpi svneol=native#text/plain
components/lazutils/examples/LookupStringList/TDedupeDemo.lpr svneol=native#text/pascal
@@ -4531,7 +4525,6 @@ docs/xml/README.txt svneol=native#text/plain
docs/xml/StyleGuide.txt svneol=native#text/plain
docs/xml/ide/aboutfrm.xml svneol=native#text/plain
docs/xml/lazutils/avglvltree.xml svneol=native#text/plain
-docs/xml/lazutils/dictionarystringlist.xml svneol=native#text/plain
docs/xml/lazutils/easylazfreetype.xml svneol=native#text/plain
docs/xml/lazutils/fileutil.xml svneol=native#text/plain
docs/xml/lazutils/fpcadds.xml svneol=LF#text/xml eol=lf
diff --git a/components/lazutils/dictionarystringlist.pas b/components/lazutils/dictionarystringlist.pas
deleted file mode 100644
index 93e7a7a3b6..0000000000
--- a/components/lazutils/dictionarystringlist.pas
+++ /dev/null
@@ -1,167 +0,0 @@
-{
- *****************************************************************************
- This file is part of the Lazarus Component Library (LCL)
-
- See the file COPYING.modifiedLGPL.txt, included in this distribution,
- for details about the license.
- *****************************************************************************
-
- Author: Juha Manninen / Antônio Galvão
-
- Abstract:
- This is an unsorted StringList with a fast lookup feature.
- Internally it uses a map container to store the strings again
- which is then used for Contains, IndexOf and Find methods.
-
- The extra container does not reserve too much memory because the strings are
- reference counted and not really copied.
-
- All Duplicates property values are fully supported,
- including dupIgnore and dupError, unlike in unsorted StringList.
-
- This class is useful only when you must preserve the order in list, but
- also need to do fast lookups to see if a string exists, or must prevent duplicates.
-}
-unit DictionaryStringList;
-
-{$mode objfpc}{$H+}
-
-interface
-
-uses
- Classes, SysUtils, AvgLvlTree;
-
-type
-
- { TDictionaryStringList }
-
- TDictionaryStringList = class(TStringList)
- private
- FMap: TStringMap;
- protected
- procedure InsertItem(Index: Integer; const S: string); override;
- public
- constructor Create;
- destructor Destroy; override;
- procedure Assign(Source: TPersistent); override;
- procedure Clear; override;
- procedure Delete(Index: Integer); override;
- function Add(const S: string): Integer; override;
- function AddObject(const S: string; AObject: TObject): Integer; override;
- function Contains(const S: string): Boolean; // A new function
- function Find(const S: string; out Index: Integer): Boolean; override;
- function IndexOf(const S: string): Integer; override;
- end;
-
-function Deduplicate(AStrings: TStrings): Boolean;
-
-implementation
-
-{
- Removes duplicate strings (case sensitive) from AStrings.
- When the AStrings owns and contains objects, the function will return false.
-}
-function Deduplicate(AStrings: TStrings): Boolean;
-var
- i: Integer;
- DSL: TDictionaryStringList;
-begin
- Result := False;
- DSL := TDictionaryStringList.Create;
- try
- DSL.Assign(AStrings);
- AStrings.Assign(DSL);
- Result := True;
- finally
- DSL.Free;
- end;
-end;
-
-{ TDictionaryStringList }
-
-constructor TDictionaryStringList.Create;
-begin
- inherited Create;
- FMap := TStringMap.Create(True);
-end;
-
-destructor TDictionaryStringList.Destroy;
-begin
- FMap.Free;
- inherited Destroy;
-end;
-
-procedure TDictionaryStringList.Assign(Source: TPersistent);
-begin
- inherited Assign(Source);
- if Source is TDictionaryStringList then
- FMap.Assign(TDictionaryStringList(Source).FMap);
-end;
-
-procedure TDictionaryStringList.Clear;
-begin
- inherited Clear;
- FMap.Clear;
-end;
-
-procedure TDictionaryStringList.Delete(Index: Integer);
-var
- s: String;
-begin
- s := Strings[Index];
- inherited Delete(Index);
- // The string must not be deleted from map if there are duplicates.
- // Calling IndexOf is slow but it is needed.
- if (Duplicates <> dupAccept) or (inherited IndexOf(s) = -1) then
- FMap.Remove(s);
-end;
-
-function TDictionaryStringList.Add(const S: string): Integer;
-begin
- if not Sorted and (Duplicates = dupIgnore) and FMap.Contains(S) then
- Result := -1
- else
- Result := inherited Add(S);
-end;
-
-function TDictionaryStringList.AddObject(const S: string; AObject: TObject): Integer;
-begin
- Result := Add(S);
- if Result > -1 then
- Objects[Result] := AObject;
-end;
-
-procedure TDictionaryStringList.InsertItem(Index: Integer; const S: string);
-begin
- if not Sorted and (Duplicates <> dupAccept) then
- if FMap.Contains(S) then
- case Duplicates of
- DupIgnore : Exit;
- DupError : raise Exception.Create('TDictionaryStringList.InsertItem:'
- +' Duplicates are not allowed.');
- end;
- inherited InsertItem(Index, S);
- FMap.Add(S); // Insert string to map, too.
-end;
-
-function TDictionaryStringList.Contains(const S: string): Boolean;
-begin
- Result := FMap.Contains(S);
-end;
-
-function TDictionaryStringList.Find(const S: string; out Index: Integer): Boolean;
-begin
- Index := IndexOf(S);
- Result := Index <> -1;
-end;
-
-function TDictionaryStringList.IndexOf(const S: string): Integer;
-begin
- if FMap.Contains(S) then
- Result := inherited IndexOf(S)
- else
- Result := -1
-end;
-
-end.
-
diff --git a/components/lazutils/examples/DictionaryStringList/ReadMe.txt b/components/lazutils/examples/DictionaryStringList/ReadMe.txt
deleted file mode 100644
index 7ea08fb942..0000000000
--- a/components/lazutils/examples/DictionaryStringList/ReadMe.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Demonstrate how TDictionaryStringList can quicly remove duplicates from a list without changing the order.
-
-Author: Antônio Galvão
diff --git a/components/lazutils/examples/DictionaryStringList/TDictionaryStringListDemo.lpi b/components/lazutils/examples/DictionaryStringList/TDictionaryStringListDemo.lpi
deleted file mode 100644
index 61f82933ff..0000000000
--- a/components/lazutils/examples/DictionaryStringList/TDictionaryStringListDemo.lpi
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/components/lazutils/examples/DictionaryStringList/TDictionaryStringListDemo.lpr b/components/lazutils/examples/DictionaryStringList/TDictionaryStringListDemo.lpr
deleted file mode 100644
index b9fc467a19..0000000000
--- a/components/lazutils/examples/DictionaryStringList/TDictionaryStringListDemo.lpr
+++ /dev/null
@@ -1,20 +0,0 @@
-program TDictionaryStringListDemo;
-
-{$mode objfpc}{$H+}
-
-uses
- {$IFDEF UNIX}{$IFDEF UseCThreads}
- cthreads,
- {$ENDIF}{$ENDIF}
- Interfaces, // this includes the LCL widgetset
- Forms, Main;
-
-{$R *.res}
-
-begin
- RequireDerivedFormResource := True;
- Application.Initialize;
- Application.CreateForm(TForm1, Form1);
- Application.Run;
-end.
-
diff --git a/components/lazutils/examples/DictionaryStringList/main.lfm b/components/lazutils/examples/DictionaryStringList/main.lfm
deleted file mode 100644
index 1d06b44c53..0000000000
--- a/components/lazutils/examples/DictionaryStringList/main.lfm
+++ /dev/null
@@ -1,90 +0,0 @@
-object Form1: TForm1
- Left = 353
- Height = 353
- Top = 194
- Width = 535
- BorderStyle = bsSingle
- Caption = 'TDictionaryStringList Demo'
- ClientHeight = 353
- ClientWidth = 535
- OnCreate = FormCreate
- OnDestroy = FormDestroy
- OnShow = FormShow
- Position = poScreenCenter
- LCLVersion = '1.4.0.4'
- object btnDedupeMemo: TButton
- Left = 346
- Height = 25
- Top = 72
- Width = 183
- Anchors = [akTop, akRight]
- Caption = 'Dedupe Memo'
- OnClick = btnDedupeMemoClick
- TabOrder = 0
- end
- object Memo: TMemo
- Left = 0
- Height = 281
- Top = 72
- Width = 336
- ScrollBars = ssAutoBoth
- TabOrder = 1
- end
- object lblTime: TLabel
- Left = 16
- Height = 15
- Top = 48
- Width = 30
- Caption = 'Time:'
- ParentColor = False
- end
- object lblLines: TLabel
- Left = 130
- Height = 15
- Top = 48
- Width = 90
- Caption = 'Duplicated Lines:'
- ParentColor = False
- end
- object SpinEdit1: TSpinEdit
- Left = 8
- Height = 23
- Top = 8
- Width = 94
- Increment = 1000
- MaxValue = 1000000000
- TabOrder = 2
- end
- object btnGenerate: TButton
- Left = 112
- Height = 25
- Top = 8
- Width = 125
- Caption = 'Generate Data'
- OnClick = btnGenerateClick
- TabOrder = 3
- end
- object btnDedupeFile: TButton
- AnchorSideLeft.Control = btnDedupeMemo
- AnchorSideRight.Control = btnDedupeMemo
- AnchorSideRight.Side = asrBottom
- Left = 346
- Height = 32
- Top = 232
- Width = 183
- Anchors = [akTop, akLeft, akRight]
- Caption = 'Create File and Dedupe it'
- OnClick = btnDedupeFileClick
- TabOrder = 4
- end
- object Label1: TLabel
- Left = 346
- Height = 64
- Top = 168
- Width = 182
- AutoSize = False
- Caption = 'Deduplicating from a file is very much faster than using a GUI control. Use the button below to see the whole process.'
- ParentColor = False
- WordWrap = True
- end
-end
diff --git a/components/lazutils/examples/DictionaryStringList/main.pas b/components/lazutils/examples/DictionaryStringList/main.pas
deleted file mode 100644
index 9519c1516c..0000000000
--- a/components/lazutils/examples/DictionaryStringList/main.pas
+++ /dev/null
@@ -1,154 +0,0 @@
-unit Main;
-
-{$mode objfpc}{$H+}
-
-interface
-
-uses
- Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
- Spin, DictionaryStringList, Math;
-
-type
-
- { TForm1 }
-
- TForm1 = class(TForm)
- btnDedupeMemo: TButton;
- btnDedupeFile: TButton;
- btnGenerate: TButton;
- Label1 :TLabel;
- lblLines: TLabel;
- lblTime: TLabel;
- Memo: TMemo;
- SpinEdit1: TSpinEdit;
- procedure btnDedupeFileClick(Sender: TObject);
- procedure btnGenerateClick(Sender: TObject);
- procedure btnDedupeMemoClick(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure FormDestroy(Sender: TObject);
- procedure FormShow(Sender: TObject);
- private
- inList :TStringList;
- procedure UpdateDuplicates(aDuplicateCount: string);
- procedure UpdateTime(aTime: TDateTime);
- public
-
- end;
-
-var
- Form1: TForm1;
-
-implementation
-
-{$R *.lfm}
-
-{ TForm1 }
-
-procedure TForm1.UpdateDuplicates(aDuplicateCount: string);
-begin
- lblLines.Caption := 'Duplicated Lines: ' + aDuplicateCount;
-end;
-
-procedure TForm1.UpdateTime(aTime: TDateTime);
-begin
- lblTime.Caption := 'Time: ' + TimeToStr(aTime);
-end;
-
-procedure TForm1.btnGenerateClick(Sender: TObject);
-var
- i, j: Integer;
- s :string;
-begin
- UpdateDuplicates('?');
- UpdateTime(0);
- Memo.Clear;
- Application.ProcessMessages;
- Screen.Cursor := crHourGlass;
- try
- InList.Clear;
- for i := 0 to SpinEdit1.Value - 1 do
- begin
- s := '';
- for j := 0 to 5 do
- s := s + chr(randomrange(97, 123));
- InList.Add(s);
- end;
- Memo.Lines.Assign(inList);
- finally
- Screen.Cursor := crDefault;
- end;
-end;
-
-procedure TForm1.btnDedupeMemoClick(Sender: TObject);
-var
- DSL :TDictionaryStringList;
- T :TDateTime;
-begin
- Screen.Cursor := crHourGlass;
- try
- T := Now;
- DSL := TDictionaryStringList.Create;
- try
- DSL.Assign(Memo.Lines);
- UpdateDuplicates(IntToStr(Memo.Lines.Count - DSL.Count));
- Memo.Lines.Assign(DSL);
- finally
- DSL.Free;
- end;
- UpdateTime(Now - T);
- finally
- Screen.Cursor := crDefault;
- end;
-end;
-
-procedure TForm1.btnDedupeFileClick(Sender: TObject);
-var
- T :TDateTime;
- N :integer;
- DSL :TDictionaryStringList;
-begin
- lblTime.Caption := 'Time:';
- lblLines.Caption := 'Duplicated lines:';
- Application.ProcessMessages;
-
- if Trim(Memo.Text) = '' then
- begin
- ShowMessage('Generating data. Please wait.');
- btnGenerateClick(nil);
- end;
-
- ShowMessage('Saving memo to a file. Please wait.');
- Memo.Lines.SaveToFile('temp.txt');
- ShowMessage('Dedupping the file.');
- T := Now;
- N := Memo.Lines.Count;
- DSL := TDictionaryStringList.Create;
- try
- DSL.LoadFromFile('temp.txt');
- lblLines.Caption := 'Duplicated Lines: ' + IntToStr(N - DSL.Count);
- DSL.SaveToFile('temp.txt');
- lblTime.Caption := 'Time: ' + TimeToStr(Now - T);
- ShowMessage('Deleting the file.');
- DeleteFile('temp.txt');
- finally
- DSL.Free;
- end;
-end;
-
-procedure TForm1.FormCreate(Sender: TObject);
-begin
- inList := TStringList.Create;
- Randomize;
-end;
-
-procedure TForm1.FormDestroy(Sender: TObject);
-begin
- inList.Free;
-end;
-
-procedure TForm1.FormShow(Sender: TObject);
-begin
- spinedit1.Value := 100000;
-end;
-
-end.
diff --git a/components/lazutils/fpmake.pp b/components/lazutils/fpmake.pp
index 4786c4bb8f..69dec4ac75 100644
--- a/components/lazutils/fpmake.pp
+++ b/components/lazutils/fpmake.pp
@@ -88,7 +88,7 @@ begin
t.Dependencies.AddUnit('lazconfigstorage');
t.Dependencies.AddUnit('utf8process');
t.Dependencies.AddUnit('laz2_xpath');
- t.Dependencies.AddUnit('dictionarystringlist');
+ t.Dependencies.AddUnit('lookupstringlist');
t.Dependencies.AddUnit('lazloggerprofiling');
t.Dependencies.AddUnit('fpcadds');
t.Dependencies.AddUnit('lazutilities');
@@ -142,7 +142,7 @@ begin
T:=P.Targets.AddUnit('lazconfigstorage.pas');
T:=P.Targets.AddUnit('utf8process.pp');
T:=P.Targets.AddUnit('laz2_xpath.pas');
- T:=P.Targets.AddUnit('dictionarystringlist.pas');
+ T:=P.Targets.AddUnit('lookupstringlist.pas');
T:=P.Targets.AddUnit('lazloggerprofiling.pas');
T:=P.Targets.AddUnit('fpcadds.pas');
T:=P.Targets.AddUnit('lazutilities.pas');
diff --git a/components/lazutils/lazutils.lpk b/components/lazutils/lazutils.lpk
index 964c82a51c..06a9a3b155 100644
--- a/components/lazutils/lazutils.lpk
+++ b/components/lazutils/lazutils.lpk
@@ -295,48 +295,48 @@
-
-
+
+
-
+
-
-
-
-
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
diff --git a/components/lazutils/lazutils.pas b/components/lazutils/lazutils.pas
index 35379ff2a4..5e98f120da 100644
--- a/components/lazutils/lazutils.pas
+++ b/components/lazutils/lazutils.pas
@@ -15,9 +15,9 @@ uses
TTDebug, TTError, TTFile, TTGLoad, TTInterp, TTLoad, TTMemory, TTObjs,
TTProfile, TTRASTER, TTTables, TTTypes, EasyLazFreeType, LazLoggerBase,
LazLoggerDummy, LazClasses, LazFreeTypeFontCollection, LazConfigStorage,
- UTF8Process, laz2_xpath, DictionaryStringList, LazLoggerProfiling, FPCAdds,
- LazUtilities, lazfglhash, lcsvutils, lazCollections, LazListClasses,
- LazFreeTypeFPImageDrawer, LazarusPackageIntf;
+ UTF8Process, laz2_xpath, LazLoggerProfiling, FPCAdds, LazUtilities,
+ lazfglhash, lcsvutils, lazCollections, LazListClasses,
+ LazFreeTypeFPImageDrawer, LookupStringList, LazarusPackageIntf;
implementation
diff --git a/docs/xml/lazutils/dictionarystringlist.xml b/docs/xml/lazutils/dictionarystringlist.xml
deleted file mode 100644
index 4e00b3f911..0000000000
--- a/docs/xml/lazutils/dictionarystringlist.xml
+++ /dev/null
@@ -1,245 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-