FCL TComponent.ValidateRename is case sensitive. Added case insensitive check in TDesigner

git-svn-id: trunk@9047 -
This commit is contained in:
mattias 2006-03-30 09:41:46 +00:00
parent 13302aeb6c
commit de888c86b3
2 changed files with 24 additions and 1 deletions

View File

@ -1966,7 +1966,28 @@ end;
procedure TDesigner.ValidateRename(AComponent: TComponent;
const CurName, NewName: string);
Begin
procedure RaiseInvalidName(ConflictComponent: TComponent);
begin
raise EComponentError.Create(Format(
lisDesThereIsAlreadyAnotherComponentWithTheName, ['"',
ConflictComponent.Name, '"']));
end;
var
i: Integer;
CurComponent: TComponent;
begin
// check, if there is already such a component
for i:=0 to FLookupRoot.ComponentCount-1 do begin
CurComponent:=FLookupRoot.Components[i];
//DebugLn('TDesigner.ValidateRename ',CurComponent.Name,' ',NewName);
if (CurComponent<>AComponent)
and (CompareText(CurComponent.Name,NewName)=0) then begin
RaiseInvalidName(CurComponent);
end;
end;
// check if component is initialized
if (CurName='') or (NewName='')
or ((AComponent<>nil) and (csDestroying in AComponent.ComponentState)) then

View File

@ -1271,6 +1271,8 @@ resourcestring
lisThereWasAnErrorWhileCopyingTheComponentStreamToCli = 'There was an error '
+'while copying the component stream to clipboard:%s%s';
lisErrorIn = 'Error in %s';
lisDesThereIsAlreadyAnotherComponentWithTheName = 'There is already another '
+'component with the name %s%s%s.';
lisTheComponentEditorOfClassInvokedWithVerbHasCreated = 'The component '
+'editor of class %s%s%s%sinvoked with verb #%s %s%s%s%shas created the '
+'error:%s%s%s%s';