97 lines
2.5 KiB
Plaintext
97 lines
2.5 KiB
Plaintext
type IdMap = 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: IdMap);override;
|
|
|
|
public
|
|
|
|
// attributes property
|
|
property Ext read ReadXmlAttrExt write WriteXmlAttrExt;
|
|
property Data read ReadXmlAttrData write WriteXmlAttrData;
|
|
function ReadXmlAttrExt();
|
|
function WriteXmlAttrExt(_value);
|
|
function ReadXmlAttrData();
|
|
function WriteXmlAttrData(_value);
|
|
|
|
public
|
|
// Attributes
|
|
XmlAttrExt: OpenXmlAttribute;
|
|
XmlAttrData: OpenXmlAttribute;
|
|
|
|
|
|
end;
|
|
|
|
function IdMap.Create();overload;
|
|
begin
|
|
{self.}Create(nil, "o", "idmap");
|
|
end;
|
|
|
|
function IdMap.Create(_node: XmlNode);overload;
|
|
begin
|
|
class(OpenXmlElement).Create(_node: XmlNode);
|
|
end;
|
|
|
|
function IdMap.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 IdMap.Init();override;
|
|
begin
|
|
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
|
|
attributes_ := array();
|
|
attributes_pf_ := array(
|
|
"v:ext": makeweakref(thisFunction(WriteXmlAttrExt)),
|
|
"data": makeweakref(thisFunction(WriteXmlAttrData)),
|
|
);
|
|
sorted_child_ := array(
|
|
);
|
|
container_ := new TSOfficeContainer(sorted_child_);
|
|
end;
|
|
|
|
function IdMap.Copy(_obj: IdMap);override;
|
|
begin
|
|
tslassigning_backup := tslassigning;
|
|
tslassigning := 1;
|
|
class(OpenXmlElement).Copy(_obj);
|
|
if not ifnil(_obj.Ext) then
|
|
{self.}Ext := _obj.Ext;
|
|
if not ifnil(_obj.Data) then
|
|
{self.}Data := _obj.Data;
|
|
tslassigning := tslassigning_backup;
|
|
end;
|
|
|
|
function IdMap.ReadXmlAttrExt();
|
|
begin
|
|
return {self.}XmlAttrExt.Value;
|
|
end;
|
|
|
|
function IdMap.WriteXmlAttrExt(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrExt) then
|
|
begin
|
|
{self.}XmlAttrExt := new OpenXmlAttribute("v", "ext", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrExt;
|
|
end
|
|
{self.}XmlAttrExt.Value := _value;
|
|
end;
|
|
|
|
function IdMap.ReadXmlAttrData();
|
|
begin
|
|
return {self.}XmlAttrData.Value;
|
|
end;
|
|
|
|
function IdMap.WriteXmlAttrData(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrData) then
|
|
begin
|
|
{self.}XmlAttrData := new OpenXmlAttribute("", "data", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrData;
|
|
end
|
|
{self.}XmlAttrData.Value := _value;
|
|
end;
|