On Fri, 13 Jan 2023, Wayne Sherman via fpc-devel wrote:

Some related misunderstandings:

1) When StopRecordPropertyChanges is called it destroys all the
change records (stored in TBits) in which case SaveToJSON saves ALL
the properties even if they were not loaded or modified previously.

That is why StopRecordPropertyChanges is called before loading.



2) Nothing in restbase.pp or TBaseObject calls MarkPropertyChanged
anyway, so no properties will get marked as modified during
TGoogleRestDescription.LoadFromJSON.

procedure TBaseObject.MarkPropertyChanged(AIndex: Integer);
begin
 If Assigned(FBits) then
   FBits.SetOn(GetParentPropCount+(AIndex shr IndexShift));
end;

Markpropertychanged is called in the setter of the properties generated by
the code generator: Check all generated units.

TGoogleRestDescription is readonly, it does not need that mechanism.


3) Both MarkPropertyChanged (above) and IsPropertyModified (below)
require the properties declarations to have indexes and
TGoogleRestDescription does not have indexes on any of its properties.

See above, point 2.

Michael.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to