Skip to content

Commit 146d428

Browse files
committed
Minor improvement in ExposeFields/Properties.
1 parent 458b5b2 commit 146d428

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

Source/WrapDelphi.pas

+3-13
Original file line numberDiff line numberDiff line change
@@ -3623,12 +3623,7 @@ class procedure TPyDelphiObject.ExposeFields(AClass: TClass;
36233623
Continue;
36243624

36253625
// Skip if the type cannot be handled
3626-
if not (LRttiField.FieldType.TypeKind in
3627-
[tkInteger, tkChar, tkFloat, tkString, tkWChar, tkLString, tkWString,
3628-
tkUString, tkInt64, tkVariant, tkEnumeration, tkSet, tkArray,
3629-
tkDynArray, tkClass, tkClassRef,
3630-
tkRecord{$IFDEF MANAGED_RECORD}, tkMRecord{$ENDIF}])
3631-
then
3626+
if LRttiField.FieldType.TypeKind in [tkUnknown, tkMethod, tkProcedure] then
36323627
Continue;
36333628

36343629
AddedFields := AddedFields + [LRttiField.Name];
@@ -3705,13 +3700,8 @@ class procedure TPyDelphiObject.ExposeProperties(AClass: TClass;
37053700
if not LRttiProperty.IsReadable then
37063701
Continue;
37073702

3708-
// Skip if the type cannot be handled (as with fields + tkMethod)
3709-
if not (LRttiProperty.PropertyType.TypeKind in
3710-
[tkInteger, tkChar, tkFloat, tkString, tkWChar, tkLString, tkWString,
3711-
tkUString, tkInt64, tkVariant, tkEnumeration, tkSet, tkArray,
3712-
tkDynArray, tkClass, tkClassRef, tkMethod,
3713-
tkRecord{$IFDEF MANAGED_RECORD}, tkMRecord{$ENDIF}])
3714-
then
3703+
// Skip if the type cannot be handled (as with fields - tkMethod)
3704+
if LRttiProperty.PropertyType.TypeKind in [tkUnknown, tkProcedure] then
37153705
Continue;
37163706

37173707
AddedProperties := AddedProperties + [LRttiProperty.Name];

0 commit comments

Comments
 (0)