OfficeXml/autoclass/docx/TblW@DOCX.tsf

97 lines
2.5 KiB
Plaintext

type TblW = 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: TblW);override;
public
// attributes property
property W read ReadXmlAttrW write WriteXmlAttrW;
property Type read ReadXmlAttrType write WriteXmlAttrType;
function ReadXmlAttrW();
function WriteXmlAttrW(_value);
function ReadXmlAttrType();
function WriteXmlAttrType(_value);
public
// Attributes
XmlAttrW: OpenXmlAttribute;
XmlAttrType: OpenXmlAttribute;
end;
function TblW.Create();overload;
begin
{self.}Create(nil, "w", "tblW");
end;
function TblW.Create(_node: XmlNode);overload;
begin
class(OpenXmlElement).Create(_node: XmlNode);
end;
function TblW.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 TblW.Init();override;
begin
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
attributes_ := array();
attributes_pf_ := array(
pre + "w": makeweakref(thisFunction(WriteXmlAttrW)),
pre + "type": makeweakref(thisFunction(WriteXmlAttrType)),
);
sorted_child_ := array(
);
container_ := new TSOfficeContainer(sorted_child_);
end;
function TblW.Copy(_obj: TblW);override;
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
class(OpenXmlElement).Copy(_obj);
if not ifnil(_obj.W) then
{self.}W := _obj.W;
if not ifnil(_obj.Type) then
{self.}Type := _obj.Type;
tslassigning := tslassigning_backup;
end;
function TblW.ReadXmlAttrW();
begin
return {self.}XmlAttrW.Value;
end;
function TblW.WriteXmlAttrW(_value);
begin
if ifnil({self.}XmlAttrW) then
begin
{self.}XmlAttrW := new OpenXmlAttribute({self.}Prefix, "w", nil);
attributes_[length(attributes_)] := {self.}XmlAttrW;
end
{self.}XmlAttrW.Value := _value;
end;
function TblW.ReadXmlAttrType();
begin
return {self.}XmlAttrType.Value;
end;
function TblW.WriteXmlAttrType(_value);
begin
if ifnil({self.}XmlAttrType) then
begin
{self.}XmlAttrType := new OpenXmlAttribute({self.}Prefix, "type", nil);
attributes_[length(attributes_)] := {self.}XmlAttrType;
end
{self.}XmlAttrType.Value := _value;
end;