97 lines
2.8 KiB
Plaintext
97 lines
2.8 KiB
Plaintext
type NumFmt = 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: NumFmt);override;
|
|
|
|
public
|
|
|
|
// attributes property
|
|
property FormatCode read ReadXmlAttrFormatCode write WriteXmlAttrFormatCode;
|
|
property SourceLinked read ReadXmlAttrSourceLinked write WriteXmlAttrSourceLinked;
|
|
function ReadXmlAttrFormatCode();
|
|
function WriteXmlAttrFormatCode(_value);
|
|
function ReadXmlAttrSourceLinked();
|
|
function WriteXmlAttrSourceLinked(_value);
|
|
|
|
public
|
|
// Attributes
|
|
XmlAttrFormatCode: OpenXmlAttribute;
|
|
XmlAttrSourceLinked: OpenXmlAttribute;
|
|
|
|
|
|
end;
|
|
|
|
function NumFmt.Create();overload;
|
|
begin
|
|
{self.}Create(nil, "c", "numFmt");
|
|
end;
|
|
|
|
function NumFmt.Create(_node: XmlNode);overload;
|
|
begin
|
|
class(OpenXmlElement).Create(_node: XmlNode);
|
|
end;
|
|
|
|
function NumFmt.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 NumFmt.Init();override;
|
|
begin
|
|
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
|
|
attributes_ := array();
|
|
attributes_pf_ := array(
|
|
"formatCode": makeweakref(thisFunction(WriteXmlAttrFormatCode)),
|
|
"sourceLinked": makeweakref(thisFunction(WriteXmlAttrSourceLinked)),
|
|
);
|
|
sorted_child_ := array(
|
|
);
|
|
container_ := new TSOfficeContainer(sorted_child_);
|
|
end;
|
|
|
|
function NumFmt.Copy(_obj: NumFmt);override;
|
|
begin
|
|
tslassigning_backup := tslassigning;
|
|
tslassigning := 1;
|
|
class(OpenXmlElement).Copy(_obj);
|
|
if not ifnil(_obj.FormatCode) then
|
|
{self.}FormatCode := _obj.FormatCode;
|
|
if not ifnil(_obj.SourceLinked) then
|
|
{self.}SourceLinked := _obj.SourceLinked;
|
|
tslassigning := tslassigning_backup;
|
|
end;
|
|
|
|
function NumFmt.ReadXmlAttrFormatCode();
|
|
begin
|
|
return {self.}XmlAttrFormatCode.Value;
|
|
end;
|
|
|
|
function NumFmt.WriteXmlAttrFormatCode(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrFormatCode) then
|
|
begin
|
|
{self.}XmlAttrFormatCode := new OpenXmlAttribute("", "formatCode", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrFormatCode;
|
|
end
|
|
{self.}XmlAttrFormatCode.Value := _value;
|
|
end;
|
|
|
|
function NumFmt.ReadXmlAttrSourceLinked();
|
|
begin
|
|
return {self.}XmlAttrSourceLinked.Value;
|
|
end;
|
|
|
|
function NumFmt.WriteXmlAttrSourceLinked(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrSourceLinked) then
|
|
begin
|
|
{self.}XmlAttrSourceLinked := new OpenXmlAttribute("", "sourceLinked", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrSourceLinked;
|
|
end
|
|
{self.}XmlAttrSourceLinked.Value := _value;
|
|
end;
|