type Color = 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: Color);override; public // attributes property property Val read ReadXmlAttrVal write WriteXmlAttrVal; property ThemeColor read ReadXmlAttrThemeColor write WriteXmlAttrThemeColor; function ReadXmlAttrVal(); function WriteXmlAttrVal(_value); function ReadXmlAttrThemeColor(); function WriteXmlAttrThemeColor(_value); public // Attributes XmlAttrVal: OpenXmlAttribute; XmlAttrThemeColor: OpenXmlAttribute; end; function Color.Create();overload; begin {self.}Create(nil, "w", "color"); end; function Color.Create(_node: XmlNode);overload; begin class(OpenXmlElement).Create(_node: XmlNode); end; function Color.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 Color.Init();override; begin pre := {self.}Prefix ? {self.}Prefix + ":" : ""; attributes_ := array(); attributes_pf_ := array( pre + "val": makeweakref(thisFunction(WriteXmlAttrVal)), pre + "themeColor": makeweakref(thisFunction(WriteXmlAttrThemeColor)), ); sorted_child_ := array( ); container_ := new TSOfficeContainer(sorted_child_); end; function Color.Copy(_obj: Color);override; begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); if not ifnil(_obj.Val) then {self.}Val := _obj.Val; if not ifnil(_obj.ThemeColor) then {self.}ThemeColor := _obj.ThemeColor; tslassigning := tslassigning_backup; end; function Color.ReadXmlAttrVal(); begin return {self.}XmlAttrVal.Value; end; function Color.WriteXmlAttrVal(_value); begin if ifnil({self.}XmlAttrVal) then begin {self.}XmlAttrVal := new OpenXmlAttribute({self.}Prefix, "val", nil); attributes_[length(attributes_)] := {self.}XmlAttrVal; end {self.}XmlAttrVal.Value := _value; end; function Color.ReadXmlAttrThemeColor(); begin return {self.}XmlAttrThemeColor.Value; end; function Color.WriteXmlAttrThemeColor(_value); begin if ifnil({self.}XmlAttrThemeColor) then begin {self.}XmlAttrThemeColor := new OpenXmlAttribute({self.}Prefix, "themeColor", nil); attributes_[length(attributes_)] := {self.}XmlAttrThemeColor; end {self.}XmlAttrThemeColor.Value := _value; end;