OfficeXml/autoclass/docx/Zoom@DOCX.tsf

75 lines
1.9 KiB
Plaintext

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