Explorar o código

* Merging revisions 45222 from trunk:
------------------------------------------------------------------------
r45222 | michael | 2020-05-02 17:49:58 +0200 (Sat, 02 May 2020) | 1 line

* Allow property list to be sorted (patch from Denis Grynuk, bug ID #36803)
------------------------------------------------------------------------

git-svn-id: branches/fixes_3_2@45225 -

michael %!s(int64=5) %!d(string=hai) anos
pai
achega
2e2f836a26
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      packages/fcl-base/src/rttiutils.pp

+ 4 - 4
packages/fcl-base/src/rttiutils.pp

@@ -47,7 +47,7 @@ type
     FSize: Integer;
     FSize: Integer;
     function Get(Index: Integer): PPropInfo;
     function Get(Index: Integer): PPropInfo;
   public
   public
-    constructor Create(AObject: TObject; Filter: TTypeKinds);
+    constructor Create(AObject: TObject; Filter: TTypeKinds; Sorted: Boolean = True);
     destructor Destroy; override;
     destructor Destroy; override;
     function Contains(P: PPropInfo): Boolean;
     function Contains(P: PPropInfo): Boolean;
     function Find(const AName: string): PPropInfo;
     function Find(const AName: string): PPropInfo;
@@ -157,14 +157,14 @@ end;
 
 
 { TPropInfoList }
 { TPropInfoList }
 
 
-constructor TPropInfoList.Create(AObject: TObject; Filter: TTypeKinds);
+constructor TPropInfoList.Create(AObject: TObject; Filter: TTypeKinds; Sorted: Boolean);
 begin
 begin
   if AObject <> nil then
   if AObject <> nil then
     begin
     begin
-    FCount := GetPropList(AObject.ClassInfo, Filter, nil);
+    FCount := GetPropList(AObject.ClassInfo, Filter, nil, Sorted);
     FSize := FCount * SizeOf(Pointer);
     FSize := FCount * SizeOf(Pointer);
     GetMem(FList, FSize);
     GetMem(FList, FSize);
-    GetPropList(AObject.ClassInfo, Filter, FList);
+    GetPropList(AObject.ClassInfo, Filter, FList, Sorted);
     end
     end
   else
   else
     begin
     begin