97 lines
2.6 KiB
Plaintext
97 lines
2.6 KiB
Plaintext
type DocGrid = 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: DocGrid);override;
|
|
|
|
public
|
|
|
|
// attributes property
|
|
property Type read ReadXmlAttrType write WriteXmlAttrType;
|
|
property LinePitch read ReadXmlAttrLinePitch write WriteXmlAttrLinePitch;
|
|
function ReadXmlAttrType();
|
|
function WriteXmlAttrType(_value);
|
|
function ReadXmlAttrLinePitch();
|
|
function WriteXmlAttrLinePitch(_value);
|
|
|
|
public
|
|
// Attributes
|
|
XmlAttrType: OpenXmlAttribute;
|
|
XmlAttrLinePitch: OpenXmlAttribute;
|
|
|
|
|
|
end;
|
|
|
|
function DocGrid.Create();overload;
|
|
begin
|
|
{self.}Create(nil, "w", "docGrid");
|
|
end;
|
|
|
|
function DocGrid.Create(_node: XmlNode);overload;
|
|
begin
|
|
class(OpenXmlElement).Create(_node: XmlNode);
|
|
end;
|
|
|
|
function DocGrid.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 DocGrid.Init();override;
|
|
begin
|
|
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
|
|
attributes_ := array();
|
|
attributes_pf_ := array(
|
|
pre + "type": makeweakref(thisFunction(WriteXmlAttrType)),
|
|
pre + "linePitch": makeweakref(thisFunction(WriteXmlAttrLinePitch)),
|
|
);
|
|
sorted_child_ := array(
|
|
);
|
|
container_ := new TSOfficeContainer(sorted_child_);
|
|
end;
|
|
|
|
function DocGrid.Copy(_obj: DocGrid);override;
|
|
begin
|
|
tslassigning_backup := tslassigning;
|
|
tslassigning := 1;
|
|
class(OpenXmlElement).Copy(_obj);
|
|
if not ifnil(_obj.Type) then
|
|
{self.}Type := _obj.Type;
|
|
if not ifnil(_obj.LinePitch) then
|
|
{self.}LinePitch := _obj.LinePitch;
|
|
tslassigning := tslassigning_backup;
|
|
end;
|
|
|
|
function DocGrid.ReadXmlAttrType();
|
|
begin
|
|
return {self.}XmlAttrType.Value;
|
|
end;
|
|
|
|
function DocGrid.WriteXmlAttrType(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrType) then
|
|
begin
|
|
{self.}XmlAttrType := new OpenXmlAttribute({self.}Prefix, "type", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrType;
|
|
end
|
|
{self.}XmlAttrType.Value := _value;
|
|
end;
|
|
|
|
function DocGrid.ReadXmlAttrLinePitch();
|
|
begin
|
|
return {self.}XmlAttrLinePitch.Value;
|
|
end;
|
|
|
|
function DocGrid.WriteXmlAttrLinePitch(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrLinePitch) then
|
|
begin
|
|
{self.}XmlAttrLinePitch := new OpenXmlAttribute({self.}Prefix, "linePitch", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrLinePitch;
|
|
end
|
|
{self.}XmlAttrLinePitch.Value := _value;
|
|
end;
|