mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 05:50:21 +02:00
IDE: rename components: check for registered component classes
git-svn-id: trunk@13433 -
This commit is contained in:
parent
1816c3aa0a
commit
e9fbae171e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user