This commit is contained in:
csh 2024-12-25 11:08:37 +08:00
parent e687379248
commit 48e4de7b87
31 changed files with 825 additions and 248 deletions

152
README.md
View File

@ -1,6 +1,6 @@
# OfficeXml
## 说明
## 概述
将docx、pptx、xlsx等文件中的xml转为tsl对象
@ -27,7 +27,7 @@
上述是一个docx中的段落的xml序列化为tsl过程如下
```txt
```go
namespace "DOCX" // 设置命名空间为DOCX
p := new P(); // 创建一个P对象段落w:p
p.Init(node); // 假设node节点是上面的xml指向的Node对象
@ -36,11 +36,155 @@ p.Deserialize(); // 将node对象的xml序列化到tsl对象
// 序列化完毕后,可直接对应取值
echo p.PPr.Jc.Val; // 输出left
// 如果需要修改内容通过Serialize()回写到node
p.PPr.Jc.Val := "center";
// 回写方法1适合修改单个对象
p.PPr.Jc.Serialize();
// 回写方法2大量修改不同的对象
p.Serialize(); // 或p.PPr.Serialize()
// 在获取存在多个节点的对象时比如上述的w:r对象是复数的则需要通过Rs()获取
// 直接调用Rs()会获取所有的R对象加上索引会获取第N+1个
echo p.Rs(1).T.Text; // 输出:(份)
```
## 部署
## 基类
将此文件夹部署到tsl解释器下的`funcext`即可
`OpenXmlElement.tsf`提供了一些常用的方法,具体可见`tsf`文件
## 部件
### Components
一共有三个部件,分别是`Components@DOCX.tsf``Components@XLSX.tsf``Components@PPTX.tsf`
以`Components@DOCX.tsf`为例使用这个类可以获取到对应的docx文件的xml对象
```go
namespace "DOCX"
component := new Components(); // 创建对象
component.Open("", "xxx.docx"); // 打开文件
document := component.Document; // 获取document.xml生成Document对象
document.Deserialize(); // 将xml对象的数据反序列化到tsl对象中
document.Body.Elements(); // 可以获取document的body下的所有对象列表
// 反序列化后,可进行读写
styles := component.Styles; // 获取styles.xml生成Styles对象
```
document.xml内容如下
```xml
<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas"
xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex"
xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex"
mc:Ignorable="w14 w15 w16se w16cid w16 w16cex w16sdtdh w16du wp14">
<w:body>
<w:p w14:paraId="7B19BB62" w14:textId="33E8D5E1" w:rsidR="00B118EF"
w:rsidRDefault="00B118EF" w:rsidP="00B118EF">
<w:pPr>
<w:tabs>
<w:tab w:val="left" w:pos="5670" />
</w:tabs>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:hint="eastAsia" />
</w:rPr>
<w:t>分栏前</w:t>
</w:r>
</w:p>
<w:sectPr w:rsidR="00B118EF" w:rsidSect="002E4343">
<w:type w:val="continuous" />
<w:pgSz w:w="11906" w:h="16838" w:code="9" />
<w:pgMar w:top="1440" w:right="1797" w:bottom="1440" w:left="1797" w:header="851"
w:footer="992" w:gutter="0" />
<w:cols w:space="720" />
<w:docGrid w:type="linesAndChars" w:linePitch="312" />
</w:sectPr>
</w:body>
</w:document>
```
### 单位装饰器UnitDecorator
每个对象都有一个单位装饰器,能统一转成磅(point)单位(如果有配置属性转换),还能保留原来的接口
装饰器`tsf`统一命名是`原本对象名+UnitDecorator@命名空间`,如`docx`的`SectPr`对象的装饰器是`SectPrUnitDecorator@DOCX`
有下面一段xml其中的`pgSz.w = "11906", pgSz.h = "16838"`都需要转换成point
```xml
<w:sectPr w:rsidR="00B118EF" w:rsidSect="002E4343">
<w:type w:val="continuous" />
<w:pgSz w:w="11906" w:h="16838" w:code="9" />
<w:pgMar w:top="1440" w:right="1797" w:bottom="1440" w:left="1797" w:header="851"
w:footer="992" w:gutter="0" />
<w:cols w:space="720" />
<w:docGrid w:type="linesAndChars" w:linePitch="312" />
</w:sectPr>
```
```go
namespace "DOCX"
component := new Components(); // 创建对象
component.Open("", "xxx.docx"); // 打开文件
document := component.Document; // 获取document.xml生成Document对象
document.Deserialize(); // 将xml对象的数据反序列化到tsl对象中
sect_pr := document.Body.SectPr; // 获取SectPr对象
sect_pr_unit_decorator := new SectPrUnitDecorator(sect_pr); // 装饰器构造需要原本的对象
echo "w = ", sect_pr.PgSz.W; // 输出的是字符串原本的单位是twips
echo "\n";
echo "w = ", sect_pr_unit_decorator.PgSz.W; // 此时输出的是数字类型单位是point
```
### 适配器Adapter
适配器是通过key获取对应的对象比如样式可以通过样式ID获取对应的样式对象
只有部分对象才有适配器(具体可见`autoclass/adapter`),比如`Styles`的适配器是`StylesAdapter@DOCX`
styles.xml部分如下
```xml
<w:styles xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
<w:style w:type="character" w:customStyle="1" w:styleId="a4">
<w:name w:val="页眉 字符" />
<w:basedOn w:val="a0" />
<w:link w:val="a3" />
<w:uiPriority w:val="99" />
<w:rsid w:val="00B118EF" />
<w:rPr>
<w:sz w:val="18" />
<w:szCs w:val="18" />
</w:rPr>
</w:style>
<w:style w:type="character" w:customStyle="1" w:styleId="a6">
<w:name w:val="页脚 字符" />
<w:basedOn w:val="a0" />
<w:link w:val="a5" />
<w:uiPriority w:val="99" />
<w:rsid w:val="00B118EF" />
<w:rPr>
<w:sz w:val="18" />
<w:szCs w:val="18" />
</w:rPr>
</w:style>
</w:styles>
```
```go
namespace "DOCX"
component := new Components(); // 创建对象
component.Open("", "xxx.docx"); // 打开文件
document := component.Document; // 获取document.xml生成Document对象
document.Deserialize(); // 将xml对象的数据反序列化到tsl对象中
styles := document.Styles;
// 现在需要通过styleId获取Style对象
styles_adapter := new StylesAdapter(styles);
// 通过StyleId获取Style对象
style := styles_adapter.GetStyleByStyleId("a6");
echo style.Name; // 输出的是"页脚 字符"
```

View File

@ -0,0 +1,39 @@
type InsUnitDecorator = class(Ins)
uses TSSafeUnitConverter;
public
function Create(_obj: Ins);
function GetObject();
function Convert();
private
object_: Ins;
end;
function InsUnitDecorator.Create(_obj: Ins);
begin
class(Ins).Create();
object_ := _obj;
{self.}Convert();
end;
function InsUnitDecorator.GetObject();
begin
return object_;
end;
function InsUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
if not ifnil(object_.XmlAttrId) then
{self.}Id := object_.XmlAttrId.Value;
if not ifnil(object_.XmlAttrAuthor) then
{self.}Author := object_.XmlAttrAuthor.Value;
if not ifnil(object_.XmlAttrDate) then
{self.}Date := object_.XmlAttrDate.Value;
if not ifnil(object_.XmlAttrW16duDateUtc) then
{self.}W16duDateUtc := object_.XmlAttrW16duDateUtc.Value;
elems := object_.Rs();
for _,elem in elems do
{self.}AppendChild(new RUnitDecorator(elem));
tslassigning := tslassigning_backup;
end;

View File

@ -31,7 +31,7 @@ begin
if not ifnil(object_.XmlChildWidowControl) then
{self.}WidowControl.Copy(object_.XmlChildWidowControl);
if not ifnil(object_.XmlChildSnapToGrid) then
{self.}XmlChildSnapToGrid := new PureWValUnitDecorator(object_.XmlChildSnapToGrid);
{self.}SnapToGrid.Copy(object_.XmlChildSnapToGrid);
if not ifnil(object_.XmlChildPStyle) then
{self.}XmlChildPStyle := new PureWValUnitDecorator(object_.XmlChildPStyle);
if not ifnil(object_.XmlChildNumPr) then

View File

@ -38,6 +38,8 @@ begin
{self.}WRsidP := object_.XmlAttrWRsidP.Value;
if not ifnil(object_.XmlChildPPr) then
{self.}XmlChildPPr := new PPrUnitDecorator(object_.XmlChildPPr);
if not ifnil(object_.XmlChildIns) then
{self.}XmlChildIns := new InsUnitDecorator(object_.XmlChildIns);
elems := object_.Rs();
for _,elem in elems do
{self.}AppendChild(new RUnitDecorator(elem));

View File

@ -32,6 +32,8 @@ begin
{self.}XmlChildWebHidden := new PureWValUnitDecorator(object_.XmlChildWebHidden);
if not ifnil(object_.XmlChildRStyle) then
{self.}XmlChildRStyle := new PureWValUnitDecorator(object_.XmlChildRStyle);
if not ifnil(object_.XmlChildIns) then
{self.}XmlChildIns := new InsUnitDecorator(object_.XmlChildIns);
if not ifnil(object_.XmlChildRFonts) then
{self.}XmlChildRFonts := new RFontsUnitDecorator(object_.XmlChildRFonts);
if not ifnil(object_.XmlChildKern) then

View File

@ -34,5 +34,7 @@ begin
{self.}CantSplit.Copy(object_.XmlChildCantSplit);
if not ifnil(object_.XmlChildCnfStyle) then
{self.}XmlChildCnfStyle := new CnfStyleUnitDecorator(object_.XmlChildCnfStyle);
if not ifnil(object_.XmlChildIns) then
{self.}XmlChildIns := new InsUnitDecorator(object_.XmlChildIns);
tslassigning := tslassigning_backup;
end;

View File

@ -411,13 +411,16 @@ end;
function Anchor.ReadXmlChildWrapNone();
begin
if tslassigning and ifnil({self.}XmlChildWrapNone) then
if tslassigning then
begin
if ifnil({self.}XmlChildWrapNone) then
begin
{self.}XmlChildWrapNone := new OpenXmlEmpty(self, {self.}Prefix, "wrapNone");
container_.Set({self.}XmlChildWrapNone);
end
return {self.}XmlChildWrapNone;
end
return ifnil({self.}XmlChildWrapNone) ? false : {self.}XmlChildWrapNone.BoolValue();
return ifnil({self.}XmlChildWrapNone) ? nil : {self.}XmlChildWrapNone.BoolValue();
end;
function Anchor.WriteXmlChildWrapNone(_value);

View File

@ -467,13 +467,16 @@ end;
function BodyPr.ReadXmlChildNoAutofit();
begin
if tslassigning and ifnil({self.}XmlChildNoAutofit) then
if tslassigning then
begin
if ifnil({self.}XmlChildNoAutofit) then
begin
{self.}XmlChildNoAutofit := new OpenXmlEmpty(self, "a", "noAutofit");
container_.Set({self.}XmlChildNoAutofit);
end
return {self.}XmlChildNoAutofit;
end
return ifnil({self.}XmlChildNoAutofit) ? false : {self.}XmlChildNoAutofit.BoolValue();
return ifnil({self.}XmlChildNoAutofit) ? nil : {self.}XmlChildNoAutofit.BoolValue();
end;
function BodyPr.WriteXmlChildNoAutofit(_value);

View File

@ -161,13 +161,16 @@ end;
function ChartSpace.ReadXmlChildLang();
begin
if tslassigning and ifnil({self.}XmlChildLang) then
if tslassigning then
begin
if ifnil({self.}XmlChildLang) then
begin
{self.}XmlChildLang := new OpenXmlEmpty(self, {self.}Prefix, "lang");
container_.Set({self.}XmlChildLang);
end
return {self.}XmlChildLang;
end
return ifnil({self.}XmlChildLang) ? false : {self.}XmlChildLang.BoolValue();
return ifnil({self.}XmlChildLang) ? nil : {self.}XmlChildLang.BoolValue();
end;
function ChartSpace.WriteXmlChildLang(_value);

View File

@ -111,13 +111,16 @@ end;
function Compat.ReadXmlChildSpaceForUL();
begin
if tslassigning and ifnil({self.}XmlChildSpaceForUL) then
if tslassigning then
begin
if ifnil({self.}XmlChildSpaceForUL) then
begin
{self.}XmlChildSpaceForUL := new OpenXmlEmpty(self, {self.}Prefix, "spaceForUL");
container_.Set({self.}XmlChildSpaceForUL);
end
return {self.}XmlChildSpaceForUL;
end
return ifnil({self.}XmlChildSpaceForUL) ? false : {self.}XmlChildSpaceForUL.BoolValue();
return ifnil({self.}XmlChildSpaceForUL) ? nil : {self.}XmlChildSpaceForUL.BoolValue();
end;
function Compat.WriteXmlChildSpaceForUL(_value);
@ -132,13 +135,16 @@ end;
function Compat.ReadXmlChildBalanceSingleByteDoubleByteWidth();
begin
if tslassigning and ifnil({self.}XmlChildBalanceSingleByteDoubleByteWidth) then
if tslassigning then
begin
if ifnil({self.}XmlChildBalanceSingleByteDoubleByteWidth) then
begin
{self.}XmlChildBalanceSingleByteDoubleByteWidth := new OpenXmlEmpty(self, {self.}Prefix, "balanceSingleByteDoubleByteWidth");
container_.Set({self.}XmlChildBalanceSingleByteDoubleByteWidth);
end
return {self.}XmlChildBalanceSingleByteDoubleByteWidth;
end
return ifnil({self.}XmlChildBalanceSingleByteDoubleByteWidth) ? false : {self.}XmlChildBalanceSingleByteDoubleByteWidth.BoolValue();
return ifnil({self.}XmlChildBalanceSingleByteDoubleByteWidth) ? nil : {self.}XmlChildBalanceSingleByteDoubleByteWidth.BoolValue();
end;
function Compat.WriteXmlChildBalanceSingleByteDoubleByteWidth(_value);
@ -153,13 +159,16 @@ end;
function Compat.ReadXmlChildDoNotLeaveBackslashAlone();
begin
if tslassigning and ifnil({self.}XmlChildDoNotLeaveBackslashAlone) then
if tslassigning then
begin
if ifnil({self.}XmlChildDoNotLeaveBackslashAlone) then
begin
{self.}XmlChildDoNotLeaveBackslashAlone := new OpenXmlEmpty(self, {self.}Prefix, "doNotLeaveBackslashAlone");
container_.Set({self.}XmlChildDoNotLeaveBackslashAlone);
end
return {self.}XmlChildDoNotLeaveBackslashAlone;
end
return ifnil({self.}XmlChildDoNotLeaveBackslashAlone) ? false : {self.}XmlChildDoNotLeaveBackslashAlone.BoolValue();
return ifnil({self.}XmlChildDoNotLeaveBackslashAlone) ? nil : {self.}XmlChildDoNotLeaveBackslashAlone.BoolValue();
end;
function Compat.WriteXmlChildDoNotLeaveBackslashAlone(_value);
@ -174,13 +183,16 @@ end;
function Compat.ReadXmlChildUlTrailSpace();
begin
if tslassigning and ifnil({self.}XmlChildUlTrailSpace) then
if tslassigning then
begin
if ifnil({self.}XmlChildUlTrailSpace) then
begin
{self.}XmlChildUlTrailSpace := new OpenXmlEmpty(self, {self.}Prefix, "ulTrailSpace");
container_.Set({self.}XmlChildUlTrailSpace);
end
return {self.}XmlChildUlTrailSpace;
end
return ifnil({self.}XmlChildUlTrailSpace) ? false : {self.}XmlChildUlTrailSpace.BoolValue();
return ifnil({self.}XmlChildUlTrailSpace) ? nil : {self.}XmlChildUlTrailSpace.BoolValue();
end;
function Compat.WriteXmlChildUlTrailSpace(_value);
@ -195,13 +207,16 @@ end;
function Compat.ReadXmlChildDoNotExpandShiftReturn();
begin
if tslassigning and ifnil({self.}XmlChildDoNotExpandShiftReturn) then
if tslassigning then
begin
if ifnil({self.}XmlChildDoNotExpandShiftReturn) then
begin
{self.}XmlChildDoNotExpandShiftReturn := new OpenXmlEmpty(self, {self.}Prefix, "doNotExpandShiftReturn");
container_.Set({self.}XmlChildDoNotExpandShiftReturn);
end
return {self.}XmlChildDoNotExpandShiftReturn;
end
return ifnil({self.}XmlChildDoNotExpandShiftReturn) ? false : {self.}XmlChildDoNotExpandShiftReturn.BoolValue();
return ifnil({self.}XmlChildDoNotExpandShiftReturn) ? nil : {self.}XmlChildDoNotExpandShiftReturn.BoolValue();
end;
function Compat.WriteXmlChildDoNotExpandShiftReturn(_value);
@ -216,13 +231,16 @@ end;
function Compat.ReadXmlChildAdjustLineHeightInTable();
begin
if tslassigning and ifnil({self.}XmlChildAdjustLineHeightInTable) then
if tslassigning then
begin
if ifnil({self.}XmlChildAdjustLineHeightInTable) then
begin
{self.}XmlChildAdjustLineHeightInTable := new OpenXmlEmpty(self, {self.}Prefix, "adjustLineHeightInTable");
container_.Set({self.}XmlChildAdjustLineHeightInTable);
end
return {self.}XmlChildAdjustLineHeightInTable;
end
return ifnil({self.}XmlChildAdjustLineHeightInTable) ? false : {self.}XmlChildAdjustLineHeightInTable.BoolValue();
return ifnil({self.}XmlChildAdjustLineHeightInTable) ? nil : {self.}XmlChildAdjustLineHeightInTable.BoolValue();
end;
function Compat.WriteXmlChildAdjustLineHeightInTable(_value);
@ -237,13 +255,16 @@ end;
function Compat.ReadXmlChildUseFELayout();
begin
if tslassigning and ifnil({self.}XmlChildUseFELayout) then
if tslassigning then
begin
if ifnil({self.}XmlChildUseFELayout) then
begin
{self.}XmlChildUseFELayout := new OpenXmlEmpty(self, {self.}Prefix, "useFELayout");
container_.Set({self.}XmlChildUseFELayout);
end
return {self.}XmlChildUseFELayout;
end
return ifnil({self.}XmlChildUseFELayout) ? false : {self.}XmlChildUseFELayout.BoolValue();
return ifnil({self.}XmlChildUseFELayout) ? nil : {self.}XmlChildUseFELayout.BoolValue();
end;
function Compat.WriteXmlChildUseFELayout(_value);
@ -258,13 +279,16 @@ end;
function Compat.ReadXmlChildCompatSetting();
begin
if tslassigning and ifnil({self.}XmlChildCompatSetting) then
if tslassigning then
begin
if ifnil({self.}XmlChildCompatSetting) then
begin
{self.}XmlChildCompatSetting := new OpenXmlEmpty(self, {self.}Prefix, "compatSetting");
container_.Set({self.}XmlChildCompatSetting);
end
return {self.}XmlChildCompatSetting;
end
return ifnil({self.}XmlChildCompatSetting) ? false : {self.}XmlChildCompatSetting.BoolValue();
return ifnil({self.}XmlChildCompatSetting) ? nil : {self.}XmlChildCompatSetting.BoolValue();
end;
function Compat.WriteXmlChildCompatSetting(_value);

169
autoclass/docx/Ins@DOCX.tsf Normal file
View File

@ -0,0 +1,169 @@
type Ins = 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: Ins);override;
public
// attributes property
property Id read ReadXmlAttrId write WriteXmlAttrId;
property Author read ReadXmlAttrAuthor write WriteXmlAttrAuthor;
property Date read ReadXmlAttrDate write WriteXmlAttrDate;
property W16duDateUtc read ReadXmlAttrW16duDateUtc write WriteXmlAttrW16duDateUtc;
function ReadXmlAttrId();
function WriteXmlAttrId(_value);
function ReadXmlAttrAuthor();
function WriteXmlAttrAuthor(_value);
function ReadXmlAttrDate();
function WriteXmlAttrDate(_value);
function ReadXmlAttrW16duDateUtc();
function WriteXmlAttrW16duDateUtc(_value);
// multi property
property Rs read ReadRs;
function ReadRs(_index);
function AddR(): R;
function AppendR(): R;
public
// Attributes
XmlAttrId: OpenXmlAttribute;
XmlAttrAuthor: OpenXmlAttribute;
XmlAttrDate: OpenXmlAttribute;
XmlAttrW16duDateUtc: OpenXmlAttribute;
// Children
end;
function Ins.Create();overload;
begin
{self.}Create(nil, "w", "gridCol");
end;
function Ins.Create(_node: XmlNode);overload;
begin
class(OpenXmlElement).Create(_node: XmlNode);
end;
function Ins.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 Ins.Init();override;
begin
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
attributes_ := array();
attributes_pf_ := array(
pre + "id": makeweakref(thisFunction(WriteXmlAttrId)),
pre + "author": makeweakref(thisFunction(WriteXmlAttrAuthor)),
pre + "date": makeweakref(thisFunction(WriteXmlAttrDate)),
"w16du:dateUtc": makeweakref(thisFunction(WriteXmlAttrW16duDateUtc)),
);
sorted_child_ := array(
pre + "r": array(0, makeweakref(thisFunction(AppendR))),
);
container_ := new TSOfficeContainer(sorted_child_);
end;
function Ins.Copy(_obj: Ins);override;
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
class(OpenXmlElement).Copy(_obj);
if not ifnil(_obj.Id) then
{self.}Id := _obj.Id;
if not ifnil(_obj.Author) then
{self.}Author := _obj.Author;
if not ifnil(_obj.Date) then
{self.}Date := _obj.Date;
if not ifnil(_obj.W16duDateUtc) then
{self.}W16duDateUtc := _obj.W16duDateUtc;
tslassigning := tslassigning_backup;
end;
function Ins.ReadXmlAttrId();
begin
return {self.}XmlAttrId.Value;
end;
function Ins.WriteXmlAttrId(_value);
begin
if ifnil({self.}XmlAttrId) then
begin
{self.}XmlAttrId := new OpenXmlAttribute({self.}Prefix, "id", nil);
attributes_[length(attributes_)] := {self.}XmlAttrId;
end
{self.}XmlAttrId.Value := _value;
end;
function Ins.ReadXmlAttrAuthor();
begin
return {self.}XmlAttrAuthor.Value;
end;
function Ins.WriteXmlAttrAuthor(_value);
begin
if ifnil({self.}XmlAttrAuthor) then
begin
{self.}XmlAttrAuthor := new OpenXmlAttribute({self.}Prefix, "author", nil);
attributes_[length(attributes_)] := {self.}XmlAttrAuthor;
end
{self.}XmlAttrAuthor.Value := _value;
end;
function Ins.ReadXmlAttrDate();
begin
return {self.}XmlAttrDate.Value;
end;
function Ins.WriteXmlAttrDate(_value);
begin
if ifnil({self.}XmlAttrDate) then
begin
{self.}XmlAttrDate := new OpenXmlAttribute({self.}Prefix, "date", nil);
attributes_[length(attributes_)] := {self.}XmlAttrDate;
end
{self.}XmlAttrDate.Value := _value;
end;
function Ins.ReadXmlAttrW16duDateUtc();
begin
return {self.}XmlAttrW16duDateUtc.Value;
end;
function Ins.WriteXmlAttrW16duDateUtc(_value);
begin
if ifnil({self.}XmlAttrW16duDateUtc) then
begin
{self.}XmlAttrW16duDateUtc := new OpenXmlAttribute("w16du", "dateUtc", nil);
attributes_[length(attributes_)] := {self.}XmlAttrW16duDateUtc;
end
{self.}XmlAttrW16duDateUtc.Value := _value;
end;
function Ins.ReadRs(_index);
begin
ind := ifnil(_index) ? -2 : _index;
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
return container_.Get(pre + "r", ind);
end;
function Ins.AddR(): R;
begin
obj := new R(self, {self.}Prefix, "r");
container_.Insert(obj);
return obj;
end;
function Ins.AppendR(): R;
begin
obj := new R(self, {self.}Prefix, "r");
container_.Append(obj);
return obj;
end;

View File

@ -79,13 +79,16 @@ end;
function Legend.ReadXmlChildLayout();
begin
if tslassigning and ifnil({self.}XmlChildLayout) then
if tslassigning then
begin
if ifnil({self.}XmlChildLayout) then
begin
{self.}XmlChildLayout := new OpenXmlEmpty(self, {self.}Prefix, "layout");
container_.Set({self.}XmlChildLayout);
end
return {self.}XmlChildLayout;
end
return ifnil({self.}XmlChildLayout) ? false : {self.}XmlChildLayout.BoolValue();
return ifnil({self.}XmlChildLayout) ? nil : {self.}XmlChildLayout.BoolValue();
end;
function Legend.WriteXmlChildLayout(_value);

View File

@ -121,13 +121,16 @@ end;
function MathPr.ReadXmlChildDispDef();
begin
if tslassigning and ifnil({self.}XmlChildDispDef) then
if tslassigning then
begin
if ifnil({self.}XmlChildDispDef) then
begin
{self.}XmlChildDispDef := new OpenXmlEmpty(self, {self.}Prefix, "dispDef");
container_.Set({self.}XmlChildDispDef);
end
return {self.}XmlChildDispDef;
end
return ifnil({self.}XmlChildDispDef) ? false : {self.}XmlChildDispDef.BoolValue();
return ifnil({self.}XmlChildDispDef) ? nil : {self.}XmlChildDispDef.BoolValue();
end;
function MathPr.WriteXmlChildDispDef(_value);

View File

@ -30,7 +30,9 @@ public
// normal property
property PPr read ReadXmlChildPPr;
property Ins read ReadXmlChildIns;
function ReadXmlChildPPr();
function ReadXmlChildIns();
// multi property
property Rs read ReadRs;
@ -73,6 +75,7 @@ public
// Children
XmlChildPPr: PPr;
XmlChildIns: Ins;
end;
@ -106,13 +109,14 @@ begin
);
sorted_child_ := array(
pre + "pPr": array(0, makeweakref(thisFunction(ReadXmlChildPPr))),
pre + "r": array(1, makeweakref(thisFunction(AppendR))),
pre + "commentRangeStart": array(2, makeweakref(thisFunction(AppendCommentRangeStart))),
pre + "commentRangeEnd": array(3, makeweakref(thisFunction(AppendCommentRangeEnd))),
pre + "bookmarkStart": array(4, makeweakref(thisFunction(AppendBookmarkStart))),
pre + "bookmarkEnd": array(5, makeweakref(thisFunction(AppendBookmarkEnd))),
pre + "hyperlink": array(6, makeweakref(thisFunction(AppendHyperLink))),
pre + "fldSimple": array(7, makeweakref(thisFunction(AppendFldSimple))),
pre + "ins": array(1, makeweakref(thisFunction(ReadXmlChildIns))),
pre + "r": array(2, makeweakref(thisFunction(AppendR))),
pre + "commentRangeStart": array(3, makeweakref(thisFunction(AppendCommentRangeStart))),
pre + "commentRangeEnd": array(4, makeweakref(thisFunction(AppendCommentRangeEnd))),
pre + "bookmarkStart": array(5, makeweakref(thisFunction(AppendBookmarkStart))),
pre + "bookmarkEnd": array(6, makeweakref(thisFunction(AppendBookmarkEnd))),
pre + "hyperlink": array(7, makeweakref(thisFunction(AppendHyperLink))),
pre + "fldSimple": array(8, makeweakref(thisFunction(AppendFldSimple))),
);
container_ := new TSOfficeContainer(sorted_child_);
end;
@ -136,6 +140,8 @@ begin
{self.}WRsidP := _obj.WRsidP;
if not ifnil(_obj.XmlChildPPr) then
{self.}PPr.Copy(_obj.XmlChildPPr);
if not ifnil(_obj.XmlChildIns) then
{self.}Ins.Copy(_obj.XmlChildIns);
tslassigning := tslassigning_backup;
end;
@ -239,6 +245,16 @@ begin
return {self.}XmlChildPPr;
end;
function P.ReadXmlChildIns();
begin
if tslassigning and ifnil({self.}XmlChildIns) then
begin
{self.}XmlChildIns := new Ins(self, {self.}Prefix, "ins");
container_.Set({self.}XmlChildIns);
end
return {self.}XmlChildIns;
end;
function P.ReadRs(_index);
begin
ind := ifnil(_index) ? -2 : _index;

View File

@ -10,12 +10,15 @@ public
// empty property
property WidowControl read ReadXmlChildWidowControl write WriteXmlChildWidowControl;
property SnapToGrid read ReadXmlChildSnapToGrid write WriteXmlChildSnapToGrid;
property KeepNext read ReadXmlChildKeepNext write WriteXmlChildKeepNext;
property KeepLines read ReadXmlChildKeepLines write WriteXmlChildKeepLines;
property PageBreakBefore read ReadXmlChildPageBreakBefore write WriteXmlChildPageBreakBefore;
property ContextualSpacing read ReadXmlChildContextualSpacing write WriteXmlChildContextualSpacing;
function ReadXmlChildWidowControl();
function WriteXmlChildWidowControl(_value);
function ReadXmlChildSnapToGrid();
function WriteXmlChildSnapToGrid(_value);
function ReadXmlChildKeepNext();
function WriteXmlChildKeepNext(_value);
function ReadXmlChildKeepLines();
@ -28,7 +31,6 @@ public
// normal property
property SectPr read ReadXmlChildSectPr;
property Tabs read ReadXmlChildTabs;
property SnapToGrid read ReadXmlChildSnapToGrid;
property PStyle read ReadXmlChildPStyle;
property NumPr read ReadXmlChildNumPr;
property Jc read ReadXmlChildJc;
@ -45,7 +47,6 @@ public
property TextboxTightWrap read ReadXmlChildTextboxTightWrap;
function ReadXmlChildSectPr();
function ReadXmlChildTabs();
function ReadXmlChildSnapToGrid();
function ReadXmlChildPStyle();
function ReadXmlChildNumPr();
function ReadXmlChildJc();
@ -66,7 +67,7 @@ public
XmlChildSectPr: SectPr;
XmlChildTabs: Tabs;
XmlChildWidowControl: OpenXmlEmpty;
XmlChildSnapToGrid: PureWVal;
XmlChildSnapToGrid: OpenXmlEmpty;
XmlChildPStyle: PureWVal;
XmlChildNumPr: NumPr;
XmlChildJc: PureWVal;
@ -149,7 +150,7 @@ begin
if not ifnil(_obj.XmlChildWidowControl) then
ifnil({self.}XmlChildWidowControl) ? {self.}WidowControl.Copy(_obj.XmlChildWidowControl) : {self.}XmlChildWidowControl.Copy(_obj.XmlChildWidowControl);
if not ifnil(_obj.XmlChildSnapToGrid) then
{self.}SnapToGrid.Copy(_obj.XmlChildSnapToGrid);
ifnil({self.}XmlChildSnapToGrid) ? {self.}SnapToGrid.Copy(_obj.XmlChildSnapToGrid) : {self.}XmlChildSnapToGrid.Copy(_obj.XmlChildSnapToGrid);
if not ifnil(_obj.XmlChildPStyle) then
{self.}PStyle.Copy(_obj.XmlChildPStyle);
if not ifnil(_obj.XmlChildNumPr) then
@ -191,13 +192,16 @@ end;
function PPr.ReadXmlChildWidowControl();
begin
if tslassigning and ifnil({self.}XmlChildWidowControl) then
if tslassigning then
begin
if ifnil({self.}XmlChildWidowControl) then
begin
{self.}XmlChildWidowControl := new OpenXmlEmpty(self, {self.}Prefix, "widowControl");
container_.Set({self.}XmlChildWidowControl);
end
return {self.}XmlChildWidowControl;
end
return ifnil({self.}XmlChildWidowControl) ? false : {self.}XmlChildWidowControl.BoolValue();
return ifnil({self.}XmlChildWidowControl) ? nil : {self.}XmlChildWidowControl.BoolValue();
end;
function PPr.WriteXmlChildWidowControl(_value);
@ -210,15 +214,42 @@ begin
{self.}XmlChildWidowControl.Value := _value;
end;
function PPr.ReadXmlChildSnapToGrid();
begin
if tslassigning then
begin
if ifnil({self.}XmlChildSnapToGrid) then
begin
{self.}XmlChildSnapToGrid := new OpenXmlEmpty(self, {self.}Prefix, "snapToGrid");
container_.Set({self.}XmlChildSnapToGrid);
end
return {self.}XmlChildSnapToGrid;
end
return ifnil({self.}XmlChildSnapToGrid) ? nil : {self.}XmlChildSnapToGrid.BoolValue();
end;
function PPr.WriteXmlChildSnapToGrid(_value);
begin
if ifnil({self.}XmlChildSnapToGrid) then
begin
{self.}XmlChildSnapToGrid := new OpenXmlEmpty(self, {self.}Prefix, "snapToGrid");
container_.Set({self.}XmlChildSnapToGrid);
end
{self.}XmlChildSnapToGrid.Value := _value;
end;
function PPr.ReadXmlChildKeepNext();
begin
if tslassigning and ifnil({self.}XmlChildKeepNext) then
if tslassigning then
begin
if ifnil({self.}XmlChildKeepNext) then
begin
{self.}XmlChildKeepNext := new OpenXmlEmpty(self, {self.}Prefix, "keepNext");
container_.Set({self.}XmlChildKeepNext);
end
return {self.}XmlChildKeepNext;
end
return ifnil({self.}XmlChildKeepNext) ? false : {self.}XmlChildKeepNext.BoolValue();
return ifnil({self.}XmlChildKeepNext) ? nil : {self.}XmlChildKeepNext.BoolValue();
end;
function PPr.WriteXmlChildKeepNext(_value);
@ -233,13 +264,16 @@ end;
function PPr.ReadXmlChildKeepLines();
begin
if tslassigning and ifnil({self.}XmlChildKeepLines) then
if tslassigning then
begin
if ifnil({self.}XmlChildKeepLines) then
begin
{self.}XmlChildKeepLines := new OpenXmlEmpty(self, {self.}Prefix, "keepLines");
container_.Set({self.}XmlChildKeepLines);
end
return {self.}XmlChildKeepLines;
end
return ifnil({self.}XmlChildKeepLines) ? false : {self.}XmlChildKeepLines.BoolValue();
return ifnil({self.}XmlChildKeepLines) ? nil : {self.}XmlChildKeepLines.BoolValue();
end;
function PPr.WriteXmlChildKeepLines(_value);
@ -254,13 +288,16 @@ end;
function PPr.ReadXmlChildPageBreakBefore();
begin
if tslassigning and ifnil({self.}XmlChildPageBreakBefore) then
if tslassigning then
begin
if ifnil({self.}XmlChildPageBreakBefore) then
begin
{self.}XmlChildPageBreakBefore := new OpenXmlEmpty(self, {self.}Prefix, "pageBreakBefore");
container_.Set({self.}XmlChildPageBreakBefore);
end
return {self.}XmlChildPageBreakBefore;
end
return ifnil({self.}XmlChildPageBreakBefore) ? false : {self.}XmlChildPageBreakBefore.BoolValue();
return ifnil({self.}XmlChildPageBreakBefore) ? nil : {self.}XmlChildPageBreakBefore.BoolValue();
end;
function PPr.WriteXmlChildPageBreakBefore(_value);
@ -275,13 +312,16 @@ end;
function PPr.ReadXmlChildContextualSpacing();
begin
if tslassigning and ifnil({self.}XmlChildContextualSpacing) then
if tslassigning then
begin
if ifnil({self.}XmlChildContextualSpacing) then
begin
{self.}XmlChildContextualSpacing := new OpenXmlEmpty(self, {self.}Prefix, "contextualSpacing");
container_.Set({self.}XmlChildContextualSpacing);
end
return {self.}XmlChildContextualSpacing;
end
return ifnil({self.}XmlChildContextualSpacing) ? false : {self.}XmlChildContextualSpacing.BoolValue();
return ifnil({self.}XmlChildContextualSpacing) ? nil : {self.}XmlChildContextualSpacing.BoolValue();
end;
function PPr.WriteXmlChildContextualSpacing(_value);
@ -314,16 +354,6 @@ begin
return {self.}XmlChildTabs;
end;
function PPr.ReadXmlChildSnapToGrid();
begin
if tslassigning and ifnil({self.}XmlChildSnapToGrid) then
begin
{self.}XmlChildSnapToGrid := new PureWVal(self, {self.}Prefix, "snapToGrid");
container_.Set({self.}XmlChildSnapToGrid);
end
return {self.}XmlChildSnapToGrid;
end;
function PPr.ReadXmlChildPStyle();
begin
if tslassigning and ifnil({self.}XmlChildPStyle) then

View File

@ -91,13 +91,16 @@ end;
function PlotArea.ReadXmlChildLayout();
begin
if tslassigning and ifnil({self.}XmlChildLayout) then
if tslassigning then
begin
if ifnil({self.}XmlChildLayout) then
begin
{self.}XmlChildLayout := new OpenXmlEmpty(self, {self.}Prefix, "layout");
container_.Set({self.}XmlChildLayout);
end
return {self.}XmlChildLayout;
end
return ifnil({self.}XmlChildLayout) ? false : {self.}XmlChildLayout.BoolValue();
return ifnil({self.}XmlChildLayout) ? nil : {self.}XmlChildLayout.BoolValue();
end;
function PlotArea.WriteXmlChildLayout(_value);

View File

@ -85,13 +85,16 @@ end;
function PrstTxWrap.ReadXmlChildAvLst();
begin
if tslassigning and ifnil({self.}XmlChildAvLst) then
if tslassigning then
begin
if ifnil({self.}XmlChildAvLst) then
begin
{self.}XmlChildAvLst := new OpenXmlEmpty(self, "a", "avLst");
container_.Set({self.}XmlChildAvLst);
end
return {self.}XmlChildAvLst;
end
return ifnil({self.}XmlChildAvLst) ? false : {self.}XmlChildAvLst.BoolValue();
return ifnil({self.}XmlChildAvLst) ? nil : {self.}XmlChildAvLst.BoolValue();
end;
function PrstTxWrap.WriteXmlChildAvLst(_value);

View File

@ -206,13 +206,16 @@ end;
function R.ReadXmlChildSeparator();
begin
if tslassigning and ifnil({self.}XmlChildSeparator) then
if tslassigning then
begin
if ifnil({self.}XmlChildSeparator) then
begin
{self.}XmlChildSeparator := new OpenXmlEmpty(self, {self.}Prefix, "separator");
container_.Set({self.}XmlChildSeparator);
end
return {self.}XmlChildSeparator;
end
return ifnil({self.}XmlChildSeparator) ? false : {self.}XmlChildSeparator.BoolValue();
return ifnil({self.}XmlChildSeparator) ? nil : {self.}XmlChildSeparator.BoolValue();
end;
function R.WriteXmlChildSeparator(_value);
@ -227,13 +230,16 @@ end;
function R.ReadXmlChildContinuationSeparator();
begin
if tslassigning and ifnil({self.}XmlChildContinuationSeparator) then
if tslassigning then
begin
if ifnil({self.}XmlChildContinuationSeparator) then
begin
{self.}XmlChildContinuationSeparator := new OpenXmlEmpty(self, {self.}Prefix, "continuationSeparator");
container_.Set({self.}XmlChildContinuationSeparator);
end
return {self.}XmlChildContinuationSeparator;
end
return ifnil({self.}XmlChildContinuationSeparator) ? false : {self.}XmlChildContinuationSeparator.BoolValue();
return ifnil({self.}XmlChildContinuationSeparator) ? nil : {self.}XmlChildContinuationSeparator.BoolValue();
end;
function R.WriteXmlChildContinuationSeparator(_value);
@ -248,13 +254,16 @@ end;
function R.ReadXmlChildLastRenderedPageBreak();
begin
if tslassigning and ifnil({self.}XmlChildLastRenderedPageBreak) then
if tslassigning then
begin
if ifnil({self.}XmlChildLastRenderedPageBreak) then
begin
{self.}XmlChildLastRenderedPageBreak := new OpenXmlEmpty(self, {self.}Prefix, "lastRenderedPageBreak");
container_.Set({self.}XmlChildLastRenderedPageBreak);
end
return {self.}XmlChildLastRenderedPageBreak;
end
return ifnil({self.}XmlChildLastRenderedPageBreak) ? false : {self.}XmlChildLastRenderedPageBreak.BoolValue();
return ifnil({self.}XmlChildLastRenderedPageBreak) ? nil : {self.}XmlChildLastRenderedPageBreak.BoolValue();
end;
function R.WriteXmlChildLastRenderedPageBreak(_value);
@ -269,13 +278,16 @@ end;
function R.ReadXmlChildFootnoteRef();
begin
if tslassigning and ifnil({self.}XmlChildFootnoteRef) then
if tslassigning then
begin
if ifnil({self.}XmlChildFootnoteRef) then
begin
{self.}XmlChildFootnoteRef := new OpenXmlEmpty(self, {self.}Prefix, "footnoteRef");
container_.Set({self.}XmlChildFootnoteRef);
end
return {self.}XmlChildFootnoteRef;
end
return ifnil({self.}XmlChildFootnoteRef) ? false : {self.}XmlChildFootnoteRef.BoolValue();
return ifnil({self.}XmlChildFootnoteRef) ? nil : {self.}XmlChildFootnoteRef.BoolValue();
end;
function R.WriteXmlChildFootnoteRef(_value);

View File

@ -33,6 +33,7 @@ public
property Position read ReadXmlChildPosition;
property WebHidden read ReadXmlChildWebHidden;
property RStyle read ReadXmlChildRStyle;
property Ins read ReadXmlChildIns;
property RFonts read ReadXmlChildRFonts;
property Kern read ReadXmlChildKern;
property Color read ReadXmlChildColor;
@ -45,6 +46,7 @@ public
function ReadXmlChildPosition();
function ReadXmlChildWebHidden();
function ReadXmlChildRStyle();
function ReadXmlChildIns();
function ReadXmlChildRFonts();
function ReadXmlChildKern();
function ReadXmlChildColor();
@ -60,6 +62,7 @@ public
XmlChildPosition: PureVal;
XmlChildWebHidden: PureWVal;
XmlChildRStyle: PureWVal;
XmlChildIns: Ins;
XmlChildRFonts: RFonts;
XmlChildKern: PureWVal;
XmlChildI: OpenXmlEmpty;
@ -104,20 +107,21 @@ begin
pre + "position": array(1, makeweakref(thisFunction(ReadXmlChildPosition))),
pre + "wedHidden": array(2, makeweakref(thisFunction(ReadXmlChildWebHidden))),
pre + "rStyle": array(3, makeweakref(thisFunction(ReadXmlChildRStyle))),
pre + "rFonts": array(4, makeweakref(thisFunction(ReadXmlChildRFonts))),
pre + "kern": array(5, makeweakref(thisFunction(ReadXmlChildKern))),
pre + "i": array(6, makeweakref(thisFunction(ReadXmlChildI))),
pre + "iCs": array(7, makeweakref(thisFunction(ReadXmlChildICs))),
pre + "b": array(8, makeweakref(thisFunction(ReadXmlChildB))),
pre + "bCs": array(9, makeweakref(thisFunction(ReadXmlChildBCs))),
pre + "strike": array(10, makeweakref(thisFunction(ReadXmlChildStrike))),
pre + "color": array(11, makeweakref(thisFunction(ReadXmlChildColor))),
pre + "sz": array(12, makeweakref(thisFunction(ReadXmlChildSz))),
pre + "szCs": array(13, makeweakref(thisFunction(ReadXmlChildSzCs))),
pre + "u": array(14, makeweakref(thisFunction(ReadXmlChildU))),
pre + "lang": array(15, makeweakref(thisFunction(ReadXmlChildLang))),
pre + "vertAlign": array(16, makeweakref(thisFunction(ReadXmlChildVertAlign))),
"w14:ligatures": array(17, makeweakref(thisFunction(ReadXmlChildW14Ligatures))),
pre + "ins": array(4, makeweakref(thisFunction(ReadXmlChildIns))),
pre + "rFonts": array(5, makeweakref(thisFunction(ReadXmlChildRFonts))),
pre + "kern": array(6, makeweakref(thisFunction(ReadXmlChildKern))),
pre + "i": array(7, makeweakref(thisFunction(ReadXmlChildI))),
pre + "iCs": array(8, makeweakref(thisFunction(ReadXmlChildICs))),
pre + "b": array(9, makeweakref(thisFunction(ReadXmlChildB))),
pre + "bCs": array(10, makeweakref(thisFunction(ReadXmlChildBCs))),
pre + "strike": array(11, makeweakref(thisFunction(ReadXmlChildStrike))),
pre + "color": array(12, makeweakref(thisFunction(ReadXmlChildColor))),
pre + "sz": array(13, makeweakref(thisFunction(ReadXmlChildSz))),
pre + "szCs": array(14, makeweakref(thisFunction(ReadXmlChildSzCs))),
pre + "u": array(15, makeweakref(thisFunction(ReadXmlChildU))),
pre + "lang": array(16, makeweakref(thisFunction(ReadXmlChildLang))),
pre + "vertAlign": array(17, makeweakref(thisFunction(ReadXmlChildVertAlign))),
"w14:ligatures": array(18, makeweakref(thisFunction(ReadXmlChildW14Ligatures))),
);
container_ := new TSOfficeContainer(sorted_child_);
end;
@ -135,6 +139,8 @@ begin
{self.}WebHidden.Copy(_obj.XmlChildWebHidden);
if not ifnil(_obj.XmlChildRStyle) then
{self.}RStyle.Copy(_obj.XmlChildRStyle);
if not ifnil(_obj.XmlChildIns) then
{self.}Ins.Copy(_obj.XmlChildIns);
if not ifnil(_obj.XmlChildRFonts) then
{self.}RFonts.Copy(_obj.XmlChildRFonts);
if not ifnil(_obj.XmlChildKern) then
@ -168,13 +174,16 @@ end;
function RPr.ReadXmlChildI();
begin
if tslassigning and ifnil({self.}XmlChildI) then
if tslassigning then
begin
if ifnil({self.}XmlChildI) then
begin
{self.}XmlChildI := new OpenXmlEmpty(self, {self.}Prefix, "i");
container_.Set({self.}XmlChildI);
end
return {self.}XmlChildI;
end
return ifnil({self.}XmlChildI) ? false : {self.}XmlChildI.BoolValue();
return ifnil({self.}XmlChildI) ? nil : {self.}XmlChildI.BoolValue();
end;
function RPr.WriteXmlChildI(_value);
@ -189,13 +198,16 @@ end;
function RPr.ReadXmlChildICs();
begin
if tslassigning and ifnil({self.}XmlChildICs) then
if tslassigning then
begin
if ifnil({self.}XmlChildICs) then
begin
{self.}XmlChildICs := new OpenXmlEmpty(self, {self.}Prefix, "iCs");
container_.Set({self.}XmlChildICs);
end
return {self.}XmlChildICs;
end
return ifnil({self.}XmlChildICs) ? false : {self.}XmlChildICs.BoolValue();
return ifnil({self.}XmlChildICs) ? nil : {self.}XmlChildICs.BoolValue();
end;
function RPr.WriteXmlChildICs(_value);
@ -210,13 +222,16 @@ end;
function RPr.ReadXmlChildB();
begin
if tslassigning and ifnil({self.}XmlChildB) then
if tslassigning then
begin
if ifnil({self.}XmlChildB) then
begin
{self.}XmlChildB := new OpenXmlEmpty(self, {self.}Prefix, "b");
container_.Set({self.}XmlChildB);
end
return {self.}XmlChildB;
end
return ifnil({self.}XmlChildB) ? false : {self.}XmlChildB.BoolValue();
return ifnil({self.}XmlChildB) ? nil : {self.}XmlChildB.BoolValue();
end;
function RPr.WriteXmlChildB(_value);
@ -231,13 +246,16 @@ end;
function RPr.ReadXmlChildBCs();
begin
if tslassigning and ifnil({self.}XmlChildBCs) then
if tslassigning then
begin
if ifnil({self.}XmlChildBCs) then
begin
{self.}XmlChildBCs := new OpenXmlEmpty(self, {self.}Prefix, "bCs");
container_.Set({self.}XmlChildBCs);
end
return {self.}XmlChildBCs;
end
return ifnil({self.}XmlChildBCs) ? false : {self.}XmlChildBCs.BoolValue();
return ifnil({self.}XmlChildBCs) ? nil : {self.}XmlChildBCs.BoolValue();
end;
function RPr.WriteXmlChildBCs(_value);
@ -252,13 +270,16 @@ end;
function RPr.ReadXmlChildStrike();
begin
if tslassigning and ifnil({self.}XmlChildStrike) then
if tslassigning then
begin
if ifnil({self.}XmlChildStrike) then
begin
{self.}XmlChildStrike := new OpenXmlEmpty(self, {self.}Prefix, "strike");
container_.Set({self.}XmlChildStrike);
end
return {self.}XmlChildStrike;
end
return ifnil({self.}XmlChildStrike) ? false : {self.}XmlChildStrike.BoolValue();
return ifnil({self.}XmlChildStrike) ? nil : {self.}XmlChildStrike.BoolValue();
end;
function RPr.WriteXmlChildStrike(_value);
@ -273,13 +294,16 @@ end;
function RPr.ReadXmlChildU();
begin
if tslassigning and ifnil({self.}XmlChildU) then
if tslassigning then
begin
if ifnil({self.}XmlChildU) then
begin
{self.}XmlChildU := new OpenXmlEmpty(self, {self.}Prefix, "u");
container_.Set({self.}XmlChildU);
end
return {self.}XmlChildU;
end
return ifnil({self.}XmlChildU) ? false : {self.}XmlChildU.BoolValue();
return ifnil({self.}XmlChildU) ? nil : {self.}XmlChildU.BoolValue();
end;
function RPr.WriteXmlChildU(_value);
@ -332,6 +356,16 @@ begin
return {self.}XmlChildRStyle;
end;
function RPr.ReadXmlChildIns();
begin
if tslassigning and ifnil({self.}XmlChildIns) then
begin
{self.}XmlChildIns := new Ins(self, {self.}Prefix, "ins");
container_.Set({self.}XmlChildIns);
end
return {self.}XmlChildIns;
end;
function RPr.ReadXmlChildRFonts();
begin
if tslassigning and ifnil({self.}XmlChildRFonts) then

View File

@ -74,13 +74,16 @@ end;
function Rich.ReadXmlChildLstStyle();
begin
if tslassigning and ifnil({self.}XmlChildLstStyle) then
if tslassigning then
begin
if ifnil({self.}XmlChildLstStyle) then
begin
{self.}XmlChildLstStyle := new OpenXmlEmpty(self, "a", "lstStyle");
container_.Set({self.}XmlChildLstStyle);
end
return {self.}XmlChildLstStyle;
end
return ifnil({self.}XmlChildLstStyle) ? false : {self.}XmlChildLstStyle.BoolValue();
return ifnil({self.}XmlChildLstStyle) ? nil : {self.}XmlChildLstStyle.BoolValue();
end;
function Rich.WriteXmlChildLstStyle(_value);

View File

@ -59,13 +59,16 @@ end;
function Scaling.ReadXmlChildOrientation();
begin
if tslassigning and ifnil({self.}XmlChildOrientation) then
if tslassigning then
begin
if ifnil({self.}XmlChildOrientation) then
begin
{self.}XmlChildOrientation := new OpenXmlEmpty(self, {self.}Prefix, "orientation");
container_.Set({self.}XmlChildOrientation);
end
return {self.}XmlChildOrientation;
end
return ifnil({self.}XmlChildOrientation) ? false : {self.}XmlChildOrientation.BoolValue();
return ifnil({self.}XmlChildOrientation) ? nil : {self.}XmlChildOrientation.BoolValue();
end;
function Scaling.WriteXmlChildOrientation(_value);

View File

@ -169,13 +169,16 @@ end;
function SectPr.ReadXmlChildTitlePg();
begin
if tslassigning and ifnil({self.}XmlChildTitlePg) then
if tslassigning then
begin
if ifnil({self.}XmlChildTitlePg) then
begin
{self.}XmlChildTitlePg := new OpenXmlEmpty(self, {self.}Prefix, "titlePg");
container_.Set({self.}XmlChildTitlePg);
end
return {self.}XmlChildTitlePg;
end
return ifnil({self.}XmlChildTitlePg) ? false : {self.}XmlChildTitlePg.BoolValue();
return ifnil({self.}XmlChildTitlePg) ? nil : {self.}XmlChildTitlePg.BoolValue();
end;
function SectPr.WriteXmlChildTitlePg(_value);

View File

@ -515,13 +515,16 @@ end;
function Settings.ReadXmlChildBordersDoNotSurroundHeader();
begin
if tslassigning and ifnil({self.}XmlChildBordersDoNotSurroundHeader) then
if tslassigning then
begin
if ifnil({self.}XmlChildBordersDoNotSurroundHeader) then
begin
{self.}XmlChildBordersDoNotSurroundHeader := new OpenXmlEmpty(self, {self.}Prefix, "bordersDoNotSurroundHeader");
container_.Set({self.}XmlChildBordersDoNotSurroundHeader);
end
return {self.}XmlChildBordersDoNotSurroundHeader;
end
return ifnil({self.}XmlChildBordersDoNotSurroundHeader) ? false : {self.}XmlChildBordersDoNotSurroundHeader.BoolValue();
return ifnil({self.}XmlChildBordersDoNotSurroundHeader) ? nil : {self.}XmlChildBordersDoNotSurroundHeader.BoolValue();
end;
function Settings.WriteXmlChildBordersDoNotSurroundHeader(_value);
@ -536,13 +539,16 @@ end;
function Settings.ReadXmlChildBordersDoNotSurroundFooter();
begin
if tslassigning and ifnil({self.}XmlChildBordersDoNotSurroundFooter) then
if tslassigning then
begin
if ifnil({self.}XmlChildBordersDoNotSurroundFooter) then
begin
{self.}XmlChildBordersDoNotSurroundFooter := new OpenXmlEmpty(self, {self.}Prefix, "bordersDoNotSurroundFooter");
container_.Set({self.}XmlChildBordersDoNotSurroundFooter);
end
return {self.}XmlChildBordersDoNotSurroundFooter;
end
return ifnil({self.}XmlChildBordersDoNotSurroundFooter) ? false : {self.}XmlChildBordersDoNotSurroundFooter.BoolValue();
return ifnil({self.}XmlChildBordersDoNotSurroundFooter) ? nil : {self.}XmlChildBordersDoNotSurroundFooter.BoolValue();
end;
function Settings.WriteXmlChildBordersDoNotSurroundFooter(_value);
@ -557,13 +563,16 @@ end;
function Settings.ReadXmlChildEvenAndOddHeaders();
begin
if tslassigning and ifnil({self.}XmlChildEvenAndOddHeaders) then
if tslassigning then
begin
if ifnil({self.}XmlChildEvenAndOddHeaders) then
begin
{self.}XmlChildEvenAndOddHeaders := new OpenXmlEmpty(self, {self.}Prefix, "evenAndOddHeaders");
container_.Set({self.}XmlChildEvenAndOddHeaders);
end
return {self.}XmlChildEvenAndOddHeaders;
end
return ifnil({self.}XmlChildEvenAndOddHeaders) ? false : {self.}XmlChildEvenAndOddHeaders.BoolValue();
return ifnil({self.}XmlChildEvenAndOddHeaders) ? nil : {self.}XmlChildEvenAndOddHeaders.BoolValue();
end;
function Settings.WriteXmlChildEvenAndOddHeaders(_value);
@ -578,13 +587,16 @@ end;
function Settings.ReadXmlChildDoNotIncludeSubdocsInStats();
begin
if tslassigning and ifnil({self.}XmlChildDoNotIncludeSubdocsInStats) then
if tslassigning then
begin
if ifnil({self.}XmlChildDoNotIncludeSubdocsInStats) then
begin
{self.}XmlChildDoNotIncludeSubdocsInStats := new OpenXmlEmpty(self, {self.}Prefix, "doNotIncludeSubdocsInStats");
container_.Set({self.}XmlChildDoNotIncludeSubdocsInStats);
end
return {self.}XmlChildDoNotIncludeSubdocsInStats;
end
return ifnil({self.}XmlChildDoNotIncludeSubdocsInStats) ? false : {self.}XmlChildDoNotIncludeSubdocsInStats.BoolValue();
return ifnil({self.}XmlChildDoNotIncludeSubdocsInStats) ? nil : {self.}XmlChildDoNotIncludeSubdocsInStats.BoolValue();
end;
function Settings.WriteXmlChildDoNotIncludeSubdocsInStats(_value);
@ -599,13 +611,16 @@ end;
function Settings.ReadXmlChildW15ChartTrackingRefBased();
begin
if tslassigning and ifnil({self.}XmlChildW15ChartTrackingRefBased) then
if tslassigning then
begin
if ifnil({self.}XmlChildW15ChartTrackingRefBased) then
begin
{self.}XmlChildW15ChartTrackingRefBased := new OpenXmlEmpty(self, "w15", "chartTrackingRefBased");
container_.Set({self.}XmlChildW15ChartTrackingRefBased);
end
return {self.}XmlChildW15ChartTrackingRefBased;
end
return ifnil({self.}XmlChildW15ChartTrackingRefBased) ? false : {self.}XmlChildW15ChartTrackingRefBased.BoolValue();
return ifnil({self.}XmlChildW15ChartTrackingRefBased) ? nil : {self.}XmlChildW15ChartTrackingRefBased.BoolValue();
end;
function Settings.WriteXmlChildW15ChartTrackingRefBased(_value);

View File

@ -117,13 +117,16 @@ end;
function SpPr.ReadXmlChildNoFill();
begin
if tslassigning and ifnil({self.}XmlChildNoFill) then
if tslassigning then
begin
if ifnil({self.}XmlChildNoFill) then
begin
{self.}XmlChildNoFill := new OpenXmlEmpty(self, "a", "noFill");
container_.Set({self.}XmlChildNoFill);
end
return {self.}XmlChildNoFill;
end
return ifnil({self.}XmlChildNoFill) ? false : {self.}XmlChildNoFill.BoolValue();
return ifnil({self.}XmlChildNoFill) ? nil : {self.}XmlChildNoFill.BoolValue();
end;
function SpPr.WriteXmlChildNoFill(_value);

View File

@ -225,13 +225,16 @@ end;
function Style.ReadXmlChildSemiHidden();
begin
if tslassigning and ifnil({self.}XmlChildSemiHidden) then
if tslassigning then
begin
if ifnil({self.}XmlChildSemiHidden) then
begin
{self.}XmlChildSemiHidden := new OpenXmlEmpty(self, {self.}Prefix, "semiHidden");
container_.Set({self.}XmlChildSemiHidden);
end
return {self.}XmlChildSemiHidden;
end
return ifnil({self.}XmlChildSemiHidden) ? false : {self.}XmlChildSemiHidden.BoolValue();
return ifnil({self.}XmlChildSemiHidden) ? nil : {self.}XmlChildSemiHidden.BoolValue();
end;
function Style.WriteXmlChildSemiHidden(_value);
@ -246,13 +249,16 @@ end;
function Style.ReadXmlChildUnhideWhenUsed();
begin
if tslassigning and ifnil({self.}XmlChildUnhideWhenUsed) then
if tslassigning then
begin
if ifnil({self.}XmlChildUnhideWhenUsed) then
begin
{self.}XmlChildUnhideWhenUsed := new OpenXmlEmpty(self, {self.}Prefix, "unhideWhenUsed");
container_.Set({self.}XmlChildUnhideWhenUsed);
end
return {self.}XmlChildUnhideWhenUsed;
end
return ifnil({self.}XmlChildUnhideWhenUsed) ? false : {self.}XmlChildUnhideWhenUsed.BoolValue();
return ifnil({self.}XmlChildUnhideWhenUsed) ? nil : {self.}XmlChildUnhideWhenUsed.BoolValue();
end;
function Style.WriteXmlChildUnhideWhenUsed(_value);
@ -267,13 +273,16 @@ end;
function Style.ReadXmlChildQFormat();
begin
if tslassigning and ifnil({self.}XmlChildQFormat) then
if tslassigning then
begin
if ifnil({self.}XmlChildQFormat) then
begin
{self.}XmlChildQFormat := new OpenXmlEmpty(self, {self.}Prefix, "qFormat");
container_.Set({self.}XmlChildQFormat);
end
return {self.}XmlChildQFormat;
end
return ifnil({self.}XmlChildQFormat) ? false : {self.}XmlChildQFormat.BoolValue();
return ifnil({self.}XmlChildQFormat) ? nil : {self.}XmlChildQFormat.BoolValue();
end;
function Style.WriteXmlChildQFormat(_value);
@ -288,13 +297,16 @@ end;
function Style.ReadXmlChildRsid();
begin
if tslassigning and ifnil({self.}XmlChildRsid) then
if tslassigning then
begin
if ifnil({self.}XmlChildRsid) then
begin
{self.}XmlChildRsid := new OpenXmlEmpty(self, {self.}Prefix, "rsid");
container_.Set({self.}XmlChildRsid);
end
return {self.}XmlChildRsid;
end
return ifnil({self.}XmlChildRsid) ? false : {self.}XmlChildRsid.BoolValue();
return ifnil({self.}XmlChildRsid) ? nil : {self.}XmlChildRsid.BoolValue();
end;
function Style.WriteXmlChildRsid(_value);

View File

@ -98,13 +98,16 @@ end;
function TcPr.ReadXmlChildVMerge();
begin
if tslassigning and ifnil({self.}XmlChildVMerge) then
if tslassigning then
begin
if ifnil({self.}XmlChildVMerge) then
begin
{self.}XmlChildVMerge := new OpenXmlEmpty(self, {self.}Prefix, "vMerge");
container_.Set({self.}XmlChildVMerge);
end
return {self.}XmlChildVMerge;
end
return ifnil({self.}XmlChildVMerge) ? false : {self.}XmlChildVMerge.BoolValue();
return ifnil({self.}XmlChildVMerge) ? nil : {self.}XmlChildVMerge.BoolValue();
end;
function TcPr.WriteXmlChildVMerge(_value);
@ -119,13 +122,16 @@ end;
function TcPr.ReadXmlChildHideMark();
begin
if tslassigning and ifnil({self.}XmlChildHideMark) then
if tslassigning then
begin
if ifnil({self.}XmlChildHideMark) then
begin
{self.}XmlChildHideMark := new OpenXmlEmpty(self, {self.}Prefix, "hideMark");
container_.Set({self.}XmlChildHideMark);
end
return {self.}XmlChildHideMark;
end
return ifnil({self.}XmlChildHideMark) ? false : {self.}XmlChildHideMark.BoolValue();
return ifnil({self.}XmlChildHideMark) ? nil : {self.}XmlChildHideMark.BoolValue();
end;
function TcPr.WriteXmlChildHideMark(_value);

View File

@ -128,13 +128,16 @@ end;
function Theme.ReadXmlChildObjectDefaults();
begin
if tslassigning and ifnil({self.}XmlChildObjectDefaults) then
if tslassigning then
begin
if ifnil({self.}XmlChildObjectDefaults) then
begin
{self.}XmlChildObjectDefaults := new OpenXmlEmpty(self, {self.}Prefix, "objectDefaults");
container_.Set({self.}XmlChildObjectDefaults);
end
return {self.}XmlChildObjectDefaults;
end
return ifnil({self.}XmlChildObjectDefaults) ? false : {self.}XmlChildObjectDefaults.BoolValue();
return ifnil({self.}XmlChildObjectDefaults) ? nil : {self.}XmlChildObjectDefaults.BoolValue();
end;
function Theme.WriteXmlChildObjectDefaults(_value);
@ -149,13 +152,16 @@ end;
function Theme.ReadXmlChildExtraClrSchemeLst();
begin
if tslassigning and ifnil({self.}XmlChildExtraClrSchemeLst) then
if tslassigning then
begin
if ifnil({self.}XmlChildExtraClrSchemeLst) then
begin
{self.}XmlChildExtraClrSchemeLst := new OpenXmlEmpty(self, {self.}Prefix, "extraClrSchemeLst");
container_.Set({self.}XmlChildExtraClrSchemeLst);
end
return {self.}XmlChildExtraClrSchemeLst;
end
return ifnil({self.}XmlChildExtraClrSchemeLst) ? false : {self.}XmlChildExtraClrSchemeLst.BoolValue();
return ifnil({self.}XmlChildExtraClrSchemeLst) ? nil : {self.}XmlChildExtraClrSchemeLst.BoolValue();
end;
function Theme.WriteXmlChildExtraClrSchemeLst(_value);

View File

@ -73,13 +73,16 @@ end;
function Title.ReadXmlChildLayout();
begin
if tslassigning and ifnil({self.}XmlChildLayout) then
if tslassigning then
begin
if ifnil({self.}XmlChildLayout) then
begin
{self.}XmlChildLayout := new OpenXmlEmpty(self, {self.}Prefix, "layout");
container_.Set({self.}XmlChildLayout);
end
return {self.}XmlChildLayout;
end
return ifnil({self.}XmlChildLayout) ? false : {self.}XmlChildLayout.BoolValue();
return ifnil({self.}XmlChildLayout) ? nil : {self.}XmlChildLayout.BoolValue();
end;
function Title.WriteXmlChildLayout(_value);

View File

@ -18,10 +18,12 @@ public
property TblHeader read ReadXmlChildTblHeader;
property Jc read ReadXmlChildJc;
property CnfStyle read ReadXmlChildCnfStyle;
property Ins read ReadXmlChildIns;
function ReadXmlChildTrHeight();
function ReadXmlChildTblHeader();
function ReadXmlChildJc();
function ReadXmlChildCnfStyle();
function ReadXmlChildIns();
public
// Children
@ -30,6 +32,7 @@ public
XmlChildJc: PureWVal;
XmlChildCantSplit: OpenXmlEmpty;
XmlChildCnfStyle: CnfStyle;
XmlChildIns: Ins;
end;
@ -61,6 +64,7 @@ begin
pre + "jc": array(2, makeweakref(thisFunction(ReadXmlChildJc))),
pre + "cantSplit": array(3, makeweakref(thisFunction(ReadXmlChildCantSplit))),
pre + "cnfStyle": array(4, makeweakref(thisFunction(ReadXmlChildCnfStyle))),
pre + "ins": array(5, makeweakref(thisFunction(ReadXmlChildIns))),
);
container_ := new TSOfficeContainer(sorted_child_);
end;
@ -80,18 +84,23 @@ begin
ifnil({self.}XmlChildCantSplit) ? {self.}CantSplit.Copy(_obj.XmlChildCantSplit) : {self.}XmlChildCantSplit.Copy(_obj.XmlChildCantSplit);
if not ifnil(_obj.XmlChildCnfStyle) then
{self.}CnfStyle.Copy(_obj.XmlChildCnfStyle);
if not ifnil(_obj.XmlChildIns) then
{self.}Ins.Copy(_obj.XmlChildIns);
tslassigning := tslassigning_backup;
end;
function TrPr.ReadXmlChildCantSplit();
begin
if tslassigning and ifnil({self.}XmlChildCantSplit) then
if tslassigning then
begin
if ifnil({self.}XmlChildCantSplit) then
begin
{self.}XmlChildCantSplit := new OpenXmlEmpty(self, {self.}Prefix, "cantSplit");
container_.Set({self.}XmlChildCantSplit);
end
return {self.}XmlChildCantSplit;
end
return ifnil({self.}XmlChildCantSplit) ? false : {self.}XmlChildCantSplit.BoolValue();
return ifnil({self.}XmlChildCantSplit) ? nil : {self.}XmlChildCantSplit.BoolValue();
end;
function TrPr.WriteXmlChildCantSplit(_value);
@ -143,3 +152,13 @@ begin
end
return {self.}XmlChildCnfStyle;
end;
function TrPr.ReadXmlChildIns();
begin
if tslassigning and ifnil({self.}XmlChildIns) then
begin
{self.}XmlChildIns := new Ins(self, {self.}Prefix, "ins");
container_.Set({self.}XmlChildIns);
end
return {self.}XmlChildIns;
end;

View File

@ -74,13 +74,16 @@ end;
function TxPr.ReadXmlChildLstStyle();
begin
if tslassigning and ifnil({self.}XmlChildLstStyle) then
if tslassigning then
begin
if ifnil({self.}XmlChildLstStyle) then
begin
{self.}XmlChildLstStyle := new OpenXmlEmpty(self, "a", "lstStyle");
container_.Set({self.}XmlChildLstStyle);
end
return {self.}XmlChildLstStyle;
end
return ifnil({self.}XmlChildLstStyle) ? false : {self.}XmlChildLstStyle.BoolValue();
return ifnil({self.}XmlChildLstStyle) ? nil : {self.}XmlChildLstStyle.BoolValue();
end;
function TxPr.WriteXmlChildLstStyle(_value);

View File

@ -334,13 +334,16 @@ end;
function WebSettings.ReadXmlChildOptimizeForBrowser();
begin
if tslassigning and ifnil({self.}XmlChildOptimizeForBrowser) then
if tslassigning then
begin
if ifnil({self.}XmlChildOptimizeForBrowser) then
begin
{self.}XmlChildOptimizeForBrowser := new OpenXmlEmpty(self, {self.}Prefix, "optimizeForBrowser");
container_.Set({self.}XmlChildOptimizeForBrowser);
end
return {self.}XmlChildOptimizeForBrowser;
end
return ifnil({self.}XmlChildOptimizeForBrowser) ? false : {self.}XmlChildOptimizeForBrowser.BoolValue();
return ifnil({self.}XmlChildOptimizeForBrowser) ? nil : {self.}XmlChildOptimizeForBrowser.BoolValue();
end;
function WebSettings.WriteXmlChildOptimizeForBrowser(_value);
@ -355,13 +358,16 @@ end;
function WebSettings.ReadXmlChildAllowPNG();
begin
if tslassigning and ifnil({self.}XmlChildAllowPNG) then
if tslassigning then
begin
if ifnil({self.}XmlChildAllowPNG) then
begin
{self.}XmlChildAllowPNG := new OpenXmlEmpty(self, {self.}Prefix, "allowPNG");
container_.Set({self.}XmlChildAllowPNG);
end
return {self.}XmlChildAllowPNG;
end
return ifnil({self.}XmlChildAllowPNG) ? false : {self.}XmlChildAllowPNG.BoolValue();
return ifnil({self.}XmlChildAllowPNG) ? nil : {self.}XmlChildAllowPNG.BoolValue();
end;
function WebSettings.WriteXmlChildAllowPNG(_value);