OfficeXml/autoclass/docx/Sz@DOCX.tsf

75 lines
1.8 KiB
Plaintext

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