type Ap = 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: Ap);override; public // normal property property PPr read ReadXmlChildPPr; property EndParaRPr read ReadXmlChildEndParaRPr; function ReadXmlChildPPr(); function ReadXmlChildEndParaRPr(); // multi property property Rs read ReadRs; function ReadRs(_index); function AddR(): AR; function AppendR(): AR; public // Children XmlChildPPr: APPr; XmlChildEndParaRPr: ARPr; end; function Ap.Create();overload; begin {self.}Create(nil, "a", "p"); end; function Ap.Create(_node: XmlNode);overload; begin class(OpenXmlElement).Create(_node: XmlNode); end; function Ap.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 Ap.Init();override; begin pre := {self.}Prefix ? {self.}Prefix + ":" : ""; attributes_ := array(); attributes_pf_ := array( ); sorted_child_ := array( pre + "pPr": array(0, makeweakref(thisFunction(ReadXmlChildPPr))), pre + "endParaRPr": array(1, makeweakref(thisFunction(ReadXmlChildEndParaRPr))), pre + "r": array(2, makeweakref(thisFunction(AppendR))), ); container_ := new TSOfficeContainer(sorted_child_); end; function Ap.Copy(_obj: Ap);override; begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); if not ifnil(_obj.XmlChildPPr) then {self.}PPr.Copy(_obj.XmlChildPPr); if not ifnil(_obj.XmlChildEndParaRPr) then {self.}EndParaRPr.Copy(_obj.XmlChildEndParaRPr); tslassigning := tslassigning_backup; end; function Ap.ReadXmlChildPPr(); begin if tslassigning and ifnil({self.}XmlChildPPr) then begin {self.}XmlChildPPr := new APPr(self, {self.}Prefix, "pPr"); container_.Set({self.}XmlChildPPr); end return {self.}XmlChildPPr; end; function Ap.ReadXmlChildEndParaRPr(); begin if tslassigning and ifnil({self.}XmlChildEndParaRPr) then begin {self.}XmlChildEndParaRPr := new ARPr(self, {self.}Prefix, "endParaRPr"); container_.Set({self.}XmlChildEndParaRPr); end return {self.}XmlChildEndParaRPr; end; function Ap.ReadRs(_index); begin ind := ifnil(_index) ? -2 : _index; pre := {self.}Prefix ? {self.}Prefix + ":" : ""; return container_.Get(pre + "r", ind); end; function Ap.AddR(): AR; begin obj := new AR(self, {self.}Prefix, "r"); container_.Insert(obj); return obj; end; function Ap.AppendR(): AR; begin obj := new AR(self, {self.}Prefix, "r"); container_.Append(obj); return obj; end;