Components: Use a faster compare method for case-insensitive strings and StringLists.

git-svn-id: trunk@64466 -
This commit is contained in:
juha 2021-02-05 11:28:16 +00:00
parent 0feb7a5662
commit 95b5489cff
30 changed files with 140 additions and 113 deletions

View File

@ -103,7 +103,7 @@ uses
Math, Classes, SysUtils, types, fgl,
LCLType, LCLIntf, LCLProc,
Controls, Forms, ExtCtrls, ComCtrls, Graphics, Themes, Menus, Buttons,
LazConfigStorage, Laz2_XMLCfg, LazFileCache,
LazConfigStorage, Laz2_XMLCfg, LazFileCache, LazUTF8,
AnchorDockStr, AnchorDockStorage, AnchorDockPanel;
{$IFDEF DebugDisableAutoSizing}
@ -2411,10 +2411,10 @@ end;
function TAnchorDockMaster.FullRestoreLayout(Tree: TAnchorDockLayoutTree;
Scale: Boolean): Boolean;
var
ControlNames: TStringList;
ControlNames: TStringListUTF8Fast;
begin
Result:=false;
ControlNames:=TStringList.Create;
ControlNames:=TStringListUTF8Fast.Create;
fTreeNameToDocker:=TADNameToControl.Create;
try
@ -3299,7 +3299,7 @@ var
SavedSites: TFPList;
LayoutNode: TAnchorDockLayoutTreeNode;
AFormOrDockPanel: TWinControl;
VisibleControls: TStringList;
VisibleControls: TStringListUTF8Fast;
procedure SaveFormOrDockPanel(theFormOrDockPanel: TWinControl; SaveChildren: boolean; AMinimized:boolean);
begin
@ -3324,7 +3324,7 @@ var
begin
SavedSites:=TFPList.Create;
VisibleControls:=TStringList.Create;
VisibleControls:=TStringListUTF8Fast.Create;
try
for i:=0 to ControlCount-1 do begin
AControl:=Controls[i];
@ -3424,10 +3424,10 @@ function TAnchorDockMaster.LoadLayoutFromConfig(Config: TConfigStorage;
Scale: Boolean): boolean;
var
Tree: TAnchorDockLayoutTree;
ControlNames: TStringList;
ControlNames: TStringListUTF8Fast;
begin
Result:=false;
ControlNames:=TStringList.Create;
ControlNames:=TStringListUTF8Fast.Create;
fTreeNameToDocker:=TADNameToControl.Create;
Tree:=TAnchorDockLayoutTree.Create;
try

View File

@ -11,7 +11,7 @@ uses
// LCL
LCLProc, Forms, Controls, LCLType, LResources,
// LazUtils
LazFileUtils, LazConfigStorage, Laz2_XMLCfg,
LazFileUtils, LazConfigStorage, Laz2_XMLCfg, LazUTF8,
// IdeIntf
IDEOptionsIntf, LazIDEIntf, BaseIDEIntf,
// AnchorDocking
@ -243,11 +243,11 @@ var
SavedSites: TFPList;
LayoutNode: TAnchorDockLayoutTreeNode;
AForm: TCustomForm;
VisibleControls: TStringList;
VisibleControls: TStringListUTF8Fast;
begin
FTree.Clear;
SavedSites:=TFPList.Create;
VisibleControls:=TStringList.Create;
VisibleControls:=TStringListUTF8Fast.Create;
with DockMaster do
try
for i:=0 to ControlCount-1 do begin

View File

@ -5,7 +5,10 @@ unit idedatadict;
interface
uses
Classes, SysUtils, fpdatadict, LazUTF8, LazIDEIntf, ldd_consts;
Classes, SysUtils, fpdatadict,
LazUTF8,
LazIDEIntf,
ldd_consts;
Type
@ -23,7 +26,7 @@ Type
FDataDict: TFPDatadictionary;
FDictName: String;
FFileName: String;
FKnownDicts : TStringList;
FKnownDicts : TStringListUTF8Fast;
procedure DDProgress(Sender: TObject; const Msg: String);
procedure SetDictName(const AValue: String);
procedure SetFileName(const AValue: String);
@ -220,7 +223,7 @@ end;
constructor TIDEDataDictionary.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FKnownDicts:=TStringList.Create;
FKnownDicts:=TStringListUTF8Fast.Create;
FKnownDicts.Sorted:=True;
Initialize;
end;

