mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 02:19:32 +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
|
Result:=C^.EditorClass
|
||||||
else begin
|
else begin
|
||||||
if (PropType^.Kind<>tkClass)
|
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]
|
Result:=PropClassMap[PropType^.Kind]
|
||||||
else
|
else
|
||||||
Result:=nil;
|
Result:=nil;
|
||||||
|
@ -91,13 +91,14 @@ var
|
|||||||
|
|
||||||
function GetLookupRootForComponent(APersistent: TPersistent): TPersistent;
|
function GetLookupRootForComponent(APersistent: TPersistent): TPersistent;
|
||||||
var
|
var
|
||||||
AOwner: TPersistent;
|
AOwner: TPersistent = nil;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
Result := APersistent;
|
Result := APersistent;
|
||||||
if Result = nil then
|
if Result = nil then
|
||||||
Exit;
|
Exit;
|
||||||
repeat
|
repeat
|
||||||
|
if Result is TPersistent then
|
||||||
AOwner := TPersistentAccess(Result).GetOwner;
|
AOwner := TPersistentAccess(Result).GetOwner;
|
||||||
if (AOwner=nil) and (GetLookupRoots<>nil) then begin
|
if (AOwner=nil) and (GetLookupRoots<>nil) then begin
|
||||||
for i:=GetLookupRoots.Count-1 downto 0 do begin
|
for i:=GetLookupRoots.Count-1 downto 0 do begin
|
||||||
|
Loading…
Reference in New Issue
Block a user