126 lines
3.4 KiB
Plaintext
126 lines
3.4 KiB
Plaintext
type TxPr = 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: TxPr);override;
|
|
|
|
public
|
|
|
|
// empty property
|
|
property LstStyle read ReadXmlChildLstStyle write WriteXmlChildLstStyle;
|
|
function ReadXmlChildLstStyle();
|
|
function WriteXmlChildLstStyle(_value);
|
|
|
|
// normal property
|
|
property BodyPr read ReadXmlChildBodyPr;
|
|
function ReadXmlChildBodyPr();
|
|
|
|
// multi property
|
|
property Ps read ReadPs;
|
|
function ReadPs(_index);
|
|
function AddP(): Ap;
|
|
function AppendP(): Ap;
|
|
|
|
public
|
|
// Children
|
|
XmlChildBodyPr: BodyPr;
|
|
XmlChildLstStyle: OpenXmlEmpty;
|
|
|
|
end;
|
|
|
|
function TxPr.Create();overload;
|
|
begin
|
|
{self.}Create(nil, "c", "txPr");
|
|
end;
|
|
|
|
function TxPr.Create(_node: XmlNode);overload;
|
|
begin
|
|
class(OpenXmlElement).Create(_node: XmlNode);
|
|
end;
|
|
|
|
function TxPr.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 TxPr.Init();override;
|
|
begin
|
|
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
|
|
attributes_ := array();
|
|
attributes_pf_ := array(
|
|
);
|
|
sorted_child_ := array(
|
|
"a:bodyPr": array(0, makeweakref(thisFunction(ReadXmlChildBodyPr))),
|
|
"a:lstStyle": array(1, makeweakref(thisFunction(ReadXmlChildLstStyle))),
|
|
"a:p": array(2, makeweakref(thisFunction(AppendP))),
|
|
);
|
|
container_ := new TSOfficeContainer(sorted_child_);
|
|
end;
|
|
|
|
function TxPr.Copy(_obj: TxPr);override;
|
|
begin
|
|
tslassigning_backup := tslassigning;
|
|
tslassigning := 1;
|
|
class(OpenXmlElement).Copy(_obj);
|
|
if not ifnil(_obj.XmlChildBodyPr) then
|
|
{self.}BodyPr.Copy(_obj.XmlChildBodyPr);
|
|
if not ifnil(_obj.XmlChildLstStyle) then
|
|
ifnil({self.}XmlChildLstStyle) ? {self.}LstStyle.Copy(_obj.XmlChildLstStyle) : {self.}XmlChildLstStyle.Copy(_obj.XmlChildLstStyle);
|
|
tslassigning := tslassigning_backup;
|
|
end;
|
|
|
|
function TxPr.ReadXmlChildLstStyle();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildLstStyle) then
|
|
begin
|
|
{self.}XmlChildLstStyle := new OpenXmlEmpty(self, "a", "lstStyle");
|
|
container_.Set({self.}XmlChildLstStyle);
|
|
return {self.}XmlChildLstStyle;
|
|
end
|
|
return {self.}XmlChildLstStyle.BoolValue();
|
|
end;
|
|
|
|
function TxPr.WriteXmlChildLstStyle(_value);
|
|
begin
|
|
if ifnil({self.}XmlChildLstStyle) then
|
|
begin
|
|
{self.}XmlChildLstStyle := new OpenXmlEmpty(self, "a", "lstStyle");
|
|
container_.Set({self.}XmlChildLstStyle);
|
|
end
|
|
{self.}XmlChildLstStyle.Value := _value;
|
|
end;
|
|
|
|
function TxPr.ReadXmlChildBodyPr();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildBodyPr) then
|
|
begin
|
|
{self.}XmlChildBodyPr := new BodyPr(self, "a", "bodyPr");
|
|
container_.Set({self.}XmlChildBodyPr);
|
|
end
|
|
return {self.}XmlChildBodyPr;
|
|
end;
|
|
|
|
function TxPr.ReadPs(_index);
|
|
begin
|
|
ind := ifnil(_index) ? -2 : _index;
|
|
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
|
|
return container_.Get("a:p", ind);
|
|
end;
|
|
|
|
function TxPr.AddP(): Ap;
|
|
begin
|
|
obj := new Ap(self, "a", "p");
|
|
container_.Insert(obj);
|
|
return obj;
|
|
end;
|
|
|
|
function TxPr.AppendP(): Ap;
|
|
begin
|
|
obj := new Ap(self, "a", "p");
|
|
container_.Append(obj);
|
|
return obj;
|
|
end;
|