浏览代码

* corrected some typo that was inserted by r13853

git-svn-id: trunk@13854 -
ivost 16 年之前
父节点
当前提交
242560f138
共有 1 个文件被更改,包括 7 次插入7 次删除
  1. 7 7
      rtl/objpas/classes/compon.inc

+ 7 - 7
rtl/objpas/classes/compon.inc

@@ -18,10 +18,10 @@
 Function  TComponent.GetComponent(AIndex: Integer): TComponent;
 Function  TComponent.GetComponent(AIndex: Integer): TComponent;
 
 
 begin
 begin
-  If not assigned(FComponents) then
-    Result:=Nil
+  If assigned(FComponents) then
+    Result:=TComponent(FComponents.Items[Aindex])
   else
   else
-    Result:=TComponent(FComponents.Items[Aindex]);
+    Result:=Nil;
 end;
 end;
 
 
 function TComponent.IsImplementorOf (const Intf:IInterface):boolean;
 function TComponent.IsImplementorOf (const Intf:IInterface):boolean;
@@ -40,10 +40,10 @@ end;
 Function  TComponent.GetComponentCount: Integer;
 Function  TComponent.GetComponentCount: Integer;
 
 
 begin
 begin
-  If not assigned(FComponents) then
-    result:=0
+  If assigned(FComponents) then
+    Result:=FComponents.Count
   else
   else
-    Result:=FComponents.Count;
+    result:=0
 end;
 end;
 
 
 
 
@@ -423,7 +423,7 @@ begin
     L := FFreeNotifies;
     L := FFreeNotifies;
     FFreenotifies:=Nil;
     FFreenotifies:=Nil;
     for I := L.Count - 1 downto 0 do
     for I := L.Count - 1 downto 0 do
-      TComponent(FFreeNotifies.Items[I]).Notification(self,opRemove);
+      TComponent(L.Items[I]).Notification(self,opRemove);
     L.Free;
     L.Free;
     end;
     end;
   DestroyComponents;
   DestroyComponents;