132 lines
3.9 KiB
Plaintext
132 lines
3.9 KiB
Plaintext
type Wsp = 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: Wsp);override;
|
|
|
|
public
|
|
|
|
// normal property
|
|
property CNvSpPr read ReadXmlChildCNvSpPr;
|
|
property SpPr read ReadXmlChildSpPr;
|
|
property Txbx read ReadXmlChildTxbx;
|
|
property Style read ReadXmlChildStyle;
|
|
property BodyPr read ReadXmlChildBodyPr;
|
|
function ReadXmlChildCNvSpPr();
|
|
function ReadXmlChildSpPr();
|
|
function ReadXmlChildTxbx();
|
|
function ReadXmlChildStyle();
|
|
function ReadXmlChildBodyPr();
|
|
|
|
public
|
|
// Children
|
|
XmlChildCNvSpPr: CNvSpPr;
|
|
XmlChildSpPr: SpPr;
|
|
XmlChildTxbx: Txbx;
|
|
XmlChildStyle: WpsStyle;
|
|
XmlChildBodyPr: BodyPr;
|
|
|
|
end;
|
|
|
|
function Wsp.Create();overload;
|
|
begin
|
|
{self.}Create(nil, "wps", "wsp");
|
|
end;
|
|
|
|
function Wsp.Create(_node: XmlNode);overload;
|
|
begin
|
|
class(OpenXmlElement).Create(_node: XmlNode);
|
|
end;
|
|
|
|
function Wsp.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 Wsp.Init();override;
|
|
begin
|
|
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
|
|
attributes_ := array();
|
|
attributes_pf_ := array(
|
|
);
|
|
sorted_child_ := array(
|
|
pre + "cNvSpPr": array(0, makeweakref(thisFunction(ReadXmlChildCNvSpPr))),
|
|
pre + "spPr": array(1, makeweakref(thisFunction(ReadXmlChildSpPr))),
|
|
pre + "txbx": array(2, makeweakref(thisFunction(ReadXmlChildTxbx))),
|
|
pre + "style": array(3, makeweakref(thisFunction(ReadXmlChildStyle))),
|
|
pre + "bodyPr": array(4, makeweakref(thisFunction(ReadXmlChildBodyPr))),
|
|
);
|
|
container_ := new TSOfficeContainer(sorted_child_);
|
|
end;
|
|
|
|
function Wsp.Copy(_obj: Wsp);override;
|
|
begin
|
|
tslassigning_backup := tslassigning;
|
|
tslassigning := 1;
|
|
class(OpenXmlElement).Copy(_obj);
|
|
if not ifnil(_obj.XmlChildCNvSpPr) then
|
|
{self.}CNvSpPr.Copy(_obj.XmlChildCNvSpPr);
|
|
if not ifnil(_obj.XmlChildSpPr) then
|
|
{self.}SpPr.Copy(_obj.XmlChildSpPr);
|
|
if not ifnil(_obj.XmlChildTxbx) then
|
|
{self.}Txbx.Copy(_obj.XmlChildTxbx);
|
|
if not ifnil(_obj.XmlChildStyle) then
|
|
{self.}Style.Copy(_obj.XmlChildStyle);
|
|
if not ifnil(_obj.XmlChildBodyPr) then
|
|
{self.}BodyPr.Copy(_obj.XmlChildBodyPr);
|
|
tslassigning := tslassigning_backup;
|
|
end;
|
|
|
|
function Wsp.ReadXmlChildCNvSpPr();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildCNvSpPr) then
|
|
begin
|
|
{self.}XmlChildCNvSpPr := new CNvSpPr(self, {self.}Prefix, "cNvSpPr");
|
|
container_.Set({self.}XmlChildCNvSpPr);
|
|
end
|
|
return {self.}XmlChildCNvSpPr;
|
|
end;
|
|
|
|
function Wsp.ReadXmlChildSpPr();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildSpPr) then
|
|
begin
|
|
{self.}XmlChildSpPr := new SpPr(self, {self.}Prefix, "spPr");
|
|
container_.Set({self.}XmlChildSpPr);
|
|
end
|
|
return {self.}XmlChildSpPr;
|
|
end;
|
|
|
|
function Wsp.ReadXmlChildTxbx();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildTxbx) then
|
|
begin
|
|
{self.}XmlChildTxbx := new Txbx(self, {self.}Prefix, "txbx");
|
|
container_.Set({self.}XmlChildTxbx);
|
|
end
|
|
return {self.}XmlChildTxbx;
|
|
end;
|
|
|
|
function Wsp.ReadXmlChildStyle();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildStyle) then
|
|
begin
|
|
{self.}XmlChildStyle := new WpsStyle(self, {self.}Prefix, "style");
|
|
container_.Set({self.}XmlChildStyle);
|
|
end
|
|
return {self.}XmlChildStyle;
|
|
end;
|
|
|
|
function Wsp.ReadXmlChildBodyPr();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildBodyPr) then
|
|
begin
|
|
{self.}XmlChildBodyPr := new BodyPr(self, {self.}Prefix, "bodyPr");
|
|
container_.Set({self.}XmlChildBodyPr);
|
|
end
|
|
return {self.}XmlChildBodyPr;
|
|
end;
|