mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 20:09:10 +02:00
FCL TComponent.ValidateRename is case sensitive. Added case insensitive check in TDesigner
git-svn-id: trunk@9047 -
This commit is contained in:
parent
13302aeb6c
commit
de888c86b3
@ -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
|
||||
|
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user