type CommentRange = class(OpenXmlElement) public function Create();overload; function Create(_node: XmlNode);overload; function Create(_parent: tslobj; _prefix: string; _local_name: string);overload; function Init();override; function Copy(_obj: CommentRange);override; public // attributes property property Id read ReadXmlAttrId write WriteXmlAttrId; function ReadXmlAttrId(); function WriteXmlAttrId(_value); public // Attributes XmlAttrId: OpenXmlAttribute; end; function CommentRange.Create();overload; begin {self.}Create(nil, "w", ""); end; function CommentRange.Create(_node: XmlNode);overload; begin class(OpenXmlElement).Create(_node: XmlNode); end; function CommentRange.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; begin setsysparam(pn_calcctrlword(), getsysparam(pn_calcctrlword()) .| 0x200); class(OpenXmlElement).Create(_parent, _prefix, _local_name); end; function CommentRange.Init();override; begin pre := {self.}Prefix ? {self.}Prefix + ":" : ""; attributes_ := array(); attributes_pf_ := array( pre + "id": makeweakref(thisFunction(WriteXmlAttrId)), ); sorted_child_ := array( ); container_ := new TSOfficeContainer(sorted_child_); end; function CommentRange.Copy(_obj: CommentRange);override; begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); if not ifnil(_obj.Id) then {self.}Id := _obj.Id; tslassigning := tslassigning_backup; end; function CommentRange.ReadXmlAttrId(); begin return {self.}XmlAttrId.Value; end; function CommentRange.WriteXmlAttrId(_value); begin if ifnil({self.}XmlAttrId) then begin {self.}XmlAttrId := new OpenXmlAttribute({self.}Prefix, "id", nil); attributes_[length(attributes_)] := {self.}XmlAttrId; end {self.}XmlAttrId.Value := _value; end;