mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 12:39:29 +02:00
Allow to use any class with RTTI for RunTimeTypeInfoControls (previously only using descendants of TPersistent was legal). Now is possible to use any ORM system with RTTI controls like mORMot. From Maciej.
git-svn-id: trunk@51089 -
This commit is contained in:
parent
c93f1b0a8b
commit
f4b38428a6
@ -2164,7 +2164,8 @@ begin
|
||||
Result:=C^.EditorClass
|
||||
else begin
|
||||
if (PropType^.Kind<>tkClass)
|
||||
or (GetTypeData(PropType)^.ClassType.InheritsFrom(TPersistent)) then
|
||||
or (GetTypeData(PropType)^.ClassType.InheritsFrom(TPersistent))
|
||||
or (GetTypeData(PropType)^.PropCount > 0) then
|
||||
Result:=PropClassMap[PropType^.Kind]
|
||||
else
|
||||
Result:=nil;
|
||||
|
@ -91,14 +91,15 @@ var
|
||||
|
||||
function GetLookupRootForComponent(APersistent: TPersistent): TPersistent;
|
||||
var
|
||||
AOwner: TPersistent;
|
||||
AOwner: TPersistent = nil;
|
||||
i: Integer;
|
||||
begin
|
||||
Result := APersistent;
|
||||
if Result = nil then
|
||||
Exit;
|
||||
repeat
|
||||
AOwner := TPersistentAccess(Result).GetOwner;
|
||||
if Result is TPersistent then
|
||||
AOwner := TPersistentAccess(Result).GetOwner;
|
||||
if (AOwner=nil) and (GetLookupRoots<>nil) then begin
|
||||
for i:=GetLookupRoots.Count-1 downto 0 do begin
|
||||
AOwner:=TGetLookupRoot(GetLookupRoots[i])(Result);
|
||||
|
Loading…
Reference in New Issue
Block a user