diff --git a/designer/designermenu.pp b/designer/designermenu.pp index 0c16d582c0..55a35e5328 100644 --- a/designer/designermenu.pp +++ b/designer/designermenu.pp @@ -1804,7 +1804,7 @@ function TDesignerMainMenu.GetDesignerMenuItem(DMenuItem: TDesignerMenuItem; begin Result:=nil; if DMenuItem=nil then exit; - if (AnsiCompareText(DMenuItem.ID,Ident)=0) then + if (CompareText(DMenuItem.ID,Ident)=0) then Result:=DMenuItem else begin diff --git a/ide/buildfiledlg.pas b/ide/buildfiledlg.pas index e138de8380..3799500c81 100644 --- a/ide/buildfiledlg.pas +++ b/ide/buildfiledlg.pas @@ -402,14 +402,14 @@ end; function IDEDirectiveNameToDirective(const DirectiveName: string): TIDEDirective; begin for Result:=Low(TIDEDirective) to High(TIDEDirective) do - if AnsiCompareText(IDEDirectiveNames[Result],DirectiveName)=0 then exit; + if CompareText(IDEDirectiveNames[Result],DirectiveName)=0 then exit; Result:=idedNone; end; function IDEDirBuildScanFlagNameToFlag(const FlagName: string): TIDEDirBuildScanFlag; begin for Result:=Low(TIDEDirBuildScanFlag) to High(TIDEDirBuildScanFlag) do - if AnsiCompareText(IDEDirBuildScanFlagNames[Result],FlagName)=0 then + if CompareText(IDEDirBuildScanFlagNames[Result],FlagName)=0 then exit; Result:=idedbsfNone; end; @@ -443,7 +443,7 @@ end; function IDEDirRunFlagNameToFlag(const FlagName: string): TIDEDirRunFlag; begin for Result:=Low(TIDEDirRunFlag) to High(TIDEDirRunFlag) do - if AnsiCompareText(IDEDirRunFlagNames[Result],FlagName)=0 then + if CompareText(IDEDirRunFlagNames[Result],FlagName)=0 then exit; Result:=idedrfNone; end; diff --git a/ide/buildmodediffdlg.pas b/ide/buildmodediffdlg.pas index 4674c9e739..3ee6be293d 100644 --- a/ide/buildmodediffdlg.pas +++ b/ide/buildmodediffdlg.pas @@ -29,9 +29,9 @@ unit BuildModeDiffDlg; interface uses - Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ButtonPanel, - StdCtrls, ComCtrls, - LazarusIDEStrConsts, Project, CompilerOptions, CompOptsModes; + Classes, SysUtils, FileUtil, LazUTF8, Forms, Controls, Graphics, Dialogs, + ButtonPanel, StdCtrls, ComCtrls, LazarusIDEStrConsts, Project, + CompilerOptions, CompOptsModes; type @@ -94,7 +94,7 @@ var begin if fProject<>nil then for i:=0 to fProject.BuildModes.Count-1 do - if SysUtils.AnsiCompareText(fProject.BuildModes[i].GetCaption,ModeComboBox.Text)=0 + if UTF8CompareText(fProject.BuildModes[i].GetCaption,ModeComboBox.Text)=0 then begin fBaseMode:=fProject.BuildModes[i]; FillDiffTreeView; diff --git a/ide/buildprofilemanager.pas b/ide/buildprofilemanager.pas index b73bb5fc5e..581d600644 100644 --- a/ide/buildprofilemanager.pas +++ b/ide/buildprofilemanager.pas @@ -31,11 +31,11 @@ unit BuildProfileManager; interface uses - Classes, SysUtils, FileUtil, Laz2_XMLCfg, LazLogger, LazFileUtils, LResources, - Forms, Controls, Graphics, Dialogs, ExtCtrls, Buttons, StdCtrls, ComCtrls, - Contnrs, ButtonPanel, DefineTemplates, IDEImagesIntf, IDEMsgIntf, IDEHelpIntf, - IDEDialogs, LazarusIDEStrConsts, LazConf, InterfaceBase, IDEProcs, - TransferMacros, CompilerOptions, EnvironmentOpts; + Classes, SysUtils, FileUtil, Laz2_XMLCfg, LazLogger, LazFileUtils, LazUTF8, + LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls, Buttons, StdCtrls, + ComCtrls, Contnrs, ButtonPanel, DefineTemplates, IDEImagesIntf, IDEMsgIntf, + IDEHelpIntf, IDEDialogs, LazarusIDEStrConsts, LazConf, InterfaceBase, + IDEProcs, TransferMacros, CompilerOptions, EnvironmentOpts; type @@ -354,7 +354,7 @@ end; function TBuildLazarusProfiles.IndexByName(AName: string): integer; begin Result:=Count-1; - while (Result>=0) and (AnsiCompareText(Items[Result].Name,AName)<>0) do + while (Result>=0) and (UTF8CompareText(Items[Result].Name,AName)<>0) do dec(Result); end; diff --git a/ide/codemacroprompt.pas b/ide/codemacroprompt.pas index 59aa033b31..8ac53ae5d5 100644 --- a/ide/codemacroprompt.pas +++ b/ide/codemacroprompt.pas @@ -464,7 +464,7 @@ begin TokenStartX:=length(s)+1; j:=length(TemplateName); while (j>0) - and (AnsiCompareText(copy(TemplateName,1,j),copy(s,TokenStartX-j,j))<>0) do + and (UTF8CompareText(copy(TemplateName,1,j),copy(s,TokenStartX-j,j))<>0) do dec(j); dec(TokenStartX,j); AEditor.BlockBegin := Point(TokenStartX, p.y); diff --git a/ide/editoroptions.pp b/ide/editoroptions.pp index f6d18b753a..62e3b31eb7 100644 --- a/ide/editoroptions.pp +++ b/ide/editoroptions.pp @@ -1557,7 +1557,7 @@ end; function StrToLazSyntaxHighlighter(const s: String): TLazSyntaxHighlighter; begin for Result := Low(TLazSyntaxHighlighter) to High(TLazSyntaxHighlighter) do - if (AnsiCompareText(s, LazSyntaxHighlighterNames[Result]) = 0) then + if (CompareText(s, LazSyntaxHighlighterNames[Result]) = 0) then exit; Result := lshFreePascal; end; @@ -2464,7 +2464,7 @@ end; function TEditOptLangList.FindByName(const Name: String): Integer; begin Result := Count - 1; - while (Result >= 0) and (AnsiCompareText( + while (Result >= 0) and (UTF8CompareText( Items[Result].SynClass.GetLanguageName, Name) <> 0) do dec(Result); end; diff --git a/ide/encloseselectiondlg.pas b/ide/encloseselectiondlg.pas index 0cff1d964c..1c159d4515 100644 --- a/ide/encloseselectiondlg.pas +++ b/ide/encloseselectiondlg.pas @@ -421,7 +421,7 @@ var begin i:=TypeRadiogroup.ItemIndex; for Result:=Low(TEncloseSelectionType) to High(TEncloseSelectionType) do - if AnsiCompareText(TypeRadiogroup.Items[i], + if UTF8CompareText(TypeRadiogroup.Items[i], EncloseSelectionTypeDescription(Result))=0 then exit; diff --git a/ide/frames/editor_mouseaction_options_advanced.pas b/ide/frames/editor_mouseaction_options_advanced.pas index c486e4d8b4..7e59322c70 100644 --- a/ide/frames/editor_mouseaction_options_advanced.pas +++ b/ide/frames/editor_mouseaction_options_advanced.pas @@ -166,7 +166,7 @@ procedure TEditorMouseOptionsAdvFrame.ActionGridCompareCells(Sender: TObject; AC Result := ord(TSynEditMouseAction(TStringGrid(Sender).Objects[0, BRow]).ClickDir) - ord(TSynEditMouseAction(TStringGrid(Sender).Objects[0, ARow]).ClickDir); else - Result := AnsiCompareText(TStringGrid(Sender).Cells[i, ARow], TStringGrid(Sender).Cells[i, BRow]); + Result := UTF8CompareText(TStringGrid(Sender).Cells[i, ARow], TStringGrid(Sender).Cells[i, BRow]); end; end; var diff --git a/ide/frames/project_forms_options.pas b/ide/frames/project_forms_options.pas index c2bf173e7f..3d1c52e1b5 100644 --- a/ide/frames/project_forms_options.pas +++ b/ide/frames/project_forms_options.pas @@ -93,7 +93,7 @@ begin cmp := 1; while (NewPos < FormsAvailFormsListBox.Items.Count) do begin - cmp := AnsiCompareText(FormsAvailFormsListBox.Items[NewPos], OldFormName); + cmp := CompareText(FormsAvailFormsListBox.Items[NewPos], OldFormName); if cmp < 0 then Inc(NewPos) else @@ -222,7 +222,7 @@ var p := Pos(':', FormsAutoCreatedListBox.Items[Result]); if p < 1 then p := Length(FormsAutoCreatedListBox.Items[Result]) + 1; - if AnsiCompareText(copy(FormsAutoCreatedListBox.Items[Result], 1, p - 1), + if CompareText(copy(FormsAutoCreatedListBox.Items[Result], 1, p - 1), FormName) = 0 then Exit; Dec(Result); diff --git a/ide/ideprocs.pp b/ide/ideprocs.pp index 1fa4964c74..a501f2f01e 100644 --- a/ide/ideprocs.pp +++ b/ide/ideprocs.pp @@ -265,7 +265,7 @@ procedure CheckList(List: TList; TestListNil, TestDoubles, TestNils: boolean); procedure CheckList(List: TFPList; TestListNil, TestDoubles, TestNils: boolean); procedure CheckEmptyListCut(List1, List2: TList); procedure RemoveDoubles(List: TStrings); -function AnsiSearchInStringList(List: TStrings; const s: string): integer; +function UTF8SearchInStringList(List: TStrings; const s: string): integer; procedure ReverseList(List: TList); procedure ReverseList(List: TFPList); procedure FreeListObjects(List: TList; FreeList: boolean); @@ -1365,13 +1365,13 @@ begin end; {------------------------------------------------------------------------------- - function AnsiSearchInStringList(List: TStrings; const s: string): integer; + function UTF8SearchInStringList(List: TStrings; const s: string): integer; -------------------------------------------------------------------------------} -function AnsiSearchInStringList(List: TStrings; const s: string): integer; +function UTF8SearchInStringList(List: TStrings; const s: string): integer; begin if List=nil then exit(-1); Result:=List.Count-1; - while (Result>=0) and (AnsiCompareText(List[Result],s)<>0) do dec(Result); + while (Result>=0) and (UTF8CompareText(List[Result],s)<>0) do dec(Result); end; {------------------------------------------------------------------------------- @@ -2751,7 +2751,7 @@ begin for i:=0 to List.Count-1 do begin case Cmp of cstCaseSensitive: if List[i]=s then exit(i); - cstCaseInsensitive: if AnsiCompareText(List[i],s)=0 then exit(i); + cstCaseInsensitive: if UTF8CompareText(List[i],s)=0 then exit(i); cstFilename: if CompareFilenames(List[i],s)=0 then exit(i); end; end; diff --git a/ide/inputhistory.pas b/ide/inputhistory.pas index b49cc709d3..f7576c0f08 100644 --- a/ide/inputhistory.pas +++ b/ide/inputhistory.pas @@ -930,7 +930,7 @@ end; function THistoryLists.IndexOfName(const Name: string): integer; begin Result:=Count-1; - while (Result>=0) and (AnsiCompareText(Items[Result].Name,Name)<>0) do + while (Result>=0) and (UTF8CompareText(Items[Result].Name,Name)<>0) do dec(Result); end; diff --git a/ide/main.pp b/ide/main.pp index e6fde8bbf9..684ea6ff40 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -7404,7 +7404,7 @@ begin GetFixupReferenceNames(CurRoot,ReferenceRootNames); for j:=0 to ReferenceRootNames.Count-1 do begin RefRootName:=ReferenceRootNames[j]; - if AnsiSearchInStringList(LoadingReferenceNames,RefRootName)>=0 + if UTF8SearchInStringList(LoadingReferenceNames,RefRootName)>=0 then continue; ReferenceInstanceNames.Clear; @@ -12029,12 +12029,12 @@ begin try if not CodeToolBoss.FindUsedUnitNames(MainUnitInfo.Source, MainUsesSection,ImplementationUsesSection) then exit; - if (AnsiSearchInStringList(MainUsesSection,'forms')<0) - and (AnsiSearchInStringList(ImplementationUsesSection,'forms')<0) then + if (UTF8SearchInStringList(MainUsesSection,'forms')<0) + and (UTF8SearchInStringList(ImplementationUsesSection,'forms')<0) then exit; // project uses lcl unit Forms - if (AnsiSearchInStringList(MainUsesSection,'interfaces')>=0) - or (AnsiSearchInStringList(ImplementationUsesSection,'interfaces')>=0) then + if (UTF8SearchInStringList(MainUsesSection,'interfaces')>=0) + or (UTF8SearchInStringList(ImplementationUsesSection,'interfaces')>=0) then exit; // project uses lcl unit Forms, but not unit interfaces // this will result in strange linker error diff --git a/ide/makeresstrdlg.pas b/ide/makeresstrdlg.pas index 03f1c659f5..88499f48c0 100644 --- a/ide/makeresstrdlg.pas +++ b/ide/makeresstrdlg.pas @@ -521,7 +521,7 @@ var begin if Identifier<>'' then begin for i:=0 to ResStrWithSameValuesCombobox.Items.Count-1 do begin - if AnsiCompareText(Identifier,ResStrWithSameValuesCombobox.Items[i])=0 + if CompareText(Identifier,ResStrWithSameValuesCombobox.Items[i])=0 then begin Result:=true; exit; diff --git a/ide/miscoptions.pas b/ide/miscoptions.pas index 93ec9a8504..11267ce2b2 100644 --- a/ide/miscoptions.pas +++ b/ide/miscoptions.pas @@ -123,14 +123,14 @@ const function SortDirectionNameToType(const s: string): TSortDirection; begin for Result:=Low(TSortDirection) to High(TSortDirection) do - if AnsiCompareText(SortDirectionNames[Result],s)=0 then exit; + if CompareText(SortDirectionNames[Result],s)=0 then exit; Result:=sdAscending; end; function SortDomainNameToType(const s: string): TSortDomain; begin for Result:=Low(TSortDomain) to High(TSortDomain) do - if AnsiCompareText(SortDomainNames[Result],s)=0 then exit; + if CompareText(SortDomainNames[Result],s)=0 then exit; Result:=sdLines; end; @@ -139,14 +139,14 @@ function ResourcestringInsertPolicyNameToType( begin for Result:=Low(TResourcestringInsertPolicy) to High(TResourcestringInsertPolicy) do - if AnsiCompareText(ResourcestringInsertPolicyNames[Result],s)=0 then exit; + if CompareText(ResourcestringInsertPolicyNames[Result],s)=0 then exit; Result:=rsipAppend; end; function FindRenameScopeNameToScope(const s: string): TFindRenameScope; begin for Result:=Low(TFindRenameScope) to High(TFindRenameScope) do - if AnsiCompareText(FindRenameScopeNames[Result],s)=0 then exit; + if CompareText(FindRenameScopeNames[Result],s)=0 then exit; Result:=frAllOpenProjectsAndPackages; end; diff --git a/ide/newdialog.pas b/ide/newdialog.pas index 736c729ea7..0976b8bc27 100644 --- a/ide/newdialog.pas +++ b/ide/newdialog.pas @@ -471,7 +471,7 @@ end; function TNewLazIDEItemCategories.IndexOf(const CategoryName: string): integer; begin Result := Count - 1; - while (Result >= 0) and (AnsiCompareText(CategoryName, Items[Result].Name) <> 0) do + while (Result >= 0) and (UTF8CompareText(CategoryName, Items[Result].Name) <> 0) do Dec(Result); end; diff --git a/ide/project.pp b/ide/project.pp index 91e12d9a7c..6f749ec866 100644 --- a/ide/project.pp +++ b/ide/project.pp @@ -4076,9 +4076,9 @@ begin if ((OnlyProjectUnits and Units[Result].IsPartOfProject) or (not OnlyProjectUnits)) and (IgnoreUnit<>Units[Result]) then begin - if (AnsiCompareText(Units[Result].ComponentName,AComponentName)=0) + if (CompareText(Units[Result].ComponentName,AComponentName)=0) or ((Units[Result].Component<>nil) - and (AnsiCompareText(Units[Result].Component.Name,AComponentName)=0)) + and (CompareText(Units[Result].Component.Name,AComponentName)=0)) then exit; end; diff --git a/ide/projectdefs.pas b/ide/projectdefs.pas index 6c75a246a5..04fe3a101d 100644 --- a/ide/projectdefs.pas +++ b/ide/projectdefs.pas @@ -1074,7 +1074,7 @@ end; function TLazProjectFileDescriptors.IndexOf(const Name: string): integer; begin Result:=Count-1; - while (Result>=0) and (AnsiCompareText(Name,Items[Result].Name)<>0) do + while (Result>=0) and (UTF8CompareText(Name,Items[Result].Name)<>0) do dec(Result); end; @@ -1198,7 +1198,7 @@ end; function TLazProjectDescriptors.IndexOf(const Name: string): integer; begin Result:=Count-1; - while (Result>=0) and (AnsiCompareText(Name,Items[Result].Name)<>0) do + while (Result>=0) and (UTF8CompareText(Name,Items[Result].Name)<>0) do dec(Result); end; diff --git a/ide/sourceeditor.pp b/ide/sourceeditor.pp index 5fdeb86d23..88af9ff351 100644 --- a/ide/sourceeditor.pp +++ b/ide/sourceeditor.pp @@ -1945,7 +1945,7 @@ begin while (x<=length(s)) and (s[x]<>#3) do inc(x); if xancestortype - if AnsiCompareText(Params.NewClassName,Params.AncestorType)=0 then begin + if CompareText(Params.NewClassName,Params.AncestorType)=0 then begin IDEMessageDialog(lisA2PInvalidCircularDependency, Format(lisA2PTheClassNameAndAncestorTypeAreTheSame, ['"',Params.NewClassName, '"', '"', Params.AncestorType, '"']), mtError,[mbCancel]); diff --git a/packager/pkgmanager.pas b/packager/pkgmanager.pas index 8006a5f7f4..5f94ab885d 100644 --- a/packager/pkgmanager.pas +++ b/packager/pkgmanager.pas @@ -4726,7 +4726,7 @@ end; function TLazPackageDescriptors.IndexOf(const Name: string): integer; begin Result:=Count-1; - while (Result>=0) and (AnsiCompareText(Name,Items[Result].Name)<>0) do + while (Result>=0) and (UTF8CompareText(Name,Items[Result].Name)<>0) do dec(Result); end; diff --git a/packager/ucomponentmanmain.pas b/packager/ucomponentmanmain.pas index 19722c9198..f1b934eb7f 100644 --- a/packager/ucomponentmanmain.pas +++ b/packager/ucomponentmanmain.pas @@ -28,7 +28,7 @@ interface uses Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, - Buttons, FileUtil, lazutf8classes, IDEProcs, UFrmAddComponent; + Buttons, FileUtil, lazutf8classes, LazUTF8, IDEProcs, UFrmAddComponent; Type TRComponent = class(TObject) @@ -376,7 +376,7 @@ begin MyObj2 := ListComps.Items.Objects[J] as TRComponent; //messagedlg('Comparing object '+MyObj.Name+' at '+inttostr(I)+' with '+MyObj2.Name, mtInformation,[mbOk],0); if assigned(MyOBj2) then begin - Found := AnsiCompareText(MyObj2.Unit_Name,Myobj.Unit_Name)=0; + Found := CompareText(MyObj2.Unit_Name,Myobj.Unit_Name)=0; end; // if assigned end; // for J end; // For I