OfficeXml/autoclass/docx/ShapeLayout@DOCX.tsf

94 lines
2.5 KiB
Plaintext

type ShapeLayout = 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: ShapeLayout);override;
public
// attributes property
property Ext read ReadXmlAttrExt write WriteXmlAttrExt;
function ReadXmlAttrExt();
function WriteXmlAttrExt(_value);
// normal property
property IdMap read ReadXmlChildIdMap;
function ReadXmlChildIdMap();
public
// Attributes
XmlAttrExt: OpenXmlAttribute;
// Children
XmlChildIdMap: IdMap;
end;
function ShapeLayout.Create();overload;
begin
{self.}Create(nil, "o", "shapelayout");
end;
function ShapeLayout.Create(_node: XmlNode);overload;
begin
class(OpenXmlElement).Create(_node: XmlNode);
end;
function ShapeLayout.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 ShapeLayout.Init();override;
begin
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
attributes_ := array();
attributes_pf_ := array(
"v:ext": makeweakref(thisFunction(WriteXmlAttrExt)),
);
sorted_child_ := array(
pre + "idmap": array(0, makeweakref(thisFunction(ReadXmlChildIdMap))),
);
container_ := new TSOfficeContainer(sorted_child_);
end;
function ShapeLayout.Copy(_obj: ShapeLayout);override;
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
class(OpenXmlElement).Copy(_obj);
if not ifnil(_obj.Ext) then
{self.}Ext := _obj.Ext;
if not ifnil(_obj.XmlChildIdMap) then
{self.}IdMap.Copy(_obj.XmlChildIdMap);
tslassigning := tslassigning_backup;
end;
function ShapeLayout.ReadXmlAttrExt();
begin
return {self.}XmlAttrExt.Value;
end;
function ShapeLayout.WriteXmlAttrExt(_value);
begin
if ifnil({self.}XmlAttrExt) then
begin
{self.}XmlAttrExt := new OpenXmlAttribute("v", "ext", nil);
attributes_[length(attributes_)] := {self.}XmlAttrExt;
end
{self.}XmlAttrExt.Value := _value;
end;
function ShapeLayout.ReadXmlChildIdMap();
begin
if tslassigning and ifnil({self.}XmlChildIdMap) then
begin
{self.}XmlChildIdMap := new IdMap(self, {self.}Prefix, "idmap");
container_.Set({self.}XmlChildIdMap);
end
return {self.}XmlChildIdMap;
end;