119 lines
3.2 KiB
Plaintext
119 lines
3.2 KiB
Plaintext
type Lang = 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: Lang);override;
|
|
|
|
public
|
|
|
|
// attributes property
|
|
property Val read ReadXmlAttrVal write WriteXmlAttrVal;
|
|
property EastAsia read ReadXmlAttrEastAsia write WriteXmlAttrEastAsia;
|
|
property Bidi read ReadXmlAttrBidi write WriteXmlAttrBidi;
|
|
function ReadXmlAttrVal();
|
|
function WriteXmlAttrVal(_value);
|
|
function ReadXmlAttrEastAsia();
|
|
function WriteXmlAttrEastAsia(_value);
|
|
function ReadXmlAttrBidi();
|
|
function WriteXmlAttrBidi(_value);
|
|
|
|
public
|
|
// Attributes
|
|
XmlAttrVal: OpenXmlAttribute;
|
|
XmlAttrEastAsia: OpenXmlAttribute;
|
|
XmlAttrBidi: OpenXmlAttribute;
|
|
|
|
|
|
end;
|
|
|
|
function Lang.Create();overload;
|
|
begin
|
|
{self.}Create(nil, "w", "lang");
|
|
end;
|
|
|
|
function Lang.Create(_node: XmlNode);overload;
|
|
begin
|
|
class(OpenXmlElement).Create(_node: XmlNode);
|
|
end;
|
|
|
|
function Lang.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 Lang.Init();override;
|
|
begin
|
|
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
|
|
attributes_ := array();
|
|
attributes_pf_ := array(
|
|
pre + "val": makeweakref(thisFunction(WriteXmlAttrVal)),
|
|
pre + "eastAsia": makeweakref(thisFunction(WriteXmlAttrEastAsia)),
|
|
pre + "bidi": makeweakref(thisFunction(WriteXmlAttrBidi)),
|
|
);
|
|
sorted_child_ := array(
|
|
);
|
|
container_ := new TSOfficeContainer(sorted_child_);
|
|
end;
|
|
|
|
function Lang.Copy(_obj: Lang);override;
|
|
begin
|
|
tslassigning_backup := tslassigning;
|
|
tslassigning := 1;
|
|
class(OpenXmlElement).Copy(_obj);
|
|
if not ifnil(_obj.Val) then
|
|
{self.}Val := _obj.Val;
|
|
if not ifnil(_obj.EastAsia) then
|
|
{self.}EastAsia := _obj.EastAsia;
|
|
if not ifnil(_obj.Bidi) then
|
|
{self.}Bidi := _obj.Bidi;
|
|
tslassigning := tslassigning_backup;
|
|
end;
|
|
|
|
function Lang.ReadXmlAttrVal();
|
|
begin
|
|
return {self.}XmlAttrVal.Value;
|
|
end;
|
|
|
|
function Lang.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;
|
|
|
|
function Lang.ReadXmlAttrEastAsia();
|
|
begin
|
|
return {self.}XmlAttrEastAsia.Value;
|
|
end;
|
|
|
|
function Lang.WriteXmlAttrEastAsia(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrEastAsia) then
|
|
begin
|
|
{self.}XmlAttrEastAsia := new OpenXmlAttribute({self.}Prefix, "eastAsia", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrEastAsia;
|
|
end
|
|
{self.}XmlAttrEastAsia.Value := _value;
|
|
end;
|
|
|
|
function Lang.ReadXmlAttrBidi();
|
|
begin
|
|
return {self.}XmlAttrBidi.Value;
|
|
end;
|
|
|
|
function Lang.WriteXmlAttrBidi(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrBidi) then
|
|
begin
|
|
{self.}XmlAttrBidi := new OpenXmlAttribute({self.}Prefix, "bidi", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrBidi;
|
|
end
|
|
{self.}XmlAttrBidi.Value := _value;
|
|
end;
|