72 lines
1.8 KiB
Plaintext
72 lines
1.8 KiB
Plaintext
type InstrText = class(OpenXmlPcdata)
|
|
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: InstrText);override;
|
|
|
|
public
|
|
|
|
// attributes property
|
|
property Space read ReadXmlAttrSpace write WriteXmlAttrSpace;
|
|
function ReadXmlAttrSpace();
|
|
function WriteXmlAttrSpace(_value);
|
|
|
|
public
|
|
// Attributes
|
|
XmlAttrSpace: OpenXmlAttribute;
|
|
|
|
|
|
end;
|
|
|
|
function InstrText.Create();overload;
|
|
begin
|
|
{self.}Create(nil, "w", "instrText");
|
|
end;
|
|
|
|
function InstrText.Create(_node: XmlNode);overload;
|
|
begin
|
|
class(OpenXmlPcdata).Create(_node: XmlNode);
|
|
end;
|
|
|
|
function InstrText.Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
|
|
begin
|
|
setsysparam(pn_calcctrlword(), getsysparam(pn_calcctrlword()) .| 0x200);
|
|
class(OpenXmlPcdata).Create(_parent, _prefix, _local_name);
|
|
end;
|
|
|
|
function InstrText.Init();override;
|
|
begin
|
|
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
|
|
attributes_ := array();
|
|
attributes_pf_ := array(
|
|
"xml:Space": makeweakref(thisFunction(WriteXmlAttrSpace)),
|
|
);
|
|
end;
|
|
|
|
function InstrText.Copy(_obj: InstrText);override;
|
|
begin
|
|
tslassigning_backup := tslassigning;
|
|
tslassigning := 1;
|
|
class(OpenXmlPcdata).Copy(_obj);
|
|
if not ifnil(_obj.Space) then
|
|
{self.}Space := _obj.Space;
|
|
tslassigning := tslassigning_backup;
|
|
end;
|
|
|
|
function InstrText.ReadXmlAttrSpace();
|
|
begin
|
|
return {self.}XmlAttrSpace.Value;
|
|
end;
|
|
|
|
function InstrText.WriteXmlAttrSpace(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrSpace) then
|
|
begin
|
|
{self.}XmlAttrSpace := new OpenXmlAttribute("xml", "Space", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrSpace;
|
|
end
|
|
{self.}XmlAttrSpace.Value := _value;
|
|
end;
|