View File

@ -36,11 +36,11 @@ interface
uses
Classes, SysUtils,
// LazUtils
FileUtil, LazFileUtils, LazConfigStorage,
// LCL
LCLProc, LResources, Forms, Controls, Graphics, Dialogs, ComCtrls, Buttons, StdCtrls,
LResources, Forms, Controls, Graphics, Dialogs, ComCtrls, Buttons, StdCtrls,
ExtCtrls, ButtonPanel, HelpIntfs,
// LazUtils
FileUtil, LazFileUtils, LazConfigStorage, LazLoggerBase, LazUTF8,
// IdeIntf
LazHelpIntf, PackageIntf, MacroIntf, IDEOptionsIntf, IDEOptEditorIntf,
LazIDEIntf, BaseIDEIntf, IDEDialogs, IDEImagesIntf, SrcEditorIntf;
@ -1092,10 +1092,10 @@ end;
procedure TExternHelpGeneralOptsFrame.FillStoreInCombobox;
var
sl: TStringList;
sl: TStringListUTF8Fast;
i: Integer;
begin
sl:=TStringList.Create;
sl:=TStringListUTF8Fast.Create;
try
for i:=0 to PackageEditingInterface.GetPackageCount-1 do
sl.Add(PackageEditingInterface.GetPackages(i).Name);

View File

@ -34,7 +34,7 @@ uses
// LCL
Graphics, ComCtrls, Menus, ImgList,
// LazUtils
LazFileUtils, Laz2_XMLCfg,
LazFileUtils, Laz2_XMLCfg, LazUTF8,
// IdeIntf
ToolBarIntf, IDEImagesIntf, LazIDEIntf, ProjectIntf, IDEOptionsIntf,
IDECommands, IDEUtils,
@ -45,7 +45,7 @@ type
TFavoritesHandler = class
private
FOldToolButtonClass: TIDEToolButtonClass;
FFavoriteProjects: TStringList;
FFavoriteProjects: TStringListUTF8Fast;
FConfig: TXMLConfig;
procedure AddToRecentProjectFiles(Sender: TObject; AFileName: string;
@ -226,7 +226,7 @@ var
xToolButton: TIDEButtonCommand;
begin
IDEEnvironmentOptions.AddHandlerAddToRecentProjectFiles(@AddToRecentProjectFiles);
FFavoriteProjects := TStringList.Create;
FFavoriteProjects := TStringListUTF8Fast.Create;
FFavoriteProjects.Duplicates := dupIgnore;
FFavoriteProjects.CaseSensitive := False;
FFavoriteProjects.Sorted := True;

View File

@ -5,8 +5,11 @@ unit frmFileBrowser;
interface
uses
Classes, SysUtils, FileUtil, LazFileUtils, LResources, LCLType, Forms, Controls, Graphics,
Dialogs, EditBtn, FileCtrl, ComCtrls, StdCtrls, ExtCtrls;
Classes, SysUtils,
// LCL
LCLType, Forms, Controls, Dialogs, FileCtrl, ComCtrls, StdCtrls, ExtCtrls,
// LazUtils
FileUtil, LazFileUtils, LazUTF8;
type
TOpenFileEvent = procedure(Sender: TObject; const AFileName: string) of object;
@ -223,7 +226,7 @@ var
i: integer;
FCurrentDir: string;
//used to sort the directories.
SortList: TStringList;
SortList: TStringListUTF8Fast;
begin
if Dir <> '' then
begin
@ -235,8 +238,7 @@ begin
if SysUtils.FindFirst(FCurrentDir, faAnyFile or $00000080, FileInfo) = 0 then
begin
try
SortList := TStringList.Create;
SortList.Sorted := True;
SortList := TStringListUTF8Fast.Create;
repeat
// check if special file
if (FileInfo.Name = '.') or (FileInfo.Name = '..') or (FileInfo.Name = '') then
@ -258,6 +260,7 @@ begin
SortList.Add(FileInfo.Name);
end;
until SysUtils.FindNext(FileInfo) <> 0;
SortList.Sorted := True;
for i := 0 to SortList.Count - 1 do
begin
NewNode := TV.Items.AddChild(Node, SortList[i]);

View File

@ -19,13 +19,15 @@ unit frafpreportdata;
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, ComCtrls, StdCtrls, fpreport,
Classes, SysUtils,
FileUtil, LazUTF8,
Forms, Controls, ComCtrls, StdCtrls,
{$ifdef VER3_0}
fprepexprpars,
{$ELSE}
fpexprpars,
{$endif}
fpreportdesignobjectlist;
fpreport, fpreportdesignobjectlist;
type
@ -224,7 +226,7 @@ begin
Clear;
if not Assigned(Report) then
exit;
L:=TStringList.Create;
L:=TStringListUTF8Fast.Create;
For I:=0 to BuiltinIdentifiers.IdentifierCount-1 do
L.AddObject(BuiltinIdentifiers.Identifiers[i].Name,BuiltinIdentifiers.Identifiers[i]);
L.Sort;
@ -296,7 +298,7 @@ begin
try
BeginUpdate;
Clear;
L:=TStringList.Create;
L:=TStringListUTF8Fast.Create;
if not Assigned(Report) then
exit;
For I:=0 to Report.ReportData.Count-1 do
@ -337,7 +339,7 @@ Var
L : TStringList;
begin
L:=TStringList.Create;
L:=TStringListUTF8Fast.Create;
try
For I:=0 to Vars.Count-1 do
L.AddObject(Vars[i].Name,Vars[i]);
@ -372,7 +374,7 @@ begin
FReport.AddBuiltinsToExpressionIdentifiers(FIdentifiers);
if FIdentifiers.FindIdentifier('PageCount')=Nil then
FIdentifiers.AddIntegerVariable('PageCount',-1);
L:=TStringList.Create;
L:=TStringListUTF8Fast.Create;
try
For I:=0 to Fidentifiers.Count-1 do
L.AddObject(Fidentifiers[i].Name,Fidentifiers[i]);

View File

@ -2236,7 +2236,6 @@ end;
procedure TFPReportDesignerForm.SetDesignOptions(AValue: TFPReportDesignOptions);
begin
if FDesignOptions=AValue then Exit;
FDesignOptions:=AValue;

View File

@ -19,9 +19,11 @@ unit fpreportpreview;
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
ComCtrls, ActnList, Buttons, StdCtrls, Menus, fpreport, fpreportlclexport,
fpreportformexport;
Classes, SysUtils,
FileUtil, LazUTF8,
Forms, Controls, Graphics, Dialogs, ExtCtrls,
ComCtrls, ActnList, Buttons, StdCtrls, Menus,
fpreport, fpreportlclexport, fpreportformexport;
type
@ -168,7 +170,7 @@ Var
begin
// Do Export
L:=TstringList.Create;
L:=TStringListUTF8Fast.Create;
try
For I:=0 to PMExport.Items.Count-1 do
L.AddObject(PMExport.Items[I].Caption,PMExport.Items[I]);

View File

@ -15,6 +15,8 @@ interface
uses
Classes, SysUtils, Laz_AVL_Tree,
// LazUtils
LazUTF8,
// FreeType
EasyLazFreeType, LazFreeType, TTTypes;
type
@ -909,14 +911,14 @@ end;
procedure TFreeTypeFontCollection.AddFolder(AFolder: string;
AIncludeSubdirs: Boolean = false);
var
files: TStringList;
files: TStringListUTF8Fast;
i: integer;
begin
AFolder := ExpandFileName(AFolder);
if (length(AFolder) <> 0) and (AFolder[length(AFolder)] <> PathDelim) then
AFolder += PathDelim;
files := TStringList.Create;
files := TStringListUTF8Fast.Create;
BeginUpdate;
try
FindAllFiles(files, AFolder, '*.ttf', AIncludeSubdirs);

View File

@ -2073,7 +2073,7 @@ begin
Tool.CmdLineParams:=AFile.GetH2PasParameters(Tool.TargetFilename);
Tool.WorkingDirectory:=Project.BaseDir;
DebugLn(['TH2PasConverter.ConvertFile Tool.Executable="',Tool.Executable,'" Tool.CmdLineParams="',Tool.CmdLineParams,'"']);
Tool.Scanners.Add(SubToolH2Pas);
Tool.Parsers.Add(SubToolH2Pas);
if not RunExternalTool(Tool) then
exit(mrAbort);
if IDEMessagesWindow.SelectFirstUrgentMessage(mluError,false) then

View File

@ -27,7 +27,7 @@ uses
LCLProc, LCLType, LResources, Forms, Controls, Graphics,
Dialogs, ComCtrls, Buttons, StdCtrls, ExtCtrls,
// LazUtils
LazConfigStorage, LazFileUtils, LazFileCache,
LazConfigStorage, LazFileUtils, LazFileCache, LazUTF8,
// SynEdit
SynEdit,
// CodeTools
@ -936,7 +936,7 @@ procedure TH2PasDialog.UpdateFilesPage(ScanIncludes: boolean);
var
i: Integer;
CurFile: TH2PasFile;
OldSelection: TStringList;
OldSelection: TStringListUTF8Fast;
s: String;
OldExpandedState: TTreeNodeExpandedState;
Node: TTreeNode;
@ -953,7 +953,7 @@ begin
OldSelected:='';
if CHeaderFilesCheckTreeView.Selected<>nil then
OldSelected:=CHeaderFilesCheckTreeView.Selected.Text;
OldSelection:=TStringList.Create;
OldSelection:=TStringListUTF8Fast.Create;
Node:=CHeaderFilesCheckTreeView.GetFirstMultiSelected;
while Node<>nil do begin
//DebugLn(['TH2PasDialog.UpdateFilesPage Node.Text="',Node.Text,'" Index=',Node.Index]);

View File

@ -34,8 +34,15 @@ unit frmscout;
interface
uses
Classes, SysUtils, FileUtil, LazUTF8, Forms, Controls, Graphics, Dialogs, ComponentReg,
StdCtrls, EditBtn, IDECommands, LazIDEIntf, Types, LCLType, IDEOptionsIntf, IDEOptEditorIntf, IDEScoutStrConsts;
Classes, SysUtils, Types,
// LCL
LCLType, Forms, Controls, Graphics, Dialogs, StdCtrls, EditBtn,
// LazUtils
FileUtil, LazUTF8,
// BuildIntf, IdeIntf
IDEOptionsIntf,
ComponentReg, IDECommands, LazIDEIntf, IDEOptEditorIntf,
IDEScoutStrConsts;
Type
TScoutTerrain = (stCommands,stRecentProjects,stRecentFiles,stRecentPackages,stComponents);
@ -122,7 +129,7 @@ Type
FKeyStrokeColor: TColor;
FMatchColor: TColor;
FShowCategory: Boolean;
FSearchItems: TStringList;
FSearchItems: TStringListUTF8Fast;
FOrgCaption : String;
FShowShortCutKey: Boolean;
procedure ClearRefreshableItems;
@ -524,7 +531,7 @@ end;
procedure TIDEScoutForm.FormCreate(Sender: TObject);
begin
FSearchItems:=TStringList.Create;
FSearchItems:=TStringListUTF8Fast.Create;
FSearchItems.OwnsObjects:=True;
Caption:=isrsIDEScout;
FOrgCaption:=Caption;

View File

@ -53,6 +53,7 @@ begin
}
mcWords := TStringList.Create();
mcWords.UseLocale := False; // Will compare with CompareText.
mcWords.Add('RAX');
mcWords.Add('EAX');

View File

@ -161,6 +161,7 @@ begin
fiCurrentTokenIndex := 0;
fcDefinedSymbols := TStringList.Create;
fcDefinedSymbols.UseLocale := False; // Will compare with CompareText.
fcDefinedSymbols.Sorted := True;
fcDefinedSymbols.Duplicates := dupIgnore;

View File

@ -280,7 +280,9 @@ begin
fcReg := TRegIniFile.Create(REG_ROOT_KEY);
fcExclusionsFiles := TStringList.Create;
fcExclusionsDirs := TStringList.Create;
fcExclusionsFiles.UseLocale := False; // Will compare with CompareText.
fcExclusionsDirs := TStringList.Create;
fcExclusionsDirs.UseLocale := False;
end;
destructor TJCFRegistrySettings.Destroy;

View File

@ -134,6 +134,7 @@ begin
SetSection('SpecificWordCaps');
fcWords := TStringList.Create;
fcWords.UseLocale := False; // Will compare with CompareText.
fcWords.Duplicates := dupIgnore;
end;
@ -191,11 +192,7 @@ end;
function TSetAnyWordCaps.HasWord(const psWord: string): boolean;
begin
if psWord = '' then
begin
Result := False;
exit;
end;
exit(False);
Result := (fcWords.IndexOf(psWord) > -1);
end;

View File

@ -89,9 +89,11 @@ begin
SetSection('Clarify');
fcIgnoreUnusedParams := TStringList.Create;
fcIgnoreUnusedParams.UseLocale := False; // Will compare with CompareText.
fcIgnoreUnusedParams.Duplicates := dupIgnore;
fcFileExtensions := TStringList.Create;
fcFileExtensions.UseLocale := False;
fcFileExtensions.Duplicates := dupIgnore;
end;

View File

@ -78,10 +78,12 @@ begin
SetSection('PreProcessor');
fcDefinedSymbols := TStringList.Create;
fcDefinedSymbols.UseLocale := False; // Will compare with CompareText.
//fcDefinedSymbols.Sorted := True;
fcDefinedSymbols.Duplicates := dupIgnore;
fcDefinedOptions := TStringList.Create;
fcDefinedOptions.UseLocale := False;
//fcDefinedOptions.Sorted := True;
fcDefinedOptions.Duplicates := dupIgnore;
end;
@ -114,16 +116,11 @@ begin
fcDefinedSymbols.Sorted := False;
if not pcStream.Read(REG_DEFINED_SYMBOLS, fcDefinedSymbols) then
AddDefaultSymbols;
fcDefinedSymbols.Sort;
fcDefinedSymbols.Sorted := True;
fcDefinedOptions.Sorted := False;
if not pcStream.Read(REG_DEFINED_OPTIONS, fcDefinedOptions) then
AddDefaultOptions;
fcDefinedOptions.Sort;
fcDefinedOptions.Sorted := True;
end;

View File

@ -84,8 +84,10 @@ begin
SetSection('Replace');
fcWords := TStringList.Create;
fcLeftWords := TStringList.Create;
fcLeftWords := TStringList.Create;
fcLeftWords.UseLocale := False; // Will compare with CompareText.
fcRightWords := TStringList.Create;
fcRightWords.UseLocale := False;
end;
destructor TSetReplace.Destroy;

View File

@ -84,6 +84,7 @@ begin
SetSection(psSectionName);
fcWords := TStringList.Create;
fcWords.UseLocale := False; // Will compare with CompareText.
fcWords.Sorted := True;
fcWords.Duplicates := dupIgnore;
end;
@ -100,11 +101,9 @@ begin
fcWords.Sorted := False;
fbEnabled := pcStream.Read(REG_ENABLED, True);
if not pcStream.Read(REG_WORDS, fcWords) then
AddDefaultWords;
fcWords.Sort;
fcWords.Sorted := True;
end;

View File

@ -75,7 +75,7 @@ implementation
constructor TListFilterEdit.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
fOriginalData:=TStringList.Create;
fOriginalData:=TStringListUTF8Fast.Create;
fSelectionList:=TStringList.Create;
fSortedData:=TStringList.Create;
if fFilteredListbox is TCustomCheckListBox then

View File

@ -103,7 +103,7 @@ constructor TListViewFilterEdit.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
fOriginalData:=TListViewDataList.Create;
fSelectionList:=TStringList.Create;
fSelectionList:=TStringListUTF8Fast.Create;
fFilteredData:=TListViewDataList.Create;
end;

View File

@ -6,11 +6,11 @@ object SmallOrderedSetEditDlg: TSmallOrderedSetEditDlg
Caption = 'SmallOrderedSetEditDlg'
ClientHeight = 241
ClientWidth = 221
LCLVersion = '1.9.0.0'
LCLVersion = '2.1.0.0'
object ButtonPanel1: TButtonPanel
Left = 6
Height = 36
Top = 199
Height = 37
Top = 198
Width = 209
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True
@ -29,7 +29,7 @@ object SmallOrderedSetEditDlg: TSmallOrderedSetEditDlg
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 6
Height = 13
Height = 18
Top = 6
Width = 209
Anchors = [akTop, akLeft, akRight]
@ -45,9 +45,9 @@ object SmallOrderedSetEditDlg: TSmallOrderedSetEditDlg
AnchorSideRight.Control = MoveUpBitBtn
AnchorSideBottom.Control = ButtonPanel1
Left = 6
Height = 168
Top = 25
Width = 175
Height = 162
Top = 30
Width = 165
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6
HideSelection = False
@ -66,10 +66,10 @@ object SmallOrderedSetEditDlg: TSmallOrderedSetEditDlg
object MoveUpBitBtn: TBitBtn
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 187
Height = 28
Left = 177
Height = 27
Top = 40
Width = 28
Width = 38
Anchors = [akTop, akRight]
AutoSize = True
BorderSpacing.Around = 6
@ -119,10 +119,10 @@ object SmallOrderedSetEditDlg: TSmallOrderedSetEditDlg
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 187
Height = 28
Top = 74
Width = 28
Left = 177
Height = 27
Top = 73
Width = 38
Anchors = [akTop, akRight]
AutoSize = True
BorderSpacing.Around = 6
@ -168,7 +168,7 @@ object SmallOrderedSetEditDlg: TSmallOrderedSetEditDlg
TabOrder = 3
end
object ImageList1: TImageList
left = 66
top = 72
Left = 66
Top = 72
end
end

View File

@ -18,8 +18,10 @@ unit SmallOrderedSetEditor;
interface
uses
Classes, SysUtils, Types, math, Forms, Controls, Graphics, Dialogs, StdCtrls,
ButtonPanel, ComCtrls, Buttons, LCLType, Themes, LazLoggerBase;
Classes, SysUtils, Types, math,
Forms, Controls, Graphics, Dialogs, StdCtrls,
ButtonPanel, ComCtrls, Buttons, LCLType, Themes,
LazLoggerBase, LazUTF8;
type
TSmOrdSetEditOption = (
@ -59,7 +61,7 @@ type
procedure UpdateButtonState;
protected
procedure SetOptions(const AValue: TSmOrdSetEditOptions); virtual;
function IndexOf(List: TStrings; Value: string): integer; virtual;
//function IndexOf(List: TStrings; Value: string): integer; virtual;
procedure UpdateShowing; override;
procedure ToggleNode(Node: TTreeNode); virtual;
public
@ -202,25 +204,25 @@ begin
MoveUpBitBtn.Visible:=not (oseoHideUpDown in Options);
MoveDownBitBtn.Visible:=not (oseoHideUpDown in Options);
end;
{
function TSmallOrderedSetEditDlg.IndexOf(List: TStrings; Value: string): integer;
begin
Result:=List.IndexOf(Value);
end;
}
function TSmallOrderedSetEditDlg.SetList(List, NewList: TStrings;
ErrorOnDuplicate: boolean): boolean;
var
CleanList: TStringList;
CleanList: TStringListUTF8Fast;
i: Integer;
s: String;
begin
CleanList:=TStringList.Create;
CleanList:=TStringListUTF8Fast.Create;
try
for i:=0 to NewList.Count-1 do
begin
s:=NewList[i];
if IndexOf(CleanList,s)>=0 then
if CleanList.IndexOf(s)>=0 then
begin
if ErrorOnDuplicate then
raise EListError.Create(DbgSName(Self)+': duplicate item '+IntToStr(i)+' "'+s+'"');
@ -266,7 +268,7 @@ begin
Node.SelectedIndex:=Node.ImageIndex;
if Node.ImageIndex=0 then
begin
i:=IndexOf(Items,Node.Text);
i:=Items.IndexOf(Node.Text);
Items.Delete(i);
end else begin
j:=0;
@ -302,7 +304,7 @@ begin
for i:=FItems.Count-1 downto 0 do
begin
s:=FItems[i];
if IndexOf(AvailableItems,s)<0 then
if AvailableItems.IndexOf(s)<0 then
begin
if oseoErrorItemsContainNotAvailable in Options then
raise EListError.Create(DbgSName(Self)+': item '+IntToStr(i)+' "'+s+'" is not in AvailableItems');
@ -316,7 +318,7 @@ begin
begin
s:=AvailableItems[i];
Node:=ItemsTreeView.Items.Add(nil,s);
if IndexOf(Items,s)>=0 then
if Items.IndexOf(s)>=0 then
Node.ImageIndex:=1
else
Node.ImageIndex:=0;

View File

@ -36,8 +36,8 @@ type
private
fOwner: TTreeFilterEdit;
fRootNode: TTreeNode;
fOriginalData: TStringList; // Data supplied by caller.
fSortedData: TStringList; // Data sorted for viewing.
fOriginalData: TStringList; // Data supplied by caller.
fSortedData: TStringListUTF8Fast; // Data sorted for viewing.
fImgIndex: Integer;
// Full filename in node data is needed when showing the directory hierarchy.
// It is stored automatically if AFullFilename is passed to contructor.
@ -142,8 +142,8 @@ begin
inherited Create;
fOwner:=AOwner;
fRootNode:=ARootNode; // RootNode can also be Nil. Then all items are at top level.
fOriginalData:=TStringList.Create;
fSortedData:=TStringList.Create;
fOriginalData:=TStringListUTF8Fast.Create;
fSortedData:=TStringListUTF8Fast.Create;
fNodeTextToFullFilenameMap:=TStringToStringTree.Create(True);
fNodeTextToDataMap:=TStringToPointerTree.Create(True);
fImgIndex:=-1;

View File

@ -35,7 +35,7 @@ uses
LCLIntf, Forms, Controls, StdCtrls, Buttons, ComCtrls, ExtCtrls,
Graphics, Menus, Clipbrd,
// LazUtils
LazUtilities, LazFileUtils, Laz2_XMLCfg,
LazUtilities, LazFileUtils, Laz2_XMLCfg, LazUTF8,
// IdeIntf
SrcEditorIntf, PackageIntf, LazIDEIntf, IDEImagesIntf, IDECommands,
IDEOptEditorIntf, ProjectIntf,
@ -98,7 +98,7 @@ type
Title: string;
Package: TIDEPackage;
GroupTabLabel: TGroupTabLabelClass;
Files: TStringList;
Files: TStringListUTF8Fast;
constructor Create(AType: TGroupType; const ATitle: string; APackage: TIDEPackage);
destructor Destroy; override;
@ -589,7 +589,7 @@ begin
&Type := AType;
Title := ATitle;
Package := APackage;
Files := TStringList.Create;
Files := TStringListUTF8Fast.Create;
Files.Sorted := True;
Files.Duplicates := dupAccept;
end;

View File

@ -26,7 +26,7 @@ interface
uses
Classes, SysUtils, FileUtil, LazFileUtils, Forms, Controls, Graphics, Dialogs,
StdCtrls, CheckLst, Buttons, ExtCtrls, ComCtrls, Types,
LCLType, LazUTF8, LCLTranslator,
LCLType, LazUTF8,
{$IFnDEF POCHECKERSTANDALONE}
MenuIntf,
{$ENDIF}

View File

@ -5,13 +5,15 @@ unit PoCheckerSettings;
interface
uses
Classes, SysUtils, LazConfigStorage, Forms,
Classes, SysUtils,
Forms,
LazFileUtils, LazLoggerBase, LazConfigStorage, LazUTF8,
{$ifdef POCHECKERSTANDALONE}
PoCheckerXMLConfig,
{$else}
BaseIDEIntf,
{$endif}
PoFamilies, LCLProc, LazFileUtils;
PoFamilies;
type
@ -29,7 +31,7 @@ type
FResultsFormWindowState: TWindowState;
FSelectDirectoryFilename: String;
FTestTypes: TPoTestTypes;
FMasterPoList: TStringList;
FMasterPoList: TStringListUTF8Fast;
FMasterPoSelList: TStringList;
FMainFormGeometry: TRect;
FGraphFormGeometry: TRect;
@ -512,9 +514,9 @@ begin
FExternalEditorName := '';
FSelectDirectoryFilename := '';
FLangFilterLanguageAbbr := '';
if Assigned(FMasterPoList) then FMasterPoList.Free;
if Assigned(FMasterPoSelList) then FMasterPoSelList.Free;
FMasterPoList := TStringList.Create;
FMasterPoList.Free;
FMasterPoSelList.Free;
FMasterPoList := TStringListUTF8Fast.Create;
FMasterPoSelList := TStringList.Create;
FMasterPoList.Sorted := True;
FMasterPoList.Duplicates := dupIgnore;
@ -549,7 +551,7 @@ end;
destructor TPoCheckerSettings.Destroy;
begin
if Assigned(FConfig) then FConfig.Free;
FConfig.Free;
FMasterPoList.Free;
FMasterPoSelList.Free;
inherited Destroy;

View File

@ -25,8 +25,14 @@ unit RTTIGrids;
interface
uses
Classes, SysUtils, Controls, LCLProc, LCLType, ObjectInspector, PropEdits,
GraphPropEdits, TypInfo, RTTICtrls, Grids;
Classes, SysUtils, TypInfo,
// LCL
LCLProc, LCLType, Controls, Grids,
// LazUtils
LazLoggerBase, LazUTF8,
// IdeIntf
ObjectInspector, PropEdits,
RTTICtrls;
type
{ TTICustomPropertyGrid }
@ -851,9 +857,9 @@ begin
tkQWord{,tkDynArray,tkInterfaceRaw}];
FProperties:=TList.Create;
FListDirection:=tldObjectsAsRows;
FHideProperties:=TStringList.Create;
FHideProperties:=TStringListUTF8Fast.Create;
FPropertyOrder:=TStringList.Create;
FShowOnlyProperties:=TStringList.Create;
FShowOnlyProperties:=TStringListUTF8Fast.Create;
FAliasPropertyNames:=TAliasStrings.Create;
end;
@ -1184,16 +1190,14 @@ begin
Result:=Properties[PropertyIndex];
end;
function TTICustomGrid.IndexOfGridProperty(const PropName: string
): integer;
function TTICustomGrid.IndexOfGridProperty(const PropName: string): integer;
begin
Result:=FProperties.Count-1;
while (Result>=0) and (CompareText(Properties[Result].PropName,PropName)<>0)
do dec(Result);
end;
function TTICustomGrid.FindGridProperty(const PropName: string
): TTIGridProperty;
function TTICustomGrid.FindGridProperty(const PropName: string): TTIGridProperty;
var
i: integer;
begin