Allow assignment for readonly object property.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9637 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
7830ba9937
commit
846ac6f77a
@ -5224,7 +5224,7 @@ begin
|
|||||||
p := propList^[i];
|
p := propList^[i];
|
||||||
sp := GetPropInfo(Source,p^.Name);
|
sp := GetPropInfo(Source,p^.Name);
|
||||||
if Assigned(sp) and Assigned(sp^.GetProc) and
|
if Assigned(sp) and Assigned(sp^.GetProc) and
|
||||||
Assigned(p^.SetProc)
|
((p^.PropType^.Kind = tkClass) or Assigned(p^.SetProc))
|
||||||
then begin
|
then begin
|
||||||
case p^.PropType^.Kind of
|
case p^.PropType^.Kind of
|
||||||
tkInt64{$IFDEF HAS_QWORD} ,tkQWord{$ENDIF} :
|
tkInt64{$IFDEF HAS_QWORD} ,tkQWord{$ENDIF} :
|
||||||
@ -5241,19 +5241,21 @@ begin
|
|||||||
begin
|
begin
|
||||||
srcObj := GetObjectProp(Source,p^.Name);
|
srcObj := GetObjectProp(Source,p^.Name);
|
||||||
dstObj := GetObjectProp(Self,p^.Name);
|
dstObj := GetObjectProp(Self,p^.Name);
|
||||||
if ( not Assigned(dstObj) ) and
|
if (dstObj <> nil) then begin
|
||||||
( Assigned(srcObj) and srcObj.InheritsFrom(TAbstractComplexRemotable) )
|
if ( not Assigned(dstObj) ) and
|
||||||
then begin
|
( Assigned(srcObj) and srcObj.InheritsFrom(TAbstractComplexRemotable) )
|
||||||
dstObj := TAbstractComplexRemotableClass(srcObj.ClassType).Create();
|
then begin
|
||||||
SetObjectProp(Self,p,dstObj);
|
dstObj := TAbstractComplexRemotableClass(srcObj.ClassType).Create();
|
||||||
end;
|
|
||||||
if Assigned(dstObj) then begin
|
|
||||||
if ( srcObj = nil ) then begin
|
|
||||||
FreeAndNil(dstObj);
|
|
||||||
SetObjectProp(Self,p,dstObj);
|
SetObjectProp(Self,p,dstObj);
|
||||||
end else begin
|
end;
|
||||||
if dstObj.InheritsFrom(TPersistent) and srcObj.InheritsFrom(TPersistent) then
|
if Assigned(dstObj) then begin
|
||||||
TPersistent(dstObj).Assign(TPersistent(srcObj));
|
if ( srcObj = nil ) then begin
|
||||||
|
FreeAndNil(dstObj);
|
||||||
|
SetObjectProp(Self,p,dstObj);
|
||||||
|
end else begin
|
||||||
|
if dstObj.InheritsFrom(TPersistent) and srcObj.InheritsFrom(TPersistent) then
|
||||||
|
TPersistent(dstObj).Assign(TPersistent(srcObj));
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user