type BodyPr = class(OpenXmlElement) public function Create();overload; function Create(_node);overload; function Create(_parent, _prefix, _local_name);overload; function Init();override; function InitAttributes();override; function InitChildren();override; function InitNode(_node);override; function Copy(_obj);override; property Anchor read ReadXmlAttrAnchor write WriteXmlAttrAnchor; property Vert read ReadXmlAttrVert write WriteXmlAttrVert; property LIns read ReadXmlAttrLIns write WriteXmlAttrLIns; property TIns read ReadXmlAttrTIns write WriteXmlAttrTIns; property RIns read ReadXmlAttrRIns write WriteXmlAttrRIns; property BIns read ReadXmlAttrBIns write WriteXmlAttrBIns; property RtlCol read ReadXmlAttrRtlCol write WriteXmlAttrRtlCol; function ReadXmlAttrAnchor(); function WriteXmlAttrAnchor(_value); function ReadXmlAttrVert(); function WriteXmlAttrVert(_value); function ReadXmlAttrLIns(); function WriteXmlAttrLIns(_value); function ReadXmlAttrTIns(); function WriteXmlAttrTIns(_value); function ReadXmlAttrRIns(); function WriteXmlAttrRIns(_value); function ReadXmlAttrBIns(); function WriteXmlAttrBIns(_value); function ReadXmlAttrRtlCol(); function WriteXmlAttrRtlCol(_value); property NormAutoFit read ReadXmlChildNormAutoFit write WriteXmlChildNormAutoFit; function ReadXmlChildNormAutoFit(); function WriteXmlChildNormAutoFit(_value); public // Attributes XmlAttrAnchor; XmlAttrVert; XmlAttrLIns; XmlAttrTIns; XmlAttrRIns; XmlAttrBIns; XmlAttrRtlCol; // Children XmlChildNormAutoFit; end; function BodyPr.Create();overload; begin self.Create(nil, "a", "bodyPr"); end; function BodyPr.Create(_node);overload; begin class(OpenXmlElement).Create(_node); end; function BodyPr.Create(_parent, _prefix, _local_name);overload; begin class(OpenXmlElement).Create(_parent, _prefix, _local_name); end; function BodyPr.Init();override; begin self.XmlAttrAnchor := new OpenXmlAttribute(nil, "anchor", nil); self.XmlAttrVert := new OpenXmlAttribute(nil, "vert", nil); self.XmlAttrLIns := new OpenXmlAttribute(nil, "lIns", nil); self.XmlAttrTIns := new OpenXmlAttribute(nil, "tIns", nil); self.XmlAttrRIns := new OpenXmlAttribute(nil, "rIns", nil); self.XmlAttrBIns := new OpenXmlAttribute(nil, "bIns", nil); self.XmlAttrRtlCol := new OpenXmlAttribute(nil, "rtlCol", nil); self.XmlChildNormAutoFit := new OpenXmlEmpty(self, self.Prefix, "normAutofit"); end; function BodyPr.InitAttributes();override; begin attributes_ := array( self.XmlAttrAnchor, self.XmlAttrVert, self.XmlAttrLIns, self.XmlAttrTIns, self.XmlAttrRIns, self.XmlAttrBIns, self.XmlAttrRtlCol, ); end; function BodyPr.InitChildren();override; begin child_elements_ := array( 0: self.XmlChildNormAutoFit, ); sorted_child_ := array( "": -1, self.XmlChildNormAutoFit.ElementName: 0, ); end; function BodyPr.InitNode(_node);override; begin if ifObj(self.XmlNode) then for k,v in child_elements_ do v.InitNode(nil); self.XmlNode := ifObj(_node) ? _node : nil; node := ifObj(_node) ? _node.FirstChild() : nil; flag := false; if ifnil(child_elements_[0]) and length(child_elements_) > 0 then begin flag := true; arr := child_elements_; child_elements_ := array(); end pre := ifString(self.Prefix) ? self.Prefix + ":" : ""; while ifObj(node) do begin node_name := node.GetName(); pos := sorted_child_[node_name]; if ifnil(pos) or pos = -1 then begin obj := nil; case node_name of end; if ifObj(obj) then obj.InitNode(node); end else if flag then begin obj := arr[pos]; obj.InitNode(node); child_elements_[length(child_elements_)] := obj; end else begin child_elements_[pos].InitNode(node); end node := node.NextElement(); end end; function BodyPr.Copy(_obj);override; begin if not ifnil(_obj.XmlAttrAnchor.Value) then self.XmlAttrAnchor.Value := _obj.XmlAttrAnchor.Value; if not ifnil(_obj.XmlAttrVert.Value) then self.XmlAttrVert.Value := _obj.XmlAttrVert.Value; if not ifnil(_obj.XmlAttrLIns.Value) then self.XmlAttrLIns.Value := _obj.XmlAttrLIns.Value; if not ifnil(_obj.XmlAttrTIns.Value) then self.XmlAttrTIns.Value := _obj.XmlAttrTIns.Value; if not ifnil(_obj.XmlAttrRIns.Value) then self.XmlAttrRIns.Value := _obj.XmlAttrRIns.Value; if not ifnil(_obj.XmlAttrBIns.Value) then self.XmlAttrBIns.Value := _obj.XmlAttrBIns.Value; if not ifnil(_obj.XmlAttrRtlCol.Value) then self.XmlAttrRtlCol.Value := _obj.XmlAttrRtlCol.Value; self.XmlChildNormAutoFit.Copy(_obj.XmlChildNormAutoFit); end; function BodyPr.ReadXmlAttrAnchor(); begin return self.XmlAttrAnchor.Value; end; function BodyPr.WriteXmlAttrAnchor(_value); begin self.XmlAttrAnchor.Value := _value; end; function BodyPr.ReadXmlAttrVert(); begin return self.XmlAttrVert.Value; end; function BodyPr.WriteXmlAttrVert(_value); begin self.XmlAttrVert.Value := _value; end; function BodyPr.ReadXmlAttrLIns(); begin return self.XmlAttrLIns.Value; end; function BodyPr.WriteXmlAttrLIns(_value); begin self.XmlAttrLIns.Value := _value; end; function BodyPr.ReadXmlAttrTIns(); begin return self.XmlAttrTIns.Value; end; function BodyPr.WriteXmlAttrTIns(_value); begin self.XmlAttrTIns.Value := _value; end; function BodyPr.ReadXmlAttrRIns(); begin return self.XmlAttrRIns.Value; end; function BodyPr.WriteXmlAttrRIns(_value); begin self.XmlAttrRIns.Value := _value; end; function BodyPr.ReadXmlAttrBIns(); begin return self.XmlAttrBIns.Value; end; function BodyPr.WriteXmlAttrBIns(_value); begin self.XmlAttrBIns.Value := _value; end; function BodyPr.ReadXmlAttrRtlCol(); begin return self.XmlAttrRtlCol.Value; end; function BodyPr.WriteXmlAttrRtlCol(_value); begin self.XmlAttrRtlCol.Value := _value; end; function BodyPr.ReadXmlChildNormAutoFit(); begin return ifnil(self.XmlChildNormAutoFit.Value) ? false : true; end; function BodyPr.WriteXmlChildNormAutoFit(_value); begin self.XmlChildNormAutoFit.Value := _value; end;