소스 검색

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