type R = 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: R);override; public // attributes property property WRsidRPr read ReadXmlAttrWRsidRPr write WriteXmlAttrWRsidRPr; property Anchor read ReadXmlAttrAnchor write WriteXmlAttrAnchor; property History read ReadXmlAttrHistory write WriteXmlAttrHistory; function ReadXmlAttrWRsidRPr(); function WriteXmlAttrWRsidRPr(_value); function ReadXmlAttrAnchor(); function WriteXmlAttrAnchor(_value); function ReadXmlAttrHistory(); function WriteXmlAttrHistory(_value); // empty property property Separator read ReadXmlChildSeparator write WriteXmlChildSeparator; property ContinuationSeparator read ReadXmlChildContinuationSeparator write WriteXmlChildContinuationSeparator; property LastRenderedPageBreak read ReadXmlChildLastRenderedPageBreak write WriteXmlChildLastRenderedPageBreak; function ReadXmlChildSeparator(); function WriteXmlChildSeparator(_value); function ReadXmlChildContinuationSeparator(); function WriteXmlChildContinuationSeparator(_value); function ReadXmlChildLastRenderedPageBreak(); function WriteXmlChildLastRenderedPageBreak(_value); // normal property property RPr read ReadXmlChildRPr; property Br read ReadXmlChildBr; property FldChar read ReadXmlChildFldChar; property InstrText read ReadXmlChildInstrText; property AlternateContent read ReadXmlChildAlternateContent; property Drawing read ReadXmlChildDrawing; property T read ReadXmlChildT; property FootnoteReference read ReadXmlChildFootnoteReference; function ReadXmlChildRPr(); function ReadXmlChildBr(); function ReadXmlChildFldChar(); function ReadXmlChildInstrText(); function ReadXmlChildAlternateContent(); function ReadXmlChildDrawing(); function ReadXmlChildT(); function ReadXmlChildFootnoteReference(); public // Attributes XmlAttrWRsidRPr: OpenXmlAttribute; XmlAttrAnchor: OpenXmlAttribute; XmlAttrHistory: OpenXmlAttribute; // Children XmlChildRPr: RPr; XmlChildBr: Br; XmlChildFldChar: FldChar; XmlChildInstrText: InstrText; XmlChildSeparator: OpenXmlEmpty; XmlChildContinuationSeparator: OpenXmlEmpty; XmlChildLastRenderedPageBreak: OpenXmlEmpty; XmlChildAlternateContent: AlternateContent; XmlChildDrawing: Drawing; XmlChildT: T; XmlChildFootnoteReference: FootnoteReference; end; function R.Create();overload; begin {self.}Create(nil, "w", "r"); end; function R.Create(_node: XmlNode);overload; begin class(OpenXmlElement).Create(_node: XmlNode); end; function R.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 R.Init();override; begin pre := {self.}Prefix ? {self.}Prefix + ":" : ""; attributes_ := array(); attributes_pf_ := array( "w:rsidRPr": makeweakref(thisFunction(WriteXmlAttrWRsidRPr)), "w:anchor": makeweakref(thisFunction(WriteXmlAttrAnchor)), "w:history": makeweakref(thisFunction(WriteXmlAttrHistory)), ); sorted_child_ := array( pre + "rPr": array(0, makeweakref(thisFunction(ReadXmlChildRPr))), pre + "br": array(1, makeweakref(thisFunction(ReadXmlChildBr))), pre + "fldChar": array(2, makeweakref(thisFunction(ReadXmlChildFldChar))), pre + "instrText": array(3, makeweakref(thisFunction(ReadXmlChildInstrText))), pre + "separator": array(4, makeweakref(thisFunction(ReadXmlChildSeparator))), pre + "continuationSeparator": array(5, makeweakref(thisFunction(ReadXmlChildContinuationSeparator))), pre + "lastRenderedPageBreak": array(6, makeweakref(thisFunction(ReadXmlChildLastRenderedPageBreak))), "mc:AlternateContent": array(7, makeweakref(thisFunction(ReadXmlChildAlternateContent))), pre + "drawing": array(8, makeweakref(thisFunction(ReadXmlChildDrawing))), pre + "t": array(9, makeweakref(thisFunction(ReadXmlChildT))), pre + "footnoteReference": array(10, makeweakref(thisFunction(ReadXmlChildFootnoteReference))), ); container_ := new TSOfficeContainer(sorted_child_); end; function R.Copy(_obj: R);override; begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); if not ifnil(_obj.WRsidRPr) then {self.}WRsidRPr := _obj.WRsidRPr; if not ifnil(_obj.Anchor) then {self.}Anchor := _obj.Anchor; if not ifnil(_obj.History) then {self.}History := _obj.History; if not ifnil(_obj.XmlChildRPr) then {self.}RPr.Copy(_obj.XmlChildRPr); if not ifnil(_obj.XmlChildBr) then {self.}Br.Copy(_obj.XmlChildBr); if not ifnil(_obj.XmlChildFldChar) then {self.}FldChar.Copy(_obj.XmlChildFldChar); if not ifnil(_obj.XmlChildInstrText) then {self.}InstrText.Copy(_obj.XmlChildInstrText); if not ifnil(_obj.XmlChildSeparator) then ifnil({self.}XmlChildSeparator) ? {self.}Separator.Copy(_obj.XmlChildSeparator) : {self.}XmlChildSeparator.Copy(_obj.XmlChildSeparator); if not ifnil(_obj.XmlChildContinuationSeparator) then ifnil({self.}XmlChildContinuationSeparator) ? {self.}ContinuationSeparator.Copy(_obj.XmlChildContinuationSeparator) : {self.}XmlChildContinuationSeparator.Copy(_obj.XmlChildContinuationSeparator); if not ifnil(_obj.XmlChildLastRenderedPageBreak) then ifnil({self.}XmlChildLastRenderedPageBreak) ? {self.}LastRenderedPageBreak.Copy(_obj.XmlChildLastRenderedPageBreak) : {self.}XmlChildLastRenderedPageBreak.Copy(_obj.XmlChildLastRenderedPageBreak); if not ifnil(_obj.XmlChildAlternateContent) then {self.}AlternateContent.Copy(_obj.XmlChildAlternateContent); if not ifnil(_obj.XmlChildDrawing) then {self.}Drawing.Copy(_obj.XmlChildDrawing); if not ifnil(_obj.XmlChildT) then {self.}T.Copy(_obj.XmlChildT); if not ifnil(_obj.XmlChildFootnoteReference) then {self.}FootnoteReference.Copy(_obj.XmlChildFootnoteReference); tslassigning := tslassigning_backup; end; function R.ReadXmlAttrWRsidRPr(); begin return {self.}XmlAttrWRsidRPr.Value; end; function R.WriteXmlAttrWRsidRPr(_value); begin if ifnil({self.}XmlAttrWRsidRPr) then begin {self.}XmlAttrWRsidRPr := new OpenXmlAttribute("w", "rsidRPr", nil); attributes_[length(attributes_)] := {self.}XmlAttrWRsidRPr; end {self.}XmlAttrWRsidRPr.Value := _value; end; function R.ReadXmlAttrAnchor(); begin return {self.}XmlAttrAnchor.Value; end; function R.WriteXmlAttrAnchor(_value); begin if ifnil({self.}XmlAttrAnchor) then begin {self.}XmlAttrAnchor := new OpenXmlAttribute("w", "anchor", nil); attributes_[length(attributes_)] := {self.}XmlAttrAnchor; end {self.}XmlAttrAnchor.Value := _value; end; function R.ReadXmlAttrHistory(); begin return {self.}XmlAttrHistory.Value; end; function R.WriteXmlAttrHistory(_value); begin if ifnil({self.}XmlAttrHistory) then begin {self.}XmlAttrHistory := new OpenXmlAttribute("w", "history", nil); attributes_[length(attributes_)] := {self.}XmlAttrHistory; end {self.}XmlAttrHistory.Value := _value; end; function R.ReadXmlChildSeparator(); begin if tslassigning and ifnil({self.}XmlChildSeparator) then begin {self.}XmlChildSeparator := new OpenXmlEmpty(self, {self.}Prefix, "separator"); container_.Set({self.}XmlChildSeparator); return {self.}XmlChildSeparator; end return {self.}XmlChildSeparator.BoolValue(); end; function R.WriteXmlChildSeparator(_value); begin if ifnil({self.}XmlChildSeparator) then begin {self.}XmlChildSeparator := new OpenXmlEmpty(self, {self.}Prefix, "separator"); container_.Set({self.}XmlChildSeparator); end {self.}XmlChildSeparator.Value := _value; end; function R.ReadXmlChildContinuationSeparator(); begin if tslassigning and ifnil({self.}XmlChildContinuationSeparator) then begin {self.}XmlChildContinuationSeparator := new OpenXmlEmpty(self, {self.}Prefix, "continuationSeparator"); container_.Set({self.}XmlChildContinuationSeparator); return {self.}XmlChildContinuationSeparator; end return {self.}XmlChildContinuationSeparator.BoolValue(); end; function R.WriteXmlChildContinuationSeparator(_value); begin if ifnil({self.}XmlChildContinuationSeparator) then begin {self.}XmlChildContinuationSeparator := new OpenXmlEmpty(self, {self.}Prefix, "continuationSeparator"); container_.Set({self.}XmlChildContinuationSeparator); end {self.}XmlChildContinuationSeparator.Value := _value; end; function R.ReadXmlChildLastRenderedPageBreak(); begin if tslassigning and ifnil({self.}XmlChildLastRenderedPageBreak) then begin {self.}XmlChildLastRenderedPageBreak := new OpenXmlEmpty(self, {self.}Prefix, "lastRenderedPageBreak"); container_.Set({self.}XmlChildLastRenderedPageBreak); return {self.}XmlChildLastRenderedPageBreak; end return {self.}XmlChildLastRenderedPageBreak.BoolValue(); end; function R.WriteXmlChildLastRenderedPageBreak(_value); begin if ifnil({self.}XmlChildLastRenderedPageBreak) then begin {self.}XmlChildLastRenderedPageBreak := new OpenXmlEmpty(self, {self.}Prefix, "lastRenderedPageBreak"); container_.Set({self.}XmlChildLastRenderedPageBreak); end {self.}XmlChildLastRenderedPageBreak.Value := _value; end; function R.ReadXmlChildRPr(); begin if tslassigning and ifnil({self.}XmlChildRPr) then begin {self.}XmlChildRPr := new RPr(self, {self.}Prefix, "rPr"); container_.Set({self.}XmlChildRPr); end return {self.}XmlChildRPr; end; function R.ReadXmlChildBr(); begin if tslassigning and ifnil({self.}XmlChildBr) then begin {self.}XmlChildBr := new Br(self, {self.}Prefix, "br"); container_.Set({self.}XmlChildBr); end return {self.}XmlChildBr; end; function R.ReadXmlChildFldChar(); begin if tslassigning and ifnil({self.}XmlChildFldChar) then begin {self.}XmlChildFldChar := new FldChar(self, {self.}Prefix, "fldChar"); container_.Set({self.}XmlChildFldChar); end return {self.}XmlChildFldChar; end; function R.ReadXmlChildInstrText(); begin if tslassigning and ifnil({self.}XmlChildInstrText) then begin {self.}XmlChildInstrText := new InstrText(self, {self.}Prefix, "instrText"); container_.Set({self.}XmlChildInstrText); end return {self.}XmlChildInstrText; end; function R.ReadXmlChildAlternateContent(); begin if tslassigning and ifnil({self.}XmlChildAlternateContent) then begin {self.}XmlChildAlternateContent := new AlternateContent(self, "mc", "AlternateContent"); container_.Set({self.}XmlChildAlternateContent); end return {self.}XmlChildAlternateContent; end; function R.ReadXmlChildDrawing(); begin if tslassigning and ifnil({self.}XmlChildDrawing) then begin {self.}XmlChildDrawing := new Drawing(self, {self.}Prefix, "drawing"); container_.Set({self.}XmlChildDrawing); end return {self.}XmlChildDrawing; end; function R.ReadXmlChildT(); begin if tslassigning and ifnil({self.}XmlChildT) then begin {self.}XmlChildT := new T(self, {self.}Prefix, "t"); container_.Set({self.}XmlChildT); end return {self.}XmlChildT; end; function R.ReadXmlChildFootnoteReference(); begin if tslassigning and ifnil({self.}XmlChildFootnoteReference) then begin {self.}XmlChildFootnoteReference := new FootnoteReference(self, {self.}Prefix, "footnoteReference"); container_.Set({self.}XmlChildFootnoteReference); end return {self.}XmlChildFootnoteReference; end;