Browse Source

+ Fixed typinfo count of properties

michael 27 years ago
parent
commit
b661b37184
1 changed files with 9 additions and 5 deletions
  1. 9 5
      rtl/objpas/typinfo.pp

+ 9 - 5
rtl/objpas/typinfo.pp

@@ -357,8 +357,12 @@ unit typinfo;
           
           
       begin
       begin
       TD:=GetTypeData(TypeInfo);
       TD:=GetTypeData(TypeInfo);
-      Count:=TD^.PropCount;
-      TP:=PPropInfo(@TD^.UnitName+Length(TD^.UnitName)+1);
+      // Get this objects published properties count 
+      // Delphi uses propdata for this...
+      TP:=(@TD^.UnitName+Length(TD^.UnitName)+1);
+      Count:=PLongint(TP)^;
+      // Now point TP to first propinfo record.
+      Inc(Longint(TP),SizeOF(Word));
       While Count>0 do
       While Count>0 do
         begin
         begin
         PropList^[0]:=TP;
         PropList^[0]:=TP;
@@ -405,7 +409,7 @@ unit typinfo;
           GetMem(TempList,Count*SizeOf(Pointer));
           GetMem(TempList,Count*SizeOf(Pointer));
           Try
           Try
             GetPropInfos(TypeInfo,TempList);
             GetPropInfos(TypeInfo,TempList);
-            For I:=0 to COunt-1 do
+            For I:=0 to Count-1 do
               begin
               begin
               PropInfo:=TempList^[i];
               PropInfo:=TempList^[i];
               If PropInfo^.PropType^.Kind in TypeKinds then
               If PropInfo^.PropType^.Kind in TypeKinds then
@@ -645,8 +649,8 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.12  1998-11-24 15:03:32  michael
-  Implemented most important methods.
+  Revision 1.13  1998-11-25 16:47:03  michael
+  + Fixed typinfo count of properties
 
 
   Revision 1.11  1998/09/24 23:45:28  peter
   Revision 1.11  1998/09/24 23:45:28  peter
     * updated for auto objpas loading
     * updated for auto objpas loading