IDE: using UTF8CompareText

git-svn-id: trunk@37960 -
This commit is contained in:
mattias 2012-07-16 20:53:37 +00:00
parent 413a275982
commit a99a34ebd2
22 changed files with 53 additions and 53 deletions

View File

@ -1804,7 +1804,7 @@ function TDesignerMainMenu.GetDesignerMenuItem(DMenuItem: TDesignerMenuItem;
begin begin
Result:=nil; Result:=nil;
if DMenuItem=nil then exit; if DMenuItem=nil then exit;
if (AnsiCompareText(DMenuItem.ID,Ident)=0) then if (CompareText(DMenuItem.ID,Ident)=0) then
Result:=DMenuItem Result:=DMenuItem
else else
begin begin

View File

@ -402,14 +402,14 @@ end;
function IDEDirectiveNameToDirective(const DirectiveName: string): TIDEDirective; function IDEDirectiveNameToDirective(const DirectiveName: string): TIDEDirective;
begin begin
for Result:=Low(TIDEDirective) to High(TIDEDirective) do 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; Result:=idedNone;
end; end;
function IDEDirBuildScanFlagNameToFlag(const FlagName: string): TIDEDirBuildScanFlag; function IDEDirBuildScanFlagNameToFlag(const FlagName: string): TIDEDirBuildScanFlag;
begin begin
for Result:=Low(TIDEDirBuildScanFlag) to High(TIDEDirBuildScanFlag) do for Result:=Low(TIDEDirBuildScanFlag) to High(TIDEDirBuildScanFlag) do
if AnsiCompareText(IDEDirBuildScanFlagNames[Result],FlagName)=0 then if CompareText(IDEDirBuildScanFlagNames[Result],FlagName)=0 then
exit; exit;
Result:=idedbsfNone; Result:=idedbsfNone;
end; end;
@ -443,7 +443,7 @@ end;
function IDEDirRunFlagNameToFlag(const FlagName: string): TIDEDirRunFlag; function IDEDirRunFlagNameToFlag(const FlagName: string): TIDEDirRunFlag;
begin begin
for Result:=Low(TIDEDirRunFlag) to High(TIDEDirRunFlag) do for Result:=Low(TIDEDirRunFlag) to High(TIDEDirRunFlag) do
if AnsiCompareText(IDEDirRunFlagNames[Result],FlagName)=0 then if CompareText(IDEDirRunFlagNames[Result],FlagName)=0 then
exit; exit;
Result:=idedrfNone; Result:=idedrfNone;
end; end;

View File

@ -29,9 +29,9 @@ unit BuildModeDiffDlg;
interface interface
uses uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ButtonPanel, Classes, SysUtils, FileUtil, LazUTF8, Forms, Controls, Graphics, Dialogs,
StdCtrls, ComCtrls, ButtonPanel, StdCtrls, ComCtrls, LazarusIDEStrConsts, Project,
LazarusIDEStrConsts, Project, CompilerOptions, CompOptsModes; CompilerOptions, CompOptsModes;
type type
@ -94,7 +94,7 @@ var
begin begin
if fProject<>nil then if fProject<>nil then
for i:=0 to fProject.BuildModes.Count-1 do 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 then begin
fBaseMode:=fProject.BuildModes[i]; fBaseMode:=fProject.BuildModes[i];
FillDiffTreeView; FillDiffTreeView;

View File

@ -31,11 +31,11 @@ unit BuildProfileManager;
interface interface
uses uses
Classes, SysUtils, FileUtil, Laz2_XMLCfg, LazLogger, LazFileUtils, LResources, Classes, SysUtils, FileUtil, Laz2_XMLCfg, LazLogger, LazFileUtils, LazUTF8,
Forms, Controls, Graphics, Dialogs, ExtCtrls, Buttons, StdCtrls, ComCtrls, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls, Buttons, StdCtrls,
Contnrs, ButtonPanel, DefineTemplates, IDEImagesIntf, IDEMsgIntf, IDEHelpIntf, ComCtrls, Contnrs, ButtonPanel, DefineTemplates, IDEImagesIntf, IDEMsgIntf,
IDEDialogs, LazarusIDEStrConsts, LazConf, InterfaceBase, IDEProcs, IDEHelpIntf, IDEDialogs, LazarusIDEStrConsts, LazConf, InterfaceBase,
TransferMacros, CompilerOptions, EnvironmentOpts; IDEProcs, TransferMacros, CompilerOptions, EnvironmentOpts;
type type
@ -354,7 +354,7 @@ end;
function TBuildLazarusProfiles.IndexByName(AName: string): integer; function TBuildLazarusProfiles.IndexByName(AName: string): integer;
begin begin
Result:=Count-1; 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); dec(Result);
end; end;

View File

@ -464,7 +464,7 @@ begin
TokenStartX:=length(s)+1; TokenStartX:=length(s)+1;
j:=length(TemplateName); j:=length(TemplateName);
while (j>0) 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(j);
dec(TokenStartX,j); dec(TokenStartX,j);
AEditor.BlockBegin := Point(TokenStartX, p.y); AEditor.BlockBegin := Point(TokenStartX, p.y);

View File

@ -1557,7 +1557,7 @@ end;
function StrToLazSyntaxHighlighter(const s: String): TLazSyntaxHighlighter; function StrToLazSyntaxHighlighter(const s: String): TLazSyntaxHighlighter;
begin begin
for Result := Low(TLazSyntaxHighlighter) to High(TLazSyntaxHighlighter) do for Result := Low(TLazSyntaxHighlighter) to High(TLazSyntaxHighlighter) do
if (AnsiCompareText(s, LazSyntaxHighlighterNames[Result]) = 0) then if (CompareText(s, LazSyntaxHighlighterNames[Result]) = 0) then
exit; exit;
Result := lshFreePascal; Result := lshFreePascal;
end; end;
@ -2464,7 +2464,7 @@ end;
function TEditOptLangList.FindByName(const Name: String): Integer; function TEditOptLangList.FindByName(const Name: String): Integer;
begin begin
Result := Count - 1; Result := Count - 1;
while (Result >= 0) and (AnsiCompareText( while (Result >= 0) and (UTF8CompareText(
Items[Result].SynClass.GetLanguageName, Name) <> 0) do Items[Result].SynClass.GetLanguageName, Name) <> 0) do
dec(Result); dec(Result);
end; end;

View File

@ -421,7 +421,7 @@ var
begin begin
i:=TypeRadiogroup.ItemIndex; i:=TypeRadiogroup.ItemIndex;
for Result:=Low(TEncloseSelectionType) to High(TEncloseSelectionType) do for Result:=Low(TEncloseSelectionType) to High(TEncloseSelectionType) do
if AnsiCompareText(TypeRadiogroup.Items[i], if UTF8CompareText(TypeRadiogroup.Items[i],
EncloseSelectionTypeDescription(Result))=0 EncloseSelectionTypeDescription(Result))=0
then then
exit; exit;

View File

@ -166,7 +166,7 @@ procedure TEditorMouseOptionsAdvFrame.ActionGridCompareCells(Sender: TObject; AC
Result := ord(TSynEditMouseAction(TStringGrid(Sender).Objects[0, BRow]).ClickDir) Result := ord(TSynEditMouseAction(TStringGrid(Sender).Objects[0, BRow]).ClickDir)
- ord(TSynEditMouseAction(TStringGrid(Sender).Objects[0, ARow]).ClickDir); - ord(TSynEditMouseAction(TStringGrid(Sender).Objects[0, ARow]).ClickDir);
else 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;
end; end;
var var

View File

@ -93,7 +93,7 @@ begin
cmp := 1; cmp := 1;
while (NewPos < FormsAvailFormsListBox.Items.Count) do while (NewPos < FormsAvailFormsListBox.Items.Count) do
begin begin
cmp := AnsiCompareText(FormsAvailFormsListBox.Items[NewPos], OldFormName); cmp := CompareText(FormsAvailFormsListBox.Items[NewPos], OldFormName);
if cmp < 0 then if cmp < 0 then
Inc(NewPos) Inc(NewPos)
else else
@ -222,7 +222,7 @@ var
p := Pos(':', FormsAutoCreatedListBox.Items[Result]); p := Pos(':', FormsAutoCreatedListBox.Items[Result]);
if p < 1 then if p < 1 then
p := Length(FormsAutoCreatedListBox.Items[Result]) + 1; 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 FormName) = 0 then
Exit; Exit;
Dec(Result); Dec(Result);

View File

@ -265,7 +265,7 @@ procedure CheckList(List: TList; TestListNil, TestDoubles, TestNils: boolean);
procedure CheckList(List: TFPList; TestListNil, TestDoubles, TestNils: boolean); procedure CheckList(List: TFPList; TestListNil, TestDoubles, TestNils: boolean);
procedure CheckEmptyListCut(List1, List2: TList); procedure CheckEmptyListCut(List1, List2: TList);
procedure RemoveDoubles(List: TStrings); 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: TList);
procedure ReverseList(List: TFPList); procedure ReverseList(List: TFPList);
procedure FreeListObjects(List: TList; FreeList: boolean); procedure FreeListObjects(List: TList; FreeList: boolean);
@ -1365,13 +1365,13 @@ begin
end; 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 begin
if List=nil then exit(-1); if List=nil then exit(-1);
Result:=List.Count-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; end;
{------------------------------------------------------------------------------- {-------------------------------------------------------------------------------
@ -2751,7 +2751,7 @@ begin
for i:=0 to List.Count-1 do begin for i:=0 to List.Count-1 do begin
case Cmp of case Cmp of
cstCaseSensitive: if List[i]=s then exit(i); 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); cstFilename: if CompareFilenames(List[i],s)=0 then exit(i);
end; end;
end; end;

View File

@ -930,7 +930,7 @@ end;
function THistoryLists.IndexOfName(const Name: string): integer; function THistoryLists.IndexOfName(const Name: string): integer;
begin begin
Result:=Count-1; 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); dec(Result);
end; end;

View File

@ -7404,7 +7404,7 @@ begin
GetFixupReferenceNames(CurRoot,ReferenceRootNames); GetFixupReferenceNames(CurRoot,ReferenceRootNames);
for j:=0 to ReferenceRootNames.Count-1 do begin for j:=0 to ReferenceRootNames.Count-1 do begin
RefRootName:=ReferenceRootNames[j]; RefRootName:=ReferenceRootNames[j];
if AnsiSearchInStringList(LoadingReferenceNames,RefRootName)>=0 if UTF8SearchInStringList(LoadingReferenceNames,RefRootName)>=0
then then
continue; continue;
ReferenceInstanceNames.Clear; ReferenceInstanceNames.Clear;
@ -12029,12 +12029,12 @@ begin
try try
if not CodeToolBoss.FindUsedUnitNames(MainUnitInfo.Source, if not CodeToolBoss.FindUsedUnitNames(MainUnitInfo.Source,
MainUsesSection,ImplementationUsesSection) then exit; MainUsesSection,ImplementationUsesSection) then exit;
if (AnsiSearchInStringList(MainUsesSection,'forms')<0) if (UTF8SearchInStringList(MainUsesSection,'forms')<0)
and (AnsiSearchInStringList(ImplementationUsesSection,'forms')<0) then and (UTF8SearchInStringList(ImplementationUsesSection,'forms')<0) then
exit; exit;
// project uses lcl unit Forms // project uses lcl unit Forms
if (AnsiSearchInStringList(MainUsesSection,'interfaces')>=0) if (UTF8SearchInStringList(MainUsesSection,'interfaces')>=0)
or (AnsiSearchInStringList(ImplementationUsesSection,'interfaces')>=0) then or (UTF8SearchInStringList(ImplementationUsesSection,'interfaces')>=0) then
exit; exit;
// project uses lcl unit Forms, but not unit interfaces // project uses lcl unit Forms, but not unit interfaces
// this will result in strange linker error // this will result in strange linker error

View File

@ -521,7 +521,7 @@ var
begin begin
if Identifier<>'' then begin if Identifier<>'' then begin
for i:=0 to ResStrWithSameValuesCombobox.Items.Count-1 do 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 then begin
Result:=true; Result:=true;
exit; exit;

View File

@ -123,14 +123,14 @@ const
function SortDirectionNameToType(const s: string): TSortDirection; function SortDirectionNameToType(const s: string): TSortDirection;
begin begin
for Result:=Low(TSortDirection) to High(TSortDirection) do 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; Result:=sdAscending;
end; end;
function SortDomainNameToType(const s: string): TSortDomain; function SortDomainNameToType(const s: string): TSortDomain;
begin begin
for Result:=Low(TSortDomain) to High(TSortDomain) do 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; Result:=sdLines;
end; end;
@ -139,14 +139,14 @@ function ResourcestringInsertPolicyNameToType(
begin begin
for Result:=Low(TResourcestringInsertPolicy) for Result:=Low(TResourcestringInsertPolicy)
to High(TResourcestringInsertPolicy) do to High(TResourcestringInsertPolicy) do
if AnsiCompareText(ResourcestringInsertPolicyNames[Result],s)=0 then exit; if CompareText(ResourcestringInsertPolicyNames[Result],s)=0 then exit;
Result:=rsipAppend; Result:=rsipAppend;
end; end;
function FindRenameScopeNameToScope(const s: string): TFindRenameScope; function FindRenameScopeNameToScope(const s: string): TFindRenameScope;
begin begin
for Result:=Low(TFindRenameScope) to High(TFindRenameScope) do 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; Result:=frAllOpenProjectsAndPackages;
end; end;

View File

@ -471,7 +471,7 @@ end;
function TNewLazIDEItemCategories.IndexOf(const CategoryName: string): integer; function TNewLazIDEItemCategories.IndexOf(const CategoryName: string): integer;
begin begin
Result := Count - 1; 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); Dec(Result);
end; end;

View File

@ -4076,9 +4076,9 @@ begin
if ((OnlyProjectUnits and Units[Result].IsPartOfProject) if ((OnlyProjectUnits and Units[Result].IsPartOfProject)
or (not OnlyProjectUnits)) or (not OnlyProjectUnits))
and (IgnoreUnit<>Units[Result]) then begin 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) or ((Units[Result].Component<>nil)
and (AnsiCompareText(Units[Result].Component.Name,AComponentName)=0)) and (CompareText(Units[Result].Component.Name,AComponentName)=0))
then then
exit; exit;
end; end;

View File

@ -1074,7 +1074,7 @@ end;
function TLazProjectFileDescriptors.IndexOf(const Name: string): integer; function TLazProjectFileDescriptors.IndexOf(const Name: string): integer;
begin begin
Result:=Count-1; 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); dec(Result);
end; end;
@ -1198,7 +1198,7 @@ end;
function TLazProjectDescriptors.IndexOf(const Name: string): integer; function TLazProjectDescriptors.IndexOf(const Name: string): integer;
begin begin
Result:=Count-1; 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); dec(Result);
end; end;

View File

@ -1945,7 +1945,7 @@ begin
while (x<=length(s)) and (s[x]<>#3) do inc(x); while (x<=length(s)) and (s[x]<>#3) do inc(x);
if x<length(s) then begin if x<length(s) then begin
inc(x,2); inc(x,2);
if AnsiCompareText(CurStr,copy(s,x,length(CurStr)))=0 then begin if UTF8CompareText(CurStr,copy(s,x,length(CurStr)))=0 then begin
APosition:=i; APosition:=i;
break; break;
end; end;
@ -4006,7 +4006,7 @@ begin
else else
SrcToken:=copy(Line,length(Line)-length(AToken)+1,length(AToken)); SrcToken:=copy(Line,length(Line)-length(AToken)+1,length(AToken));
//DebugLn(['TSourceEditor.AutoCompleteChar ',AToken,' SrcToken=',SrcToken,' CatName=',CatName,' Index=',Manager.CodeTemplateModul.CompletionAttributes[i].IndexOfName(CatName)]); //DebugLn(['TSourceEditor.AutoCompleteChar ',AToken,' SrcToken=',SrcToken,' CatName=',CatName,' Index=',Manager.CodeTemplateModul.CompletionAttributes[i].IndexOfName(CatName)]);
if (AnsiCompareText(AToken,SrcToken)=0) if (UTF8CompareText(AToken,SrcToken)=0)
and (Manager.CodeTemplateModul.CompletionAttributes[i].IndexOfName(CatName)>=0) and (Manager.CodeTemplateModul.CompletionAttributes[i].IndexOfName(CatName)>=0)
and ( (not FEditor.SelAvail) or and ( (not FEditor.SelAvail) or
(Manager.CodeTemplateModul.CompletionAttributes[i].IndexOfName( (Manager.CodeTemplateModul.CompletionAttributes[i].IndexOfName(
@ -9373,7 +9373,7 @@ var
for a := 0 to SourceEditorCount - 1 do begin for a := 0 to SourceEditorCount - 1 do begin
if (SourceEditors[a] <> IgnoreEditor) and if (SourceEditors[a] <> IgnoreEditor) and
(not SourceEditors[a].IsSharedWith(IgnoreEditor)) and (not SourceEditors[a].IsSharedWith(IgnoreEditor)) and
(AnsiCompareText(AName, SourceEditors[a].PageName) = 0) (CompareText(AName, SourceEditors[a].PageName) = 0)
then begin then begin
Result:=true; Result:=true;
exit; exit;

View File

@ -261,7 +261,7 @@ begin
m:=0; m:=0;
while l<=r do begin while l<=r do begin
m:=(l+r) shr 1; m:=(l+r) shr 1;
cmp:=AnsiCompareText(NewMacro.Name,Items[m].Name); cmp:=UTF8CompareText(NewMacro.Name,Items[m].Name);
if cmp<0 then if cmp<0 then
r:=m-1 r:=m-1
else if cmp>0 then else if cmp>0 then
@ -269,7 +269,7 @@ begin
else else
break; break;
end; end;
if (m<fItems.Count) and (AnsiCompareText(NewMacro.Name,Items[m].Name)>0) then if (m<fItems.Count) and (UTF8CompareText(NewMacro.Name,Items[m].Name)>0) then
inc(m); inc(m);
fItems.Insert(m,NewMacro); fItems.Insert(m,NewMacro);
//if NewMacro.MacroFunction<>nil then //if NewMacro.MacroFunction<>nil then
@ -483,7 +483,7 @@ begin
while l<=r do begin while l<=r do begin
m:=(l+r) shr 1; m:=(l+r) shr 1;
Result:=Items[m]; Result:=Items[m];
cmp:=AnsiCompareText(MacroName,Result.Name); cmp:=UTF8CompareText(MacroName,Result.Name);
if cmp<0 then if cmp<0 then
r:=m-1 r:=m-1
else if cmp>0 then else if cmp>0 then

View File

@ -849,7 +849,7 @@ begin
end; end;
// check unitname - filename redundancy // check unitname - filename redundancy
if AnsiCompareText(Params.Unit_name,ExtractFileNameOnly(Params.UnitFilename))<>0 if CompareText(Params.Unit_name,ExtractFileNameOnly(Params.UnitFilename))<>0
then begin then begin
IDEMessageDialog(lisA2PUnitNameInvalid, IDEMessageDialog(lisA2PUnitNameInvalid,
Format(lisA2PTheUnitNameDoesNotCorrespondToTheFilename, ['"',Params.Unit_Name, '"']), Format(lisA2PTheUnitNameDoesNotCorrespondToTheFilename, ['"',Params.Unit_Name, '"']),
@ -866,7 +866,7 @@ begin
end; end;
// check classname<>ancestortype // check classname<>ancestortype
if AnsiCompareText(Params.NewClassName,Params.AncestorType)=0 then begin if CompareText(Params.NewClassName,Params.AncestorType)=0 then begin
IDEMessageDialog(lisA2PInvalidCircularDependency, IDEMessageDialog(lisA2PInvalidCircularDependency,
Format(lisA2PTheClassNameAndAncestorTypeAreTheSame, ['"',Params.NewClassName, '"', '"', Params.AncestorType, '"']), Format(lisA2PTheClassNameAndAncestorTypeAreTheSame, ['"',Params.NewClassName, '"', '"', Params.AncestorType, '"']),
mtError,[mbCancel]); mtError,[mbCancel]);

View File

@ -4726,7 +4726,7 @@ end;
function TLazPackageDescriptors.IndexOf(const Name: string): integer; function TLazPackageDescriptors.IndexOf(const Name: string): integer;
begin begin
Result:=Count-1; 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); dec(Result);
end; end;

View File

@ -28,7 +28,7 @@ interface
uses uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,
Buttons, FileUtil, lazutf8classes, IDEProcs, UFrmAddComponent; Buttons, FileUtil, lazutf8classes, LazUTF8, IDEProcs, UFrmAddComponent;
Type Type
TRComponent = class(TObject) TRComponent = class(TObject)
@ -376,7 +376,7 @@ begin
MyObj2 := ListComps.Items.Objects[J] as TRComponent; MyObj2 := ListComps.Items.Objects[J] as TRComponent;
//messagedlg('Comparing object '+MyObj.Name+' at '+inttostr(I)+' with '+MyObj2.Name, mtInformation,[mbOk],0); //messagedlg('Comparing object '+MyObj.Name+' at '+inttostr(I)+' with '+MyObj2.Name, mtInformation,[mbOk],0);
if assigned(MyOBj2) then begin 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; // if assigned
end; // for J end; // for J
end; // For I end; // For I