94 lines
2.6 KiB
Plaintext
94 lines
2.6 KiB
Plaintext
type Graphic = 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: Graphic);override;
|
|
|
|
public
|
|
|
|
// attributes property
|
|
property XmlnsA read ReadXmlAttrXmlnsA write WriteXmlAttrXmlnsA;
|
|
function ReadXmlAttrXmlnsA();
|
|
function WriteXmlAttrXmlnsA(_value);
|
|
|
|
// normal property
|
|
property GraphicData read ReadXmlChildGraphicData;
|
|
function ReadXmlChildGraphicData();
|
|
|
|
public
|
|
// Attributes
|
|
XmlAttrXmlnsA: OpenXmlAttribute;
|
|
|
|
// Children
|
|
XmlChildGraphicData: GraphicData;
|
|
|
|
end;
|
|
|
|
function Graphic.Create();overload;
|
|
begin
|
|
{self.}Create(nil, "", "");
|
|
end;
|
|
|
|
function Graphic.Create(_node: XmlNode);overload;
|
|
begin
|
|
class(OpenXmlElement).Create(_node: XmlNode);
|
|
end;
|
|
|
|
function Graphic.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 Graphic.Init();override;
|
|
begin
|
|
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
|
|
attributes_ := array();
|
|
attributes_pf_ := array(
|
|
"xmlns:a": makeweakref(thisFunction(WriteXmlAttrXmlnsA)),
|
|
);
|
|
sorted_child_ := array(
|
|
"a:graphicData": array(0, makeweakref(thisFunction(ReadXmlChildGraphicData))),
|
|
);
|
|
container_ := new TSOfficeContainer(sorted_child_);
|
|
end;
|
|
|
|
function Graphic.Copy(_obj: Graphic);override;
|
|
begin
|
|
tslassigning_backup := tslassigning;
|
|
tslassigning := 1;
|
|
class(OpenXmlElement).Copy(_obj);
|
|
if not ifnil(_obj.XmlnsA) then
|
|
{self.}XmlnsA := _obj.XmlnsA;
|
|
if not ifnil(_obj.XmlChildGraphicData) then
|
|
{self.}GraphicData.Copy(_obj.XmlChildGraphicData);
|
|
tslassigning := tslassigning_backup;
|
|
end;
|
|
|
|
function Graphic.ReadXmlAttrXmlnsA();
|
|
begin
|
|
return {self.}XmlAttrXmlnsA.Value;
|
|
end;
|
|
|
|
function Graphic.WriteXmlAttrXmlnsA(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrXmlnsA) then
|
|
begin
|
|
{self.}XmlAttrXmlnsA := new OpenXmlAttribute("xmlns", "a", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrXmlnsA;
|
|
end
|
|
{self.}XmlAttrXmlnsA.Value := _value;
|
|
end;
|
|
|
|
function Graphic.ReadXmlChildGraphicData();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildGraphicData) then
|
|
begin
|
|
{self.}XmlChildGraphicData := new GraphicData(self, "a", "graphicData");
|
|
container_.Set({self.}XmlChildGraphicData);
|
|
end
|
|
return {self.}XmlChildGraphicData;
|
|
end;
|