You've already forked lazarus-ccr
TBaseComplexSimpleContentRemotable.Save/Load : persist attributes using their registered external name.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1039 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -5173,6 +5173,7 @@ Var
|
|||||||
p : PPropInfo;
|
p : PPropInfo;
|
||||||
oldSS : TSerializationStyle;
|
oldSS : TSerializationStyle;
|
||||||
tr : TTypeRegistry;
|
tr : TTypeRegistry;
|
||||||
|
regItem : TTypeRegistryItem;
|
||||||
propName : string;
|
propName : string;
|
||||||
begin
|
begin
|
||||||
oldSS := AStore.GetSerializationStyle();
|
oldSS := AStore.GetSerializationStyle();
|
||||||
@ -5188,11 +5189,12 @@ begin
|
|||||||
propListLen := GetPropList(ATypeInfo,propList);
|
propListLen := GetPropList(ATypeInfo,propList);
|
||||||
try
|
try
|
||||||
tr := GetTypeRegistry();
|
tr := GetTypeRegistry();
|
||||||
|
regItem := tr.ItemByTypeInfo[ATypeInfo];
|
||||||
AStore.SetSerializationStyle(ssAttibuteSerialization);
|
AStore.SetSerializationStyle(ssAttibuteSerialization);
|
||||||
for i := 0 to Pred(propCount) do begin
|
for i := 0 to Pred(propCount) do begin
|
||||||
p := propList^[i];
|
p := propList^[i];
|
||||||
pt := p^.PropType{$IFDEF WST_DELPHI}^{$ENDIF};
|
pt := p^.PropType{$IFDEF WST_DELPHI}^{$ENDIF};
|
||||||
propName := tr.ItemByTypeInfo[pt].GetExternalPropertyName(p^.Name);
|
propName := regItem.GetExternalPropertyName(p^.Name);
|
||||||
if IsStoredProp(AObject,p) then begin
|
if IsStoredProp(AObject,p) then begin
|
||||||
case pt^.Kind of
|
case pt^.Kind of
|
||||||
tkInt64{$IFDEF HAS_QWORD},tkQWord{$ENDIF} :
|
tkInt64{$IFDEF HAS_QWORD},tkQWord{$ENDIF} :
|
||||||
@ -5336,6 +5338,7 @@ Var
|
|||||||
objTypeData : PTypeData;
|
objTypeData : PTypeData;
|
||||||
oldSS : TSerializationStyle;
|
oldSS : TSerializationStyle;
|
||||||
tr : TTypeRegistry;
|
tr : TTypeRegistry;
|
||||||
|
regItem : TTypeRegistryItem;
|
||||||
begin
|
begin
|
||||||
oldSS := AStore.GetSerializationStyle();
|
oldSS := AStore.GetSerializationStyle();
|
||||||
if ( AStore.BeginObjectRead(AName,ATypeInfo) >= 0 ) then begin
|
if ( AStore.BeginObjectRead(AName,ATypeInfo) >= 0 ) then begin
|
||||||
@ -5351,13 +5354,14 @@ begin
|
|||||||
propListLen := GetPropList(ATypeInfo,propList);
|
propListLen := GetPropList(ATypeInfo,propList);
|
||||||
Try
|
Try
|
||||||
tr := GetTypeRegistry();
|
tr := GetTypeRegistry();
|
||||||
|
regItem := tr.ItemByTypeInfo[ATypeInfo];
|
||||||
AStore.SetSerializationStyle(ssAttibuteSerialization);
|
AStore.SetSerializationStyle(ssAttibuteSerialization);
|
||||||
For i := 0 To Pred(propCount) Do Begin
|
For i := 0 To Pred(propCount) Do Begin
|
||||||
p := propList^[i];
|
p := propList^[i];
|
||||||
persistType := IsStoredPropClass(objTypeData^.ClassType,p);
|
persistType := IsStoredPropClass(objTypeData^.ClassType,p);
|
||||||
If ( persistType in [pstOptional,pstAlways] ) Then Begin
|
If ( persistType in [pstOptional,pstAlways] ) Then Begin
|
||||||
pt := p^.PropType{$IFDEF WST_DELPHI}^{$ENDIF};
|
pt := p^.PropType{$IFDEF WST_DELPHI}^{$ENDIF};
|
||||||
propName := tr.ItemByTypeInfo[pt].GetExternalPropertyName(p^.Name);
|
propName := regItem.GetExternalPropertyName(p^.Name);
|
||||||
try
|
try
|
||||||
Case pt^.Kind Of
|
Case pt^.Kind Of
|
||||||
tkInt64{$IFDEF HAS_QWORD},tkQWord{$ENDIF} :
|
tkInt64{$IFDEF HAS_QWORD},tkQWord{$ENDIF} :
|
||||||
|
Reference in New Issue
Block a user