Browse Source

* Fixed TComponent.ValidateRename

sg 22 years ago
parent
commit
ed747b102b
1 changed files with 5 additions and 2 deletions
  1. 5 2
      fcl/inc/compon.inc

+ 5 - 2
fcl/inc/compon.inc

@@ -336,7 +336,7 @@ Procedure TComponent.ValidateRename(AComponent: TComponent;
 
 
 begin
 begin
 //!! This contradicts the Delphi manual.
 //!! This contradicts the Delphi manual.
-  If (AComponent<>Nil) and (CurName<>NewName) and
+  If (AComponent<>Nil) and (CurName<>NewName) and (AComponent.Owner = Self) and
      (FindComponent(NewName)<>Nil) then
      (FindComponent(NewName)<>Nil) then
       raise EComponentError.Createfmt(SDuplicateName,[newname]);
       raise EComponentError.Createfmt(SDuplicateName,[newname]);
   If (csDesigning in FComponentState) and (FOwner<>Nil) then
   If (csDesigning in FComponentState) and (FOwner<>Nil) then
@@ -533,7 +533,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.8  2002-10-15 20:06:19  michael
+  Revision 1.9  2003-04-27 21:16:11  sg
+  * Fixed TComponent.ValidateRename
+
+  Revision 1.8  2002/10/15 20:06:19  michael
   + Fixed SetAncestor. Index was getting too big
   + Fixed SetAncestor. Index was getting too big
 
 
   Revision 1.7  2002/09/07 15:15:24  peter
   Revision 1.7  2002/09/07 15:15:24  peter