94 lines
2.5 KiB
Plaintext
94 lines
2.5 KiB
Plaintext
type ExternalData = 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: ExternalData);override;
|
|
|
|
public
|
|
|
|
// attributes property
|
|
property Id read ReadXmlAttrId write WriteXmlAttrId;
|
|
function ReadXmlAttrId();
|
|
function WriteXmlAttrId(_value);
|
|
|
|
// normal property
|
|
property AutoUpdate read ReadXmlChildAutoUpdate;
|
|
function ReadXmlChildAutoUpdate();
|
|
|
|
public
|
|
// Attributes
|
|
XmlAttrId: OpenXmlAttribute;
|
|
|
|
// Children
|
|
XmlChildAutoUpdate: PureVal;
|
|
|
|
end;
|
|
|
|
function ExternalData.Create();overload;
|
|
begin
|
|
{self.}Create(nil, "c", "externalData");
|
|
end;
|
|
|
|
function ExternalData.Create(_node: XmlNode);overload;
|
|
begin
|
|
class(OpenXmlElement).Create(_node: XmlNode);
|
|
end;
|
|
|
|
function ExternalData.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 ExternalData.Init();override;
|
|
begin
|
|
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
|
|
attributes_ := array();
|
|
attributes_pf_ := array(
|
|
"r:id": makeweakref(thisFunction(WriteXmlAttrId)),
|
|
);
|
|
sorted_child_ := array(
|
|
pre + "autoUpdate": array(0, makeweakref(thisFunction(ReadXmlChildAutoUpdate))),
|
|
);
|
|
container_ := new TSOfficeContainer(sorted_child_);
|
|
end;
|
|
|
|
function ExternalData.Copy(_obj: ExternalData);override;
|
|
begin
|
|
tslassigning_backup := tslassigning;
|
|
tslassigning := 1;
|
|
class(OpenXmlElement).Copy(_obj);
|
|
if not ifnil(_obj.Id) then
|
|
{self.}Id := _obj.Id;
|
|
if not ifnil(_obj.XmlChildAutoUpdate) then
|
|
{self.}AutoUpdate.Copy(_obj.XmlChildAutoUpdate);
|
|
tslassigning := tslassigning_backup;
|
|
end;
|
|
|
|
function ExternalData.ReadXmlAttrId();
|
|
begin
|
|
return {self.}XmlAttrId.Value;
|
|
end;
|
|
|
|
function ExternalData.WriteXmlAttrId(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrId) then
|
|
begin
|
|
{self.}XmlAttrId := new OpenXmlAttribute("r", "id", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrId;
|
|
end
|
|
{self.}XmlAttrId.Value := _value;
|
|
end;
|
|
|
|
function ExternalData.ReadXmlChildAutoUpdate();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildAutoUpdate) then
|
|
begin
|
|
{self.}XmlChildAutoUpdate := new PureVal(self, {self.}Prefix, "autoUpdate");
|
|
container_.Set({self.}XmlChildAutoUpdate);
|
|
end
|
|
return {self.}XmlChildAutoUpdate;
|
|
end;
|