OfficeXml/autoclass/docx/Fallback@DOCX.tsf

84 lines
2.3 KiB
Plaintext

type Fallback = 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: Fallback);override;
public
// normal property
property Style read ReadXmlChildStyle;
property Pict read ReadXmlChildPict;
function ReadXmlChildStyle();
function ReadXmlChildPict();
public
// Children
XmlChildStyle: PureVal;
XmlChildPict: Pict;
end;
function Fallback.Create();overload;
begin
{self.}Create(nil, "mc", "Fallback");
end;
function Fallback.Create(_node: XmlNode);overload;
begin
class(OpenXmlElement).Create(_node: XmlNode);
end;
function Fallback.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 Fallback.Init();override;
begin
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
attributes_ := array();
attributes_pf_ := array(
);
sorted_child_ := array(
"c:style": array(0, makeweakref(thisFunction(ReadXmlChildStyle))),
"w:pict": array(1, makeweakref(thisFunction(ReadXmlChildPict))),
);
container_ := new TSOfficeContainer(sorted_child_);
end;
function Fallback.Copy(_obj: Fallback);override;
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
class(OpenXmlElement).Copy(_obj);
if not ifnil(_obj.XmlChildStyle) then
{self.}Style.Copy(_obj.XmlChildStyle);
if not ifnil(_obj.XmlChildPict) then
{self.}Pict.Copy(_obj.XmlChildPict);
tslassigning := tslassigning_backup;
end;
function Fallback.ReadXmlChildStyle();
begin
if tslassigning and ifnil({self.}XmlChildStyle) then
begin
{self.}XmlChildStyle := new PureVal(self, "c", "style");
container_.Set({self.}XmlChildStyle);
end
return {self.}XmlChildStyle;
end;
function Fallback.ReadXmlChildPict();
begin
if tslassigning and ifnil({self.}XmlChildPict) then
begin
{self.}XmlChildPict := new Pict(self, "w", "pict");
container_.Set({self.}XmlChildPict);
end
return {self.}XmlChildPict;
end;