IDE: rename components: check for registered component classes

git-svn-id: trunk@13433 -
This commit is contained in:
mattias 2007-12-23 10:44:39 +00:00
parent 1816c3aa0a
commit e9fbae171e

View File

@ -12118,6 +12118,7 @@ var
OldName: String;
OldClassName: String;
OldOpenEditorsOnCodeToolChange: Boolean;
RegComp: TRegisteredComponent;
procedure ApplyBossResult(const ErrorMsg: string);
var
@ -12313,6 +12314,12 @@ begin
raise Exception.Create(Format(lisComponentNameIsKeyword, ['"', Newname, '"']
));
RegComp:=IDEComponentPalette.FindComponent(NewName);
if RegComp<>nil then begin
s:='There is already a component class with the name '+RegComp.ComponentClass.ClassName;
raise EComponentError.Create(s);
end;
OldOpenEditorsOnCodeToolChange:=OpenEditorsOnCodeToolChange;
OpenEditorsOnCodeToolChange:=true;
try