type Bookmark = 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: Bookmark);override; public // attributes property property Name read ReadXmlAttrName write WriteXmlAttrName; property Id read ReadXmlAttrId write WriteXmlAttrId; function ReadXmlAttrName(); function WriteXmlAttrName(_value); function ReadXmlAttrId(); function WriteXmlAttrId(_value); public // Attributes XmlAttrName: OpenXmlAttribute; XmlAttrId: OpenXmlAttribute; end; function Bookmark.Create();overload; begin {self.}Create(nil, "w", ""); end; function Bookmark.Create(_node: XmlNode);overload; begin class(OpenXmlElement).Create(_node: XmlNode); end; function Bookmark.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 Bookmark.Init();override; begin pre := {self.}Prefix ? {self.}Prefix + ":" : ""; attributes_ := array(); attributes_pf_ := array( pre + "name": makeweakref(thisFunction(WriteXmlAttrName)), pre + "id": makeweakref(thisFunction(WriteXmlAttrId)), ); sorted_child_ := array( ); container_ := new TSOfficeContainer(sorted_child_); end; function Bookmark.Copy(_obj: Bookmark);override; begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); if not ifnil(_obj.Name) then {self.}Name := _obj.Name; if not ifnil(_obj.Id) then {self.}Id := _obj.Id; tslassigning := tslassigning_backup; end; function Bookmark.ReadXmlAttrName(); begin return {self.}XmlAttrName.Value; end; function Bookmark.WriteXmlAttrName(_value); begin if ifnil({self.}XmlAttrName) then begin {self.}XmlAttrName := new OpenXmlAttribute({self.}Prefix, "name", nil); attributes_[length(attributes_)] := {self.}XmlAttrName; end {self.}XmlAttrName.Value := _value; end; function Bookmark.ReadXmlAttrId(); begin return {self.}XmlAttrId.Value; end; function Bookmark.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;