94 lines
2.7 KiB
Plaintext
94 lines
2.7 KiB
Plaintext
type SizeRelH = 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: SizeRelH);override;
|
|
|
|
public
|
|
|
|
// attributes property
|
|
property RelativeFrom read ReadXmlAttrRelativeFrom write WriteXmlAttrRelativeFrom;
|
|
function ReadXmlAttrRelativeFrom();
|
|
function WriteXmlAttrRelativeFrom(_value);
|
|
|
|
// pcdata property
|
|
property PctWidth read ReadXmlChildPctWidth;
|
|
function ReadXmlChildPctWidth();
|
|
|
|
public
|
|
// Attributes
|
|
XmlAttrRelativeFrom: OpenXmlAttribute;
|
|
|
|
// Children
|
|
XmlChildPctWidth: OpenXmlPcdata;
|
|
|
|
end;
|
|
|
|
function SizeRelH.Create();overload;
|
|
begin
|
|
{self.}Create(nil, "wp14", "sizeRelH");
|
|
end;
|
|
|
|
function SizeRelH.Create(_node: XmlNode);overload;
|
|
begin
|
|
class(OpenXmlElement).Create(_node: XmlNode);
|
|
end;
|
|
|
|
function SizeRelH.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 SizeRelH.Init();override;
|
|
begin
|
|
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
|
|
attributes_ := array();
|
|
attributes_pf_ := array(
|
|
"relativeFrom": makeweakref(thisFunction(WriteXmlAttrRelativeFrom)),
|
|
);
|
|
sorted_child_ := array(
|
|
pre + "pctWidth": array(0, makeweakref(thisFunction(ReadXmlChildPctWidth))),
|
|
);
|
|
container_ := new TSOfficeContainer(sorted_child_);
|
|
end;
|
|
|
|
function SizeRelH.Copy(_obj: SizeRelH);override;
|
|
begin
|
|
tslassigning_backup := tslassigning;
|
|
tslassigning := 1;
|
|
class(OpenXmlElement).Copy(_obj);
|
|
if not ifnil(_obj.RelativeFrom) then
|
|
{self.}RelativeFrom := _obj.RelativeFrom;
|
|
if not ifnil(_obj.XmlChildPctWidth) then
|
|
{self.}PctWidth.Copy(_obj.XmlChildPctWidth);
|
|
tslassigning := tslassigning_backup;
|
|
end;
|
|
|
|
function SizeRelH.ReadXmlAttrRelativeFrom();
|
|
begin
|
|
return {self.}XmlAttrRelativeFrom.Value;
|
|
end;
|
|
|
|
function SizeRelH.WriteXmlAttrRelativeFrom(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrRelativeFrom) then
|
|
begin
|
|
{self.}XmlAttrRelativeFrom := new OpenXmlAttribute("", "relativeFrom", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrRelativeFrom;
|
|
end
|
|
{self.}XmlAttrRelativeFrom.Value := _value;
|
|
end;
|
|
|
|
function SizeRelH.ReadXmlChildPctWidth();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildPctWidth) then
|
|
begin
|
|
{self.}XmlChildPctWidth := new OpenXmlPcdata(self, {self.}Prefix, "pctWidth");
|
|
container_.Set({self.}XmlChildPctWidth);
|
|
end
|
|
return {self.}XmlChildPctWidth;
|
|
end;
|