diff --git a/components/chmhelp/packages/idehelp/chmlangref.pas b/components/chmhelp/packages/idehelp/chmlangref.pas index e7fda7a3f7..49ecb147ef 100644 --- a/components/chmhelp/packages/idehelp/chmlangref.pas +++ b/components/chmhelp/packages/idehelp/chmlangref.pas @@ -6,8 +6,9 @@ interface uses Classes, SysUtils, - Dialogs, FileUtil, LazFileUtils, LazUTF8, - LazHelpIntf, HelpIntfs, IDEHelpIntf, MacroIntf; + Dialogs, LazHelpIntf, HelpIntfs, + FileUtil, LazFileUtils, LazUTF8, + IDEHelpIntf, MacroIntf; const sFPCLangRef = 'FPC Language Reference'; @@ -20,7 +21,7 @@ type private FCHMSearchPath: string; FKeywordNodes: TList; - FKeyWordsList: TStringList; + FKeyWordsList: TStringListUTF8Fast; FRTLIndex: TStringList; procedure ClearKeywordNodes; procedure LoadChmIndex(const Path, ChmFileName: string; @@ -68,7 +69,7 @@ constructor TLangRefHelpDatabase.Create(TheOwner: TComponent); begin inherited Create(TheOwner); FKeywordNodes := TList.Create; - FKeyWordsList := TStringList.Create; + FKeyWordsList := TStringListUTF8Fast.Create; FKeyWordsList.CaseSensitive := False; FRTLIndex := TStringList.Create; FRTLIndex.CaseSensitive := False; diff --git a/components/chmhelp/packages/idehelp/lazchmhelp.pas b/components/chmhelp/packages/idehelp/lazchmhelp.pas index 6373573a19..ab7a092dd4 100644 --- a/components/chmhelp/packages/idehelp/lazchmhelp.pas +++ b/components/chmhelp/packages/idehelp/lazchmhelp.pas @@ -29,7 +29,7 @@ interface uses Classes, SysUtils, // LazUtils - FileUtil, LazLogger, LazFileUtils, LazConfigStorage, UTF8Process, + FileUtil, LazLogger, LazFileUtils, LazConfigStorage, UTF8Process, LazUTF8, // LCL Controls, Forms, Dialogs, LazHelpIntf, HelpIntfs, LCLPlatformDef, InterfaceBase, // IdeIntf @@ -184,7 +184,7 @@ end; procedure TChmHelpViewer.OpenAllCHMsInSearchPath(const SearchPath: String); var - CHMFiles: TStringList; + CHMFiles: TStringListUTF8Fast; SearchPaths: TStringList; // SearchPath split to a StringList SearchFiles: TStringList; // Files found in SearchPath i: integer; @@ -214,10 +214,8 @@ begin } // Just open all CHM files in all directories+subdirs in ;-delimited searchpath: SearchPaths:=TStringList.Create; - CHMFiles:=TStringList.Create; + CHMFiles:=TStringListUTF8Fast.Create; try - CHMFiles.Sorted:=true; - CHMFiles.Duplicates:=dupIgnore; SearchPaths.Delimiter:=';'; SearchPaths.StrictDelimiter:=false; SearchPaths.DelimitedText:=SearchPath; @@ -231,6 +229,8 @@ begin CHMFiles.AddStrings(SearchFiles); SearchFiles.Free; end; + CHMFiles.Sorted:=true; + CHMFiles.Duplicates:=dupIgnore; {$IFDEF CHMLOADTIMES} DebugLn(['CHMLOADTIMES: ',Format('Searching files in %s took %d ms',[SearchPath,DateTimeToTimeStamp(Now-StartTime).Time])]); StartTime := Now; @@ -239,7 +239,7 @@ begin fHelpConnection.BeginUpdate; for i := 0 to CHMFiles.Count-1 do begin - if UpperCase(ExtractFileExt(CHMFiles[i]))='.CHM' then + if CompareFileExtQuick(CHMFiles[i], 'chm') = 0 then begin fHelpConnection.OpenURL(CHMFiles[i], '/index.html'); // This is probably no longer necessary as we're now waiting for the viewer's diff --git a/components/customform/custforms.pp b/components/customform/custforms.pp index c147002d20..4785ff26bb 100644 --- a/components/customform/custforms.pp +++ b/components/customform/custforms.pp @@ -8,6 +8,8 @@ uses Classes, SysUtils, contnrs, // LCL Forms, + // LazUtils + LazUTF8, // IdeIntf ProjectIntf, NewItemIntf, FormEditingIntf; @@ -156,16 +158,14 @@ Var D : TCustomFormDescr; begin - L:=TStringList.Create; + L:=TStringListUTF8Fast.Create; Try L.Sorted:=True; L.Duplicates:=dupIgnore; For I:=0 to CustomFormList.Count-1 do L.Add(TCustomFormDescr(CustomFormList[i]).Category); For I:=0 to L.Count-1 do - begin RegisterNewItemCategory(TNewIDEItemCategory.Create(L[i])); - end; Finally L.Free; end; diff --git a/components/fppkg/src/fppkg_packageoptionsfrm.pas b/components/fppkg/src/fppkg_packageoptionsfrm.pas index 5c9d31097d..c5b2d6a0b7 100644 --- a/components/fppkg/src/fppkg_packageoptionsfrm.pas +++ b/components/fppkg/src/fppkg_packageoptionsfrm.pas @@ -14,6 +14,7 @@ uses ExtCtrls, Dialogs, ActnList, ComboEx, + LazUTF8, PackageIntf, IDEOptEditorIntf, IDEOptionsIntf, SynEdit, @@ -429,7 +430,7 @@ constructor TFppkgPackageOptionsFrm.Create(AOwner: TComponent); begin inherited Create(AOwner); FPackageVariantList := TFppkgPackageVariantList.Create(True); - FPackageList := TStringList.Create; + FPackageList := TStringListUTF8Fast.Create; TStringList(FPackageList).Sorted := True; TStringList(FPackageList).Duplicates := dupIgnore; end; diff --git a/components/synunihighlighter/synunidesigner.pas b/components/synunihighlighter/synunidesigner.pas index 6248913a34..38eba3e508 100644 --- a/components/synunihighlighter/synunidesigner.pas +++ b/components/synunihighlighter/synunidesigner.pas @@ -961,15 +961,21 @@ begin end; procedure TSynUniDesigner.SortClick(Sender: TObject); -var i:integer; +var + i: integer; + s: String; begin With TStringList.Create do try + for i:=0 to Memo.Lines.Count-1 do + begin + s := Trim(Memo.Lines[i]); + if s<>'' then + Add(s); + end; Sorted:=true; Duplicates:=dupIgnore; - for i:=0 to Memo.Lines.Count-1 do if trim(Memo.lines[i])<>'' then add(trim(Memo.lines[i])); - sort; - Memo.text:=trim(text); + Memo.Text:=Trim(text); finally free; end; diff --git a/components/synunihighlighter/synunihighlighter.pas b/components/synunihighlighter/synunihighlighter.pas index 1e0a19bcfa..fa6f3e4513 100644 --- a/components/synunihighlighter/synunihighlighter.pas +++ b/components/synunihighlighter/synunihighlighter.pas @@ -555,8 +555,7 @@ end; { TSynSymbolGroup } -constructor TSynSymbolGroup.Create(s: string; - attr: TSynHighlighterAttributes); +constructor TSynSymbolGroup.Create(s: string; attr: TSynHighlighterAttributes); begin Attribs:=attr; KeywordsList:=TStringList.Create; @@ -933,7 +932,7 @@ var CurTagIndex:Integer; LineNumber:integer; Param:string; - xmlInfoTags:TStringList; + xmlInfoTags: TStringList; ////TL Guess FPC doesn't support optional parameters. Never used this in Delphi or Kylix. ////TL I'm going to remove them and explicitly state the parms in each call. @@ -2699,11 +2698,11 @@ end; procedure TSynUniSyn.LoadFromFile(FileName: string); var - F: TFileStreamUTF8; + F: TFileStream; begin if FileName = '' then raise exception.Create('FileName is empty'); - F:=TFileStreamUTF8.Create(FileName,fmOpenRead or fmShareDenyWrite); + F:=TFileStream.Create(FileName,fmOpenRead or fmShareDenyWrite); try LoadFromStream( F ); finally @@ -2713,11 +2712,11 @@ end; procedure TSynUniSyn.SaveToFile(FileName: string); var - F: TFileStreamUTF8; + F: TFileStream; begin if FileName = '' then raise exception.Create('FileName is empty'); - F:=TFileStreamUTF8.Create(FileName,fmOpenWrite or fmShareDenyNone); + F:=TFileStream.Create(FileName,fmOpenWrite or fmShareDenyNone); try SaveToStream( F ); finally