119 lines
3.3 KiB
Plaintext
119 lines
3.3 KiB
Plaintext
type CompatSetting = 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: CompatSetting);override;
|
|
|
|
public
|
|
|
|
// attributes property
|
|
property Name read ReadXmlAttrName write WriteXmlAttrName;
|
|
property Uri read ReadXmlAttrUri write WriteXmlAttrUri;
|
|
property Val read ReadXmlAttrVal write WriteXmlAttrVal;
|
|
function ReadXmlAttrName();
|
|
function WriteXmlAttrName(_value);
|
|
function ReadXmlAttrUri();
|
|
function WriteXmlAttrUri(_value);
|
|
function ReadXmlAttrVal();
|
|
function WriteXmlAttrVal(_value);
|
|
|
|
public
|
|
// Attributes
|
|
XmlAttrName: OpenXmlAttribute;
|
|
XmlAttrUri: OpenXmlAttribute;
|
|
XmlAttrVal: OpenXmlAttribute;
|
|
|
|
|
|
end;
|
|
|
|
function CompatSetting.Create();overload;
|
|
begin
|
|
{self.}Create(nil, "w", "compatSetting");
|
|
end;
|
|
|
|
function CompatSetting.Create(_node: XmlNode);overload;
|
|
begin
|
|
class(OpenXmlElement).Create(_node: XmlNode);
|
|
end;
|
|
|
|
function CompatSetting.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 CompatSetting.Init();override;
|
|
begin
|
|
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
|
|
attributes_ := array();
|
|
attributes_pf_ := array(
|
|
pre + "name": makeweakref(thisFunction(WriteXmlAttrName)),
|
|
pre + "uri": makeweakref(thisFunction(WriteXmlAttrUri)),
|
|
pre + "val": makeweakref(thisFunction(WriteXmlAttrVal)),
|
|
);
|
|
sorted_child_ := array(
|
|
);
|
|
container_ := new TSOfficeContainer(sorted_child_);
|
|
end;
|
|
|
|
function CompatSetting.Copy(_obj: CompatSetting);override;
|
|
begin
|
|
tslassigning_backup := tslassigning;
|
|
tslassigning := 1;
|
|
class(OpenXmlElement).Copy(_obj);
|
|
if not ifnil(_obj.Name) then
|
|
{self.}Name := _obj.Name;
|
|
if not ifnil(_obj.Uri) then
|
|
{self.}Uri := _obj.Uri;
|
|
if not ifnil(_obj.Val) then
|
|
{self.}Val := _obj.Val;
|
|
tslassigning := tslassigning_backup;
|
|
end;
|
|
|
|
function CompatSetting.ReadXmlAttrName();
|
|
begin
|
|
return {self.}XmlAttrName.Value;
|
|
end;
|
|
|
|
function CompatSetting.WriteXmlAttrName(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrName) then
|
|
begin
|
|
{self.}XmlAttrName := new OpenXmlAttribute({self.}Prefix, "name", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrName;
|
|
end
|
|
{self.}XmlAttrName.Value := _value;
|
|
end;
|
|
|
|
function CompatSetting.ReadXmlAttrUri();
|
|
begin
|
|
return {self.}XmlAttrUri.Value;
|
|
end;
|
|
|
|
function CompatSetting.WriteXmlAttrUri(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrUri) then
|
|
begin
|
|
{self.}XmlAttrUri := new OpenXmlAttribute({self.}Prefix, "uri", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrUri;
|
|
end
|
|
{self.}XmlAttrUri.Value := _value;
|
|
end;
|
|
|
|
function CompatSetting.ReadXmlAttrVal();
|
|
begin
|
|
return {self.}XmlAttrVal.Value;
|
|
end;
|
|
|
|
function CompatSetting.WriteXmlAttrVal(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrVal) then
|
|
begin
|
|
{self.}XmlAttrVal := new OpenXmlAttribute({self.}Prefix, "val", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrVal;
|
|
end
|
|
{self.}XmlAttrVal.Value := _value;
|
|
end;
|