v2.1.1 大量更新,功能性更新见readme

This commit is contained in:
csh 2025-05-30 14:44:32 +08:00
parent f816e8b6e3
commit b7a7b983b3
20 changed files with 25299 additions and 13986 deletions

155
README.md
View File

@ -1,6 +1,6 @@
# OfficeXml # OfficeXml
[迁移指南](./迁移指南.md) [迁移指南](./%E8%BF%81%E7%A7%BB%E6%8C%87%E5%8D%97.md)
## 概述 ## 概述
@ -53,26 +53,110 @@ echo p.Rs(1).T.Text; // 输出:(份)
## 基类 ## 基类
`OpenXmlAttribute`是节点的属性类 `OpenXmlAttribute`是节点的属性类
`OpenXmlElement.tsf`是节点基类
`OpenXmlSimpleType`是简单类型的元素节点类,继承于`OpenXmlElement`,如`<b />` `OpenXmlElement`是节点基类
`OpenXmlTextElement`是包含文本内容的元素节点类,继承于`OpenXmlElement`,如`<t>文本</t>`
`OpenXmlCompositeElement`是复杂节点的元素节点类,继承于`OpenXmlElement`,会包含一系列的属性或其他元素节点类 `OpenXmlSimpleType`是简单类型的元素节点类,继承于 `OpenXmlElement`,如 `<b />`
`OpenXmlTextElement`是包含文本内容的元素节点类,继承于 `OpenXmlElement`,如 `<t>文本</t>`
`OpenXmlCompositeElement`是复杂节点的元素节点类,继承于 `OpenXmlElement`,会包含一系列的属性或其他元素节点类
## 基本功能
### 获取属性/子节点
获取同名但命名空间不同的属性/子节点内容时,遵守以下规范
1. 默认情况下,获取的命名空间前缀与父节点一致
2. 当父节点有前缀,但是属性/子节点没有前缀时候,通过 `("")`空字符串参数获取
3. 存在同名属性/子节点情况下,默认获取的一定是和父节点前缀相同的内容
```xml
<m:r w:val="testw" val="testN" m:val="testm">
<m:rPr>
<m:sty m:val="p" />
</m:rPr>
<a:rPr lang="en-US"
altLang="zh-CN" sz="1100"
i="0" kern="1200">
<a:latin
typeface="Cambria Math"
panose="02040503050406030204"
pitchFamily="18"
charset="0" />
</a:rPr>
<m:t>cos</m:t>
</m:r>
```
```go
r.Val; // 默认获取前缀为m即m:val的属性
r.Val("m"); // 指定前缀m
r.Val(""); // 无前缀的属性即val
r.Val("w"); // 获取前缀为w即w:val的属性
r.RPr; // 默认获取前缀为m即m:rPr的子节点
r.RPr("m"); // 指定前缀为m
r.RPr("a"); // 获取前缀为a即a:rPr的子节点
```
### 删除属性/节点
```go
移除方式一通过RemoveAttribute或RemoveChild
// 移除r的属性w:val
// 因为r.Val("w")是直接获取了属性值所以不能作为参数传递给RemoveAttribute
r.RemoveAttribute(r.Attribute("w:val"));
// 移除r的子节点rPr
// 因为r.RPr就是一个对象所以可直接使用
r.RemoveChild(r.RPr);
移除方式二通过赋值nil
// 这种方式不需要区分属性和子节点,也不需要知道属性的全称
r.Val("w") := nil;
r.RPr := nil;
最后需要回写才会生效
r.Serialize();
```
### 回落功能(Fallback)
项目的 `fallback`功能是指获取某个属性或节点不存在时候,会检查是否设置了 `fallback`,如果设置了会通过 `fallback`获取对应的属性或节点
```xml
// pPr1
<w:pPr>
<w:jc w:val="left" />
</w:pPr>
// pPr2
<w:pPr>
<w:jc w:val="left" />
<w:wordWrap w:val="1" />
</w:pPr>
```
```go
// 假设已经获取到了对象ppr1和ppr2
ppr1.SetFallback(ppr2); // 将ppr1的fallback设置为ppr2
ppr1.Jc.Val; // 得到"left"
ppr1.WordWrap.Val; // ppr1不存在wordWrap但是ppr2存在wordWrap所以回落到ppr2的wordWrap获取到"1"
```
## Unit 单元 ## Unit 单元
- `DocxML` - `DocxML`包含 `docx`文件独有的 xml 节点对象,一般 xml 的命名空间是 `w`,如 `w:p`
包含`docx`文件独有的 xml 节点对象,一般 xml 的命名空间是`w`,如`w:p` - `PptxML`包含 `pptx`文件独有的 xml 节点对象,一般 xml 的命名空间是 `p`,如 `p:spPr`
- `PptxML` - `XlsxML`包含 `xlsx`文件独有的 xml 节点对象
包含`pptx`文件独有的 xml 节点对象,一般 xml 的命名空间是`p`,如`p:spPr` - `DrawingML`包含 `docx,pptx,xlsx`文件图形的 xml 节点对象,一般 xml 的命名空间是 `a`,如 `a:xfrm`
- `XlsxML` - `SharedML`包含 `docx,pptx,xlsx`文件共有的 xml 节点对象
包含`xlsx`文件独有的 xml 节点对象
- `DrawingML`
包含`docx,pptx,xlsx`文件图形的 xml 节点对象,一般 xml 的命名空间是`a`,如`a:xfrm`
- `SharedML`
包含`docx,pptx,xlsx`文件共有的 xml 节点对象
- `VML` - `VML`
[参考链接 1](http://webapp.docx4java.org/OnlineDemo/ecma376/) [参考链接 1](http://webapp.docx4java.org/OnlineDemo/ecma376/)
[参考链接 2](http://officeopenxml.com/index.php) [参考链接 2](http://officeopenxml.com/index.php)
## 部件 ## 部件
@ -85,7 +169,7 @@ echo p.Rs(1).T.Text; // 输出:(份)
2. `XlsxComponents`xlsx 文件的各部分 xml 内容 2. `XlsxComponents`xlsx 文件的各部分 xml 内容
3. `PptxComponents`pptx 文件的各部分 xml 内容 3. `PptxComponents`pptx 文件的各部分 xml 内容
以`DocxComponents.tsf`为例,使用这个类,可以获取到对应的 docx 文件的 xml 对象 `DocxComponents.tsf`为例,使用这个类,可以获取到对应的 docx 文件的 xml 对象
```go ```go
component := new DocxComponents(); // 创建对象 component := new DocxComponents(); // 创建对象
@ -136,9 +220,9 @@ document.xml 内容如下
每个对象都有一个单位装饰器,能统一转成磅(point)单位(如果有配置属性转换),还能保留原来的接口 每个对象都有一个单位装饰器,能统一转成磅(point)单位(如果有配置属性转换),还能保留原来的接口
每个`ML`都有装饰器`tsf`统一命名是`Unit的名称+UnitDecorator`,如`docx``docx`大部分`xml`隶属于`DocxML`)的`SectPr`对象的装饰器是`SectPrUnitDecorator` 每个 `ML`都有装饰器 `tsf`统一命名是 `Unit的名称+UnitDecorator`,如 `docx``docx`大部分 `xml`隶属于 `DocxML`)的 `SectPr`对象的装饰器是 `SectPrUnitDecorator`
如:有下面一段 xml其中的`pgSz.w = "11906", pgSz.h = "16838"`都需要转换成 point 如:有下面一段 xml其中的 `pgSz.w = "11906", pgSz.h = "16838"`都需要转换成 point
```xml ```xml
<w:sectPr w:rsidR="00B118EF" w:rsidSect="002E4343"> <w:sectPr w:rsidR="00B118EF" w:rsidSect="002E4343">
@ -153,7 +237,7 @@ document.xml 内容如下
```go ```go
uses DocxMLUnitDecorator; uses DocxMLUnitDecorator;
component := new Components(); // 创建对象 component := new DocxComponents(); // 创建对象
component.Open("", "xxx.docx"); // 打开文件 component.Open("", "xxx.docx"); // 打开文件
document := component.Document; // 获取document.xml生成Document对象 document := component.Document; // 获取document.xml生成Document对象
document.Deserialize(); // 将xml对象的数据反序列化到tsl对象中 document.Deserialize(); // 将xml对象的数据反序列化到tsl对象中
@ -169,7 +253,7 @@ echo "w = ", sect_pr_unit_decorator.PgSz.W; // 此时输出的是数字类
适配器是通过 key 获取对应的对象,比如样式可以通过样式 ID 获取对应的样式对象 适配器是通过 key 获取对应的对象,比如样式可以通过样式 ID 获取对应的样式对象
只有部分对象才有适配器(具体可见`autounit/xxxMLAdapter`),比如`DocxML.Styles`的适配器是`StylesAdapter` 只有部分对象才有适配器(具体可见 `autounit/xxxMLAdapter`),比如 `DocxML.Styles`的适配器是 `StylesAdapter`
styles.xml 部分如下 styles.xml 部分如下
@ -202,7 +286,7 @@ styles.xml 部分如下
```go ```go
uses DocxMLAdapter; uses DocxMLAdapter;
component := new Components(); // 创建对象 component := new DocxComponents(); // 创建对象
component.Open("", "xxx.docx"); // 打开文件 component.Open("", "xxx.docx"); // 打开文件
document := component.Document; // 获取document.xml生成Document对象 document := component.Document; // 获取document.xml生成Document对象
document.Deserialize(); // 将xml对象的数据反序列化到tsl对象中 document.Deserialize(); // 将xml对象的数据反序列化到tsl对象中
@ -214,32 +298,3 @@ styles_adapter := new StylesAdapter(styles);
style := styles_adapter.GetStyleByStyleId("a6"); style := styles_adapter.GetStyleByStyleId("a6");
echo style.Name; // 输出的是"页脚 字符" echo style.Name; // 输出的是"页脚 字符"
``` ```
### 其他设计的补充
```xml
<m:r>
<m:rPr>
<m:sty m:val="p" />
</m:rPr>
<a:rPr lang="en-US"
altLang="zh-CN" sz="1100"
i="0" kern="1200">
<a:latin
typeface="Cambria Math"
panose="02040503050406030204"
pitchFamily="18"
charset="0" />
</a:rPr>
<m:t>cos</m:t>
</m:r>
```
由于设计取对象时候不包含前缀,那么同时存在多个`rPr`时,如何区分是哪一个?
取`m:rPr`时,可通过`r.RPr`,这是因为它们的前缀都是`m`,所以可直接获取
取`a:rPr`时,需要指定前缀`a`,通过`r.RPr('a')`,进行获取`RPr`对象
## TODO
- [ ] 命名空间不同,但是名字相同属性的读写访问
- [ ] 属性的删除操作

File diff suppressed because it is too large Load Diff

View File

@ -290,6 +290,15 @@ private
object_: R; object_: R;
end; end;
type CommentReferenceUnitDecorator = class(CommentReference)
public
function Create(_obj: CommentReference);
function GetObject();
function Convert();
private
object_: CommentReference;
end;
type ObjectUnitDecorator = class(Object) type ObjectUnitDecorator = class(Object)
public public
function Create(_obj: Object); function Create(_obj: Object);
@ -1340,11 +1349,11 @@ begin
if not ifnil(object_.XmlChildTabs) then if not ifnil(object_.XmlChildTabs) then
{self.}XmlChildTabs := new TabsUnitDecorator(object_.XmlChildTabs); {self.}XmlChildTabs := new TabsUnitDecorator(object_.XmlChildTabs);
if not ifnil(object_.XmlChildBidi) then if not ifnil(object_.XmlChildBidi) then
{self.}XmlChildBidi.Copy(object_.XmlChildBidi); {self.}Bidi.Copy(object_.XmlChildBidi);
if not ifnil(object_.XmlChildWidowControl) then if not ifnil(object_.XmlChildWidowControl) then
{self.}XmlChildWidowControl.Copy(object_.XmlChildWidowControl); {self.}WidowControl.Copy(object_.XmlChildWidowControl);
if not ifnil(object_.XmlChildSnapToGrid) then if not ifnil(object_.XmlChildSnapToGrid) then
{self.}XmlChildSnapToGrid.Copy(object_.XmlChildSnapToGrid); {self.}SnapToGrid.Copy(object_.XmlChildSnapToGrid);
if not ifnil(object_.XmlChildPStyle) then if not ifnil(object_.XmlChildPStyle) then
{self.}XmlChildPStyle := new PureWValUnitDecorator(object_.XmlChildPStyle); {self.}XmlChildPStyle := new PureWValUnitDecorator(object_.XmlChildPStyle);
if not ifnil(object_.XmlChildNumPr) then if not ifnil(object_.XmlChildNumPr) then
@ -1354,21 +1363,21 @@ begin
if not ifnil(object_.XmlChildInd) then if not ifnil(object_.XmlChildInd) then
{self.}XmlChildInd := new IndUnitDecorator(object_.XmlChildInd); {self.}XmlChildInd := new IndUnitDecorator(object_.XmlChildInd);
if not ifnil(object_.XmlChildKeepNext) then if not ifnil(object_.XmlChildKeepNext) then
{self.}XmlChildKeepNext.Copy(object_.XmlChildKeepNext); {self.}KeepNext.Copy(object_.XmlChildKeepNext);
if not ifnil(object_.XmlChildKeepLines) then if not ifnil(object_.XmlChildKeepLines) then
{self.}XmlChildKeepLines.Copy(object_.XmlChildKeepLines); {self.}KeepLines.Copy(object_.XmlChildKeepLines);
if not ifnil(object_.XmlChildMirrorIndents) then if not ifnil(object_.XmlChildMirrorIndents) then
{self.}XmlChildMirrorIndents.Copy(object_.XmlChildMirrorIndents); {self.}MirrorIndents.Copy(object_.XmlChildMirrorIndents);
if not ifnil(object_.XmlChildKinsoku) then if not ifnil(object_.XmlChildKinsoku) then
{self.}XmlChildKinsoku := new PureWValUnitDecorator(object_.XmlChildKinsoku); {self.}XmlChildKinsoku := new PureWValUnitDecorator(object_.XmlChildKinsoku);
if not ifnil(object_.XmlChildPageBreakBefore) then if not ifnil(object_.XmlChildPageBreakBefore) then
{self.}XmlChildPageBreakBefore.Copy(object_.XmlChildPageBreakBefore); {self.}PageBreakBefore.Copy(object_.XmlChildPageBreakBefore);
if not ifnil(object_.XmlChildSuppressAutoHyphens) then if not ifnil(object_.XmlChildSuppressAutoHyphens) then
{self.}XmlChildSuppressAutoHyphens.Copy(object_.XmlChildSuppressAutoHyphens); {self.}SuppressAutoHyphens.Copy(object_.XmlChildSuppressAutoHyphens);
if not ifnil(object_.XmlChildSuppressLineNumbers) then if not ifnil(object_.XmlChildSuppressLineNumbers) then
{self.}XmlChildSuppressLineNumbers.Copy(object_.XmlChildSuppressLineNumbers); {self.}SuppressLineNumbers.Copy(object_.XmlChildSuppressLineNumbers);
if not ifnil(object_.XmlChildSuppressOverlap) then if not ifnil(object_.XmlChildSuppressOverlap) then
{self.}XmlChildSuppressOverlap.Copy(object_.XmlChildSuppressOverlap); {self.}SuppressOverlap.Copy(object_.XmlChildSuppressOverlap);
if not ifnil(object_.XmlChildOverflowPunct) then if not ifnil(object_.XmlChildOverflowPunct) then
{self.}XmlChildOverflowPunct := new PureWValUnitDecorator(object_.XmlChildOverflowPunct); {self.}XmlChildOverflowPunct := new PureWValUnitDecorator(object_.XmlChildOverflowPunct);
if not ifnil(object_.XmlChildAdjustRightInd) then if not ifnil(object_.XmlChildAdjustRightInd) then
@ -1386,7 +1395,7 @@ begin
if not ifnil(object_.XmlChildPBdr) then if not ifnil(object_.XmlChildPBdr) then
{self.}XmlChildPBdr := new PBdrUnitDecorator(object_.XmlChildPBdr); {self.}XmlChildPBdr := new PBdrUnitDecorator(object_.XmlChildPBdr);
if not ifnil(object_.XmlChildContextualSpacing) then if not ifnil(object_.XmlChildContextualSpacing) then
{self.}XmlChildContextualSpacing.Copy(object_.XmlChildContextualSpacing); {self.}ContextualSpacing.Copy(object_.XmlChildContextualSpacing);
if not ifnil(object_.XmlChildShd) then if not ifnil(object_.XmlChildShd) then
{self.}XmlChildShd := new ShdUnitDecorator(object_.XmlChildShd); {self.}XmlChildShd := new ShdUnitDecorator(object_.XmlChildShd);
if not ifnil(object_.XmlChildWordWrap) then if not ifnil(object_.XmlChildWordWrap) then
@ -1405,6 +1414,8 @@ begin
{self.}XmlChildTextAlignment := new PureWValUnitDecorator(object_.XmlChildTextAlignment); {self.}XmlChildTextAlignment := new PureWValUnitDecorator(object_.XmlChildTextAlignment);
if not ifnil(object_.XmlChildTextDirection) then if not ifnil(object_.XmlChildTextDirection) then
{self.}XmlChildTextDirection := new PureWValUnitDecorator(object_.XmlChildTextDirection); {self.}XmlChildTextDirection := new PureWValUnitDecorator(object_.XmlChildTextDirection);
if not ifnil(object_.XmlChildCollapsed) then
{self.}XmlChildCollapsed := new PureWValUnitDecorator(object_.XmlChildCollapsed);
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
@ -1698,13 +1709,13 @@ begin
if not ifnil(object_.XmlChildKern) then if not ifnil(object_.XmlChildKern) then
{self.}XmlChildKern := new PureWValUnitDecorator(object_.XmlChildKern); {self.}XmlChildKern := new PureWValUnitDecorator(object_.XmlChildKern);
if not ifnil(object_.XmlChildI) then if not ifnil(object_.XmlChildI) then
{self.}XmlChildI.Copy(object_.XmlChildI); {self.}I.Copy(object_.XmlChildI);
if not ifnil(object_.XmlChildICs) then if not ifnil(object_.XmlChildICs) then
{self.}XmlChildICs.Copy(object_.XmlChildICs); {self.}ICs.Copy(object_.XmlChildICs);
if not ifnil(object_.XmlChildB) then if not ifnil(object_.XmlChildB) then
{self.}XmlChildB.Copy(object_.XmlChildB); {self.}B.Copy(object_.XmlChildB);
if not ifnil(object_.XmlChildBCs) then if not ifnil(object_.XmlChildBCs) then
{self.}XmlChildBCs.Copy(object_.XmlChildBCs); {self.}BCs.Copy(object_.XmlChildBCs);
if not ifnil(object_.XmlChildBdr) then if not ifnil(object_.XmlChildBdr) then
{self.}XmlChildBdr := new BdrUnitDecorator(object_.XmlChildBdr); {self.}XmlChildBdr := new BdrUnitDecorator(object_.XmlChildBdr);
if not ifnil(object_.XmlChildCaps) then if not ifnil(object_.XmlChildCaps) then
@ -1712,7 +1723,7 @@ begin
if not ifnil(object_.XmlChildDel) then if not ifnil(object_.XmlChildDel) then
{self.}XmlChildDel := new DelUnitDecorator(object_.XmlChildDel); {self.}XmlChildDel := new DelUnitDecorator(object_.XmlChildDel);
if not ifnil(object_.XmlChildStrike) then if not ifnil(object_.XmlChildStrike) then
{self.}XmlChildStrike.Copy(object_.XmlChildStrike); {self.}Strike.Copy(object_.XmlChildStrike);
if not ifnil(object_.XmlChildDStrike) then if not ifnil(object_.XmlChildDStrike) then
{self.}XmlChildDStrike := new PureWValUnitDecorator(object_.XmlChildDStrike); {self.}XmlChildDStrike := new PureWValUnitDecorator(object_.XmlChildDStrike);
if not ifnil(object_.XmlChildEffect) then if not ifnil(object_.XmlChildEffect) then
@ -1730,13 +1741,13 @@ begin
if not ifnil(object_.XmlChildEastAsianLayout) then if not ifnil(object_.XmlChildEastAsianLayout) then
{self.}XmlChildEastAsianLayout := new EastAsianLayoutUnitDecorator(object_.XmlChildEastAsianLayout); {self.}XmlChildEastAsianLayout := new EastAsianLayoutUnitDecorator(object_.XmlChildEastAsianLayout);
if not ifnil(object_.XmlChildCs) then if not ifnil(object_.XmlChildCs) then
{self.}XmlChildCs.Copy(object_.XmlChildCs); {self.}Cs.Copy(object_.XmlChildCs);
if not ifnil(object_.XmlChildSz) then if not ifnil(object_.XmlChildSz) then
{self.}XmlChildSz := new SzUnitDecorator(object_.XmlChildSz); {self.}XmlChildSz := new SzUnitDecorator(object_.XmlChildSz);
if not ifnil(object_.XmlChildSzCs) then if not ifnil(object_.XmlChildSzCs) then
{self.}XmlChildSzCs := new SzCsUnitDecorator(object_.XmlChildSzCs); {self.}XmlChildSzCs := new SzCsUnitDecorator(object_.XmlChildSzCs);
if not ifnil(object_.XmlChildU) then if not ifnil(object_.XmlChildU) then
{self.}XmlChildU.Copy(object_.XmlChildU); {self.}U.Copy(object_.XmlChildU);
if not ifnil(object_.XmlChildLang) then if not ifnil(object_.XmlChildLang) then
{self.}XmlChildLang := new LangUnitDecorator(object_.XmlChildLang); {self.}XmlChildLang := new LangUnitDecorator(object_.XmlChildLang);
if not ifnil(object_.XmlChildImprint) then if not ifnil(object_.XmlChildImprint) then
@ -1748,13 +1759,13 @@ begin
if not ifnil(object_.XmlChildRtl) then if not ifnil(object_.XmlChildRtl) then
{self.}XmlChildRtl := new PureWValUnitDecorator(object_.XmlChildRtl); {self.}XmlChildRtl := new PureWValUnitDecorator(object_.XmlChildRtl);
if not ifnil(object_.XmlChildOMath) then if not ifnil(object_.XmlChildOMath) then
{self.}XmlChildOMath.Copy(object_.XmlChildOMath); {self.}OMath.Copy(object_.XmlChildOMath);
if not ifnil(object_.XmlChildShadow) then if not ifnil(object_.XmlChildShadow) then
{self.}XmlChildShadow.Copy(object_.XmlChildShadow); {self.}Shadow.Copy(object_.XmlChildShadow);
if not ifnil(object_.XmlChildSpecVanish) then if not ifnil(object_.XmlChildSpecVanish) then
{self.}XmlChildSpecVanish.Copy(object_.XmlChildSpecVanish); {self.}SpecVanish.Copy(object_.XmlChildSpecVanish);
if not ifnil(object_.XmlChildVanish) then if not ifnil(object_.XmlChildVanish) then
{self.}XmlChildVanish.Copy(object_.XmlChildVanish); {self.}Vanish.Copy(object_.XmlChildVanish);
if not ifnil(object_.XmlChildShd) then if not ifnil(object_.XmlChildShd) then
{self.}XmlChildShd := new ShdUnitDecorator(object_.XmlChildShd); {self.}XmlChildShd := new ShdUnitDecorator(object_.XmlChildShd);
if not ifnil(object_.XmlChildSmallCaps) then if not ifnil(object_.XmlChildSmallCaps) then
@ -2151,11 +2162,11 @@ begin
if not ifnil(object_.XmlChildInstrText) then if not ifnil(object_.XmlChildInstrText) then
{self.}XmlChildInstrText := new InstrTextUnitDecorator(object_.XmlChildInstrText); {self.}XmlChildInstrText := new InstrTextUnitDecorator(object_.XmlChildInstrText);
if not ifnil(object_.XmlChildSeparator) then if not ifnil(object_.XmlChildSeparator) then
{self.}XmlChildSeparator.Copy(object_.XmlChildSeparator); {self.}Separator.Copy(object_.XmlChildSeparator);
if not ifnil(object_.XmlChildContinuationSeparator) then if not ifnil(object_.XmlChildContinuationSeparator) then
{self.}XmlChildContinuationSeparator.Copy(object_.XmlChildContinuationSeparator); {self.}ContinuationSeparator.Copy(object_.XmlChildContinuationSeparator);
if not ifnil(object_.XmlChildLastRenderedPageBreak) then if not ifnil(object_.XmlChildLastRenderedPageBreak) then
{self.}XmlChildLastRenderedPageBreak.Copy(object_.XmlChildLastRenderedPageBreak); {self.}LastRenderedPageBreak.Copy(object_.XmlChildLastRenderedPageBreak);
if not ifnil(object_.XmlChildAlternateContent) then if not ifnil(object_.XmlChildAlternateContent) then
{self.}XmlChildAlternateContent := new AlternateContentUnitDecorator(object_.XmlChildAlternateContent); {self.}XmlChildAlternateContent := new AlternateContentUnitDecorator(object_.XmlChildAlternateContent);
if not ifnil(object_.XmlChildDrawing) then if not ifnil(object_.XmlChildDrawing) then
@ -2169,7 +2180,30 @@ begin
if not ifnil(object_.XmlChildFootnoteReference) then if not ifnil(object_.XmlChildFootnoteReference) then
{self.}XmlChildFootnoteReference := new FootnoteReferenceUnitDecorator(object_.XmlChildFootnoteReference); {self.}XmlChildFootnoteReference := new FootnoteReferenceUnitDecorator(object_.XmlChildFootnoteReference);
if not ifnil(object_.XmlChildFootnoteRef) then if not ifnil(object_.XmlChildFootnoteRef) then
{self.}XmlChildFootnoteRef.Copy(object_.XmlChildFootnoteRef); {self.}FootnoteRef.Copy(object_.XmlChildFootnoteRef);
if not ifnil(object_.XmlChildCommentReference) then
{self.}XmlChildCommentReference := new CommentReferenceUnitDecorator(object_.XmlChildCommentReference);
tslassigning := tslassigning_backup;
end;
function CommentReferenceUnitDecorator.Create(_obj: CommentReference);
begin
class(CommentReference).Create();
object_ := _obj;
{self.}Convert();
end;
function CommentReferenceUnitDecorator.GetObject();
begin
return object_;
end;
function CommentReferenceUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
if not ifnil(object_.XmlAttrId) then
{self.}Id := object_.XmlAttrId.Value;
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
@ -2697,7 +2731,7 @@ begin
if not ifnil(object_.XmlChildJc) then if not ifnil(object_.XmlChildJc) then
{self.}XmlChildJc := new PureWValUnitDecorator(object_.XmlChildJc); {self.}XmlChildJc := new PureWValUnitDecorator(object_.XmlChildJc);
if not ifnil(object_.XmlChildCantSplit) then if not ifnil(object_.XmlChildCantSplit) then
{self.}XmlChildCantSplit.Copy(object_.XmlChildCantSplit); {self.}CantSplit.Copy(object_.XmlChildCantSplit);
if not ifnil(object_.XmlChildCnfStyle) then if not ifnil(object_.XmlChildCnfStyle) then
{self.}XmlChildCnfStyle := new CnfStyleUnitDecorator(object_.XmlChildCnfStyle); {self.}XmlChildCnfStyle := new CnfStyleUnitDecorator(object_.XmlChildCnfStyle);
if not ifnil(object_.XmlChildIns) then if not ifnil(object_.XmlChildIns) then
@ -2853,11 +2887,11 @@ begin
if not ifnil(object_.XmlChildGridSpan) then if not ifnil(object_.XmlChildGridSpan) then
{self.}XmlChildGridSpan := new GridSpanUnitDecorator(object_.XmlChildGridSpan); {self.}XmlChildGridSpan := new GridSpanUnitDecorator(object_.XmlChildGridSpan);
if not ifnil(object_.XmlChildVMerge) then if not ifnil(object_.XmlChildVMerge) then
{self.}XmlChildVMerge.Copy(object_.XmlChildVMerge); {self.}VMerge.Copy(object_.XmlChildVMerge);
if not ifnil(object_.XmlChildVAlign) then if not ifnil(object_.XmlChildVAlign) then
{self.}XmlChildVAlign := new PureWValUnitDecorator(object_.XmlChildVAlign); {self.}XmlChildVAlign := new PureWValUnitDecorator(object_.XmlChildVAlign);
if not ifnil(object_.XmlChildHideMark) then if not ifnil(object_.XmlChildHideMark) then
{self.}XmlChildHideMark.Copy(object_.XmlChildHideMark); {self.}HideMark.Copy(object_.XmlChildHideMark);
if not ifnil(object_.XmlChildShd) then if not ifnil(object_.XmlChildShd) then
{self.}XmlChildShd := new ShdUnitDecorator(object_.XmlChildShd); {self.}XmlChildShd := new ShdUnitDecorator(object_.XmlChildShd);
if not ifnil(object_.XmlChildTcBorders) then if not ifnil(object_.XmlChildTcBorders) then
@ -3116,7 +3150,7 @@ begin
if not ifnil(object_.XmlChildCols) then if not ifnil(object_.XmlChildCols) then
{self.}XmlChildCols := new ColsUnitDecorator(object_.XmlChildCols); {self.}XmlChildCols := new ColsUnitDecorator(object_.XmlChildCols);
if not ifnil(object_.XmlChildTitlePg) then if not ifnil(object_.XmlChildTitlePg) then
{self.}XmlChildTitlePg.Copy(object_.XmlChildTitlePg); {self.}TitlePg.Copy(object_.XmlChildTitlePg);
if not ifnil(object_.XmlChildDocGrid) then if not ifnil(object_.XmlChildDocGrid) then
{self.}XmlChildDocGrid := new DocGridUnitDecorator(object_.XmlChildDocGrid); {self.}XmlChildDocGrid := new DocGridUnitDecorator(object_.XmlChildDocGrid);
if not ifnil(object_.XmlChildTextDirection) then if not ifnil(object_.XmlChildTextDirection) then
@ -3483,10 +3517,10 @@ begin
{self.}Usb2 := object_.XmlAttrUsb2.Value; {self.}Usb2 := object_.XmlAttrUsb2.Value;
if not ifnil(object_.XmlAttrUsb3) then if not ifnil(object_.XmlAttrUsb3) then
{self.}Usb3 := object_.XmlAttrUsb3.Value; {self.}Usb3 := object_.XmlAttrUsb3.Value;
if not ifnil(object_.XmlAttrcsb0) then if not ifnil(object_.XmlAttrCsb0) then
{self.}csb0 := object_.XmlAttrcsb0.Value; {self.}Csb0 := object_.XmlAttrCsb0.Value;
if not ifnil(object_.XmlAttrcsb1) then if not ifnil(object_.XmlAttrCsb1) then
{self.}csb1 := object_.XmlAttrcsb1.Value; {self.}Csb1 := object_.XmlAttrCsb1.Value;
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
@ -3508,48 +3542,20 @@ begin
tslassigning := 1; tslassigning := 1;
if not ifnil(object_.XmlAttrIgnorable) then if not ifnil(object_.XmlAttrIgnorable) then
{self.}Ignorable := object_.XmlAttrIgnorable.Value; {self.}Ignorable := object_.XmlAttrIgnorable.Value;
if not ifnil(object_.XmlChildZoom) then if not ifnil(object_.XmlAttrIgnorable) then
{self.}XmlChildZoom := new ZoomUnitDecorator(object_.XmlChildZoom); {self.}Ignorable := object_.XmlAttrIgnorable.Value;
if not ifnil(object_.XmlChildBordersDoNotSurroundHeader) then if not ifnil(object_.XmlAttrIgnorable) then
{self.}XmlChildBordersDoNotSurroundHeader.Copy(object_.XmlChildBordersDoNotSurroundHeader); {self.}Ignorable := object_.XmlAttrIgnorable.Value;
if not ifnil(object_.XmlChildBordersDoNotSurroundFooter) then if not ifnil(object_.XmlAttrPr) then
{self.}XmlChildBordersDoNotSurroundFooter.Copy(object_.XmlChildBordersDoNotSurroundFooter); {self.}Pr := object_.XmlAttrPr.Value;
if not ifnil(object_.XmlChildDefaultTabStop) then if not ifnil(object_.XmlAttrPr) then
{self.}XmlChildDefaultTabStop := new PureWValUnitDecorator(object_.XmlChildDefaultTabStop); {self.}Pr := object_.XmlAttrPr.Value;
if not ifnil(object_.XmlChildEvenAndOddHeaders) then if not ifnil(object_.XmlAttrSig) then
{self.}XmlChildEvenAndOddHeaders.Copy(object_.XmlChildEvenAndOddHeaders); {self.}Sig := object_.XmlAttrSig.Value;
if not ifnil(object_.XmlChildDrawingGridVerticalSpacing) then if not ifnil(object_.XmlAttrSig) then
{self.}XmlChildDrawingGridVerticalSpacing := new PureWValUnitDecorator(object_.XmlChildDrawingGridVerticalSpacing); {self.}Sig := object_.XmlAttrSig.Value;
if not ifnil(object_.XmlChildDisplayHorizontalDrawingGridEvery) then if not ifnil(object_.XmlAttrSig) then
{self.}XmlChildDisplayHorizontalDrawingGridEvery := new PureWValUnitDecorator(object_.XmlChildDisplayHorizontalDrawingGridEvery); {self.}Sig := object_.XmlAttrSig.Value;
if not ifnil(object_.XmlChildDisplayVerticalDrawingGridEvery) then
{self.}XmlChildDisplayVerticalDrawingGridEvery := new PureWValUnitDecorator(object_.XmlChildDisplayVerticalDrawingGridEvery);
if not ifnil(object_.XmlChildCharacterSpacingControl) then
{self.}XmlChildCharacterSpacingControl := new PureWValUnitDecorator(object_.XmlChildCharacterSpacingControl);
if not ifnil(object_.XmlChildHdrShapeDefaults) then
{self.}XmlChildHdrShapeDefaults := new HdrShapeDefaultsUnitDecorator(object_.XmlChildHdrShapeDefaults);
if not ifnil(object_.XmlChildFootnotePr) then
{self.}XmlChildFootnotePr := new FootnotePrUnitDecorator(object_.XmlChildFootnotePr);
if not ifnil(object_.XmlChildEndnotePr) then
{self.}XmlChildEndnotePr := new EndnotePrUnitDecorator(object_.XmlChildEndnotePr);
if not ifnil(object_.XmlChildCompat) then
{self.}XmlChildCompat := new CompatUnitDecorator(object_.XmlChildCompat);
if not ifnil(object_.XmlChildRsids) then
{self.}XmlChildRsids := new RsidsUnitDecorator(object_.XmlChildRsids);
if not ifnil(object_.XmlChildMathPr) then
{self.}XmlChildMathPr := new MathPrUnitDecorator(object_.XmlChildMathPr);
if not ifnil(object_.XmlChildThemeFontLang) then
{self.}XmlChildThemeFontLang := new ThemeFontLangUnitDecorator(object_.XmlChildThemeFontLang);
if not ifnil(object_.XmlChildClrSchemeMapping) then
{self.}XmlChildClrSchemeMapping := new ClrSchemeMappingUnitDecorator(object_.XmlChildClrSchemeMapping);
if not ifnil(object_.XmlChildDoNotIncludeSubdocsInStats) then
{self.}XmlChildDoNotIncludeSubdocsInStats.Copy(object_.XmlChildDoNotIncludeSubdocsInStats);
if not ifnil(object_.XmlChildShapeDefaults) then
{self.}XmlChildShapeDefaults := new ShapeDefaults2UnitDecorator(object_.XmlChildShapeDefaults);
if not ifnil(object_.XmlChildDecimalSymbol) then
{self.}XmlChildDecimalSymbol := new PureWValUnitDecorator(object_.XmlChildDecimalSymbol);
if not ifnil(object_.XmlChildListSeparator) then
{self.}XmlChildListSeparator := new PureWValUnitDecorator(object_.XmlChildListSeparator);
if not ifnil(object_.XmlChildDocId) then if not ifnil(object_.XmlChildDocId) then
{self.}XmlChildDocId := new PureWValUnitDecorator(object_.XmlChildDocId); {self.}XmlChildDocId := new PureWValUnitDecorator(object_.XmlChildDocId);
if not ifnil(object_.XmlChildDocId) then if not ifnil(object_.XmlChildDocId) then
@ -3557,7 +3563,7 @@ begin
if not ifnil(object_.XmlChildDocId) then if not ifnil(object_.XmlChildDocId) then
{self.}XmlChildDocId := new PureWValUnitDecorator(object_.XmlChildDocId); {self.}XmlChildDocId := new PureWValUnitDecorator(object_.XmlChildDocId);
if not ifnil(object_.XmlChildChartTrackingRefBased) then if not ifnil(object_.XmlChildChartTrackingRefBased) then
{self.}XmlChildChartTrackingRefBased.Copy(object_.XmlChildChartTrackingRefBased); {self.}ChartTrackingRefBased.Copy(object_.XmlChildChartTrackingRefBased);
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
@ -3703,19 +3709,19 @@ begin
tslassigning_backup := tslassigning; tslassigning_backup := tslassigning;
tslassigning := 1; tslassigning := 1;
if not ifnil(object_.XmlChildSpaceForUL) then if not ifnil(object_.XmlChildSpaceForUL) then
{self.}XmlChildSpaceForUL.Copy(object_.XmlChildSpaceForUL); {self.}SpaceForUL.Copy(object_.XmlChildSpaceForUL);
if not ifnil(object_.XmlChildBalanceSingleByteDoubleByteWidth) then if not ifnil(object_.XmlChildBalanceSingleByteDoubleByteWidth) then
{self.}XmlChildBalanceSingleByteDoubleByteWidth.Copy(object_.XmlChildBalanceSingleByteDoubleByteWidth); {self.}BalanceSingleByteDoubleByteWidth.Copy(object_.XmlChildBalanceSingleByteDoubleByteWidth);
if not ifnil(object_.XmlChildDoNotLeaveBackslashAlone) then if not ifnil(object_.XmlChildDoNotLeaveBackslashAlone) then
{self.}XmlChildDoNotLeaveBackslashAlone.Copy(object_.XmlChildDoNotLeaveBackslashAlone); {self.}DoNotLeaveBackslashAlone.Copy(object_.XmlChildDoNotLeaveBackslashAlone);
if not ifnil(object_.XmlChildUlTrailSpace) then if not ifnil(object_.XmlChildUlTrailSpace) then
{self.}XmlChildUlTrailSpace.Copy(object_.XmlChildUlTrailSpace); {self.}UlTrailSpace.Copy(object_.XmlChildUlTrailSpace);
if not ifnil(object_.XmlChildDoNotExpandShiftReturn) then if not ifnil(object_.XmlChildDoNotExpandShiftReturn) then
{self.}XmlChildDoNotExpandShiftReturn.Copy(object_.XmlChildDoNotExpandShiftReturn); {self.}DoNotExpandShiftReturn.Copy(object_.XmlChildDoNotExpandShiftReturn);
if not ifnil(object_.XmlChildAdjustLineHeightInTable) then if not ifnil(object_.XmlChildAdjustLineHeightInTable) then
{self.}XmlChildAdjustLineHeightInTable.Copy(object_.XmlChildAdjustLineHeightInTable); {self.}AdjustLineHeightInTable.Copy(object_.XmlChildAdjustLineHeightInTable);
if not ifnil(object_.XmlChildUseFELayout) then if not ifnil(object_.XmlChildUseFELayout) then
{self.}XmlChildUseFELayout.Copy(object_.XmlChildUseFELayout); {self.}UseFELayout.Copy(object_.XmlChildUseFELayout);
elems := object_.CompatSettings(); elems := object_.CompatSettings();
for _,elem in elems do for _,elem in elems do
{self.}AppendChild(new CompatSettingUnitDecorator(elem)); {self.}AppendChild(new CompatSettingUnitDecorator(elem));
@ -4097,11 +4103,11 @@ begin
if not ifnil(object_.XmlChildUIPriority) then if not ifnil(object_.XmlChildUIPriority) then
{self.}XmlChildUIPriority := new PureWValUnitDecorator(object_.XmlChildUIPriority); {self.}XmlChildUIPriority := new PureWValUnitDecorator(object_.XmlChildUIPriority);
if not ifnil(object_.XmlChildSemiHidden) then if not ifnil(object_.XmlChildSemiHidden) then
{self.}XmlChildSemiHidden.Copy(object_.XmlChildSemiHidden); {self.}SemiHidden.Copy(object_.XmlChildSemiHidden);
if not ifnil(object_.XmlChildUnhideWhenUsed) then if not ifnil(object_.XmlChildUnhideWhenUsed) then
{self.}XmlChildUnhideWhenUsed.Copy(object_.XmlChildUnhideWhenUsed); {self.}UnhideWhenUsed.Copy(object_.XmlChildUnhideWhenUsed);
if not ifnil(object_.XmlChildQFormat) then if not ifnil(object_.XmlChildQFormat) then
{self.}XmlChildQFormat.Copy(object_.XmlChildQFormat); {self.}QFormat.Copy(object_.XmlChildQFormat);
if not ifnil(object_.XmlChildRsid) then if not ifnil(object_.XmlChildRsid) then
{self.}XmlChildRsid := new PureWValUnitDecorator(object_.XmlChildRsid); {self.}XmlChildRsid := new PureWValUnitDecorator(object_.XmlChildRsid);
if not ifnil(object_.XmlChildPPr) then if not ifnil(object_.XmlChildPPr) then
@ -4220,9 +4226,9 @@ begin
if not ifnil(object_.XmlAttrIgnorable) then if not ifnil(object_.XmlAttrIgnorable) then
{self.}Ignorable := object_.XmlAttrIgnorable.Value; {self.}Ignorable := object_.XmlAttrIgnorable.Value;
if not ifnil(object_.XmlChildOptimizeForBrowser) then if not ifnil(object_.XmlChildOptimizeForBrowser) then
{self.}XmlChildOptimizeForBrowser.Copy(object_.XmlChildOptimizeForBrowser); {self.}OptimizeForBrowser.Copy(object_.XmlChildOptimizeForBrowser);
if not ifnil(object_.XmlChildAllowPNG) then if not ifnil(object_.XmlChildAllowPNG) then
{self.}XmlChildAllowPNG.Copy(object_.XmlChildAllowPNG); {self.}AllowPNG.Copy(object_.XmlChildAllowPNG);
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;

File diff suppressed because it is too large Load Diff

View File

@ -862,9 +862,9 @@ begin
if not ifnil(object_.XmlChildThemeElements) then if not ifnil(object_.XmlChildThemeElements) then
{self.}XmlChildThemeElements := new ThemeElementsUnitDecorator(object_.XmlChildThemeElements); {self.}XmlChildThemeElements := new ThemeElementsUnitDecorator(object_.XmlChildThemeElements);
if not ifnil(object_.XmlChildObjectDefaults) then if not ifnil(object_.XmlChildObjectDefaults) then
{self.}XmlChildObjectDefaults.Copy(object_.XmlChildObjectDefaults); {self.}ObjectDefaults.Copy(object_.XmlChildObjectDefaults);
if not ifnil(object_.XmlChildExtraClrSchemeLst) then if not ifnil(object_.XmlChildExtraClrSchemeLst) then
{self.}XmlChildExtraClrSchemeLst.Copy(object_.XmlChildExtraClrSchemeLst); {self.}ExtraClrSchemeLst.Copy(object_.XmlChildExtraClrSchemeLst);
if not ifnil(object_.XmlChildExtLst) then if not ifnil(object_.XmlChildExtLst) then
{self.}XmlChildExtLst := new ExtLstUnitDecorator(object_.XmlChildExtLst); {self.}XmlChildExtLst := new ExtLstUnitDecorator(object_.XmlChildExtLst);
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
@ -1623,7 +1623,7 @@ begin
if not ifnil(object_.XmlChildLegendPos) then if not ifnil(object_.XmlChildLegendPos) then
{self.}XmlChildLegendPos := new PureValUnitDecorator(object_.XmlChildLegendPos); {self.}XmlChildLegendPos := new PureValUnitDecorator(object_.XmlChildLegendPos);
if not ifnil(object_.XmlChildLayout) then if not ifnil(object_.XmlChildLayout) then
{self.}XmlChildLayout.Copy(object_.XmlChildLayout); {self.}Layout.Copy(object_.XmlChildLayout);
if not ifnil(object_.XmlChildOverlay) then if not ifnil(object_.XmlChildOverlay) then
{self.}XmlChildOverlay := new PureValUnitDecorator(object_.XmlChildOverlay); {self.}XmlChildOverlay := new PureValUnitDecorator(object_.XmlChildOverlay);
if not ifnil(object_.XmlChildTxPr) then if not ifnil(object_.XmlChildTxPr) then
@ -1673,7 +1673,7 @@ begin
tslassigning_backup := tslassigning; tslassigning_backup := tslassigning;
tslassigning := 1; tslassigning := 1;
if not ifnil(object_.XmlChildLayout) then if not ifnil(object_.XmlChildLayout) then
{self.}XmlChildLayout.Copy(object_.XmlChildLayout); {self.}Layout.Copy(object_.XmlChildLayout);
if not ifnil(object_.XmlChildBarChart) then if not ifnil(object_.XmlChildBarChart) then
{self.}XmlChildBarChart := new BarChartUnitDecorator(object_.XmlChildBarChart); {self.}XmlChildBarChart := new BarChartUnitDecorator(object_.XmlChildBarChart);
if not ifnil(object_.XmlChildCatAx) then if not ifnil(object_.XmlChildCatAx) then
@ -2094,7 +2094,7 @@ begin
if not ifnil(object_.XmlChildBodyPr) then if not ifnil(object_.XmlChildBodyPr) then
{self.}XmlChildBodyPr := new BodyPrUnitDecorator(object_.XmlChildBodyPr); {self.}XmlChildBodyPr := new BodyPrUnitDecorator(object_.XmlChildBodyPr);
if not ifnil(object_.XmlChildLstStyle) then if not ifnil(object_.XmlChildLstStyle) then
{self.}XmlChildLstStyle.Copy(object_.XmlChildLstStyle); {self.}LstStyle.Copy(object_.XmlChildLstStyle);
elems := object_.Ps(); elems := object_.Ps();
for _,elem in elems do for _,elem in elems do
{self.}AppendChild(new PUnitDecorator(elem)); {self.}AppendChild(new PUnitDecorator(elem));
@ -2120,7 +2120,7 @@ begin
if not ifnil(object_.XmlChildTx) then if not ifnil(object_.XmlChildTx) then
{self.}XmlChildTx := new TxUnitDecorator(object_.XmlChildTx); {self.}XmlChildTx := new TxUnitDecorator(object_.XmlChildTx);
if not ifnil(object_.XmlChildLayout) then if not ifnil(object_.XmlChildLayout) then
{self.}XmlChildLayout.Copy(object_.XmlChildLayout); {self.}Layout.Copy(object_.XmlChildLayout);
if not ifnil(object_.XmlChildOverlay) then if not ifnil(object_.XmlChildOverlay) then
{self.}XmlChildOverlay := new PureValUnitDecorator(object_.XmlChildOverlay); {self.}XmlChildOverlay := new PureValUnitDecorator(object_.XmlChildOverlay);
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
@ -2168,7 +2168,7 @@ begin
if not ifnil(object_.XmlChildBodyPr) then if not ifnil(object_.XmlChildBodyPr) then
{self.}XmlChildBodyPr := new BodyPrUnitDecorator(object_.XmlChildBodyPr); {self.}XmlChildBodyPr := new BodyPrUnitDecorator(object_.XmlChildBodyPr);
if not ifnil(object_.XmlChildLstStyle) then if not ifnil(object_.XmlChildLstStyle) then
{self.}XmlChildLstStyle.Copy(object_.XmlChildLstStyle); {self.}LstStyle.Copy(object_.XmlChildLstStyle);
elems := object_.Ps(); elems := object_.Ps();
for _,elem in elems do for _,elem in elems do
{self.}AppendChild(new PUnitDecorator(elem)); {self.}AppendChild(new PUnitDecorator(elem));
@ -2230,7 +2230,7 @@ begin
if not ifnil(object_.XmlChildPrstTxWrap) then if not ifnil(object_.XmlChildPrstTxWrap) then
{self.}XmlChildPrstTxWrap := new PrstTxWrapUnitDecorator(object_.XmlChildPrstTxWrap); {self.}XmlChildPrstTxWrap := new PrstTxWrapUnitDecorator(object_.XmlChildPrstTxWrap);
if not ifnil(object_.XmlChildNoAutofit) then if not ifnil(object_.XmlChildNoAutofit) then
{self.}XmlChildNoAutofit.Copy(object_.XmlChildNoAutofit); {self.}NoAutofit.Copy(object_.XmlChildNoAutofit);
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
@ -2253,7 +2253,7 @@ begin
if not ifnil(object_.XmlAttrPrst) then if not ifnil(object_.XmlAttrPrst) then
{self.}Prst := object_.XmlAttrPrst.Value; {self.}Prst := object_.XmlAttrPrst.Value;
if not ifnil(object_.XmlChildAvLst) then if not ifnil(object_.XmlChildAvLst) then
{self.}XmlChildAvLst.Copy(object_.XmlChildAvLst); {self.}AvLst.Copy(object_.XmlChildAvLst);
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
@ -2952,7 +2952,7 @@ begin
if not ifnil(object_.XmlChildPrstGeom) then if not ifnil(object_.XmlChildPrstGeom) then
{self.}XmlChildPrstGeom := new PrstGeomUnitDecorator(object_.XmlChildPrstGeom); {self.}XmlChildPrstGeom := new PrstGeomUnitDecorator(object_.XmlChildPrstGeom);
if not ifnil(object_.XmlChildNoFill) then if not ifnil(object_.XmlChildNoFill) then
{self.}XmlChildNoFill.Copy(object_.XmlChildNoFill); {self.}NoFill.Copy(object_.XmlChildNoFill);
if not ifnil(object_.XmlChildSolidFill) then if not ifnil(object_.XmlChildSolidFill) then
{self.}XmlChildSolidFill := new SolidFillUnitDecorator(object_.XmlChildSolidFill); {self.}XmlChildSolidFill := new SolidFillUnitDecorator(object_.XmlChildSolidFill);
if not ifnil(object_.XmlChildLn) then if not ifnil(object_.XmlChildLn) then
@ -3008,7 +3008,7 @@ begin
if not ifnil(object_.XmlAttrAlgn) then if not ifnil(object_.XmlAttrAlgn) then
{self.}Algn := object_.XmlAttrAlgn.Value; {self.}Algn := object_.XmlAttrAlgn.Value;
if not ifnil(object_.XmlChildNoFill) then if not ifnil(object_.XmlChildNoFill) then
{self.}XmlChildNoFill.Copy(object_.XmlChildNoFill); {self.}NoFill.Copy(object_.XmlChildNoFill);
if not ifnil(object_.XmlChildSolidFill) then if not ifnil(object_.XmlChildSolidFill) then
{self.}XmlChildSolidFill := new SolidFillUnitDecorator(object_.XmlChildSolidFill); {self.}XmlChildSolidFill := new SolidFillUnitDecorator(object_.XmlChildSolidFill);
if not ifnil(object_.XmlChildPrstDash) then if not ifnil(object_.XmlChildPrstDash) then
@ -3016,9 +3016,9 @@ begin
if not ifnil(object_.XmlChildMiter) then if not ifnil(object_.XmlChildMiter) then
{self.}XmlChildMiter := new MiterUnitDecorator(object_.XmlChildMiter); {self.}XmlChildMiter := new MiterUnitDecorator(object_.XmlChildMiter);
if not ifnil(object_.XmlChildHeadEnd) then if not ifnil(object_.XmlChildHeadEnd) then
{self.}XmlChildHeadEnd.Copy(object_.XmlChildHeadEnd); {self.}HeadEnd.Copy(object_.XmlChildHeadEnd);
if not ifnil(object_.XmlChildTailEnd) then if not ifnil(object_.XmlChildTailEnd) then
{self.}XmlChildTailEnd.Copy(object_.XmlChildTailEnd); {self.}TailEnd.Copy(object_.XmlChildTailEnd);
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
@ -3194,7 +3194,7 @@ begin
if not ifnil(object_.XmlChildEffectExtent) then if not ifnil(object_.XmlChildEffectExtent) then
{self.}XmlChildEffectExtent := new EffectExtentUnitDecorator(object_.XmlChildEffectExtent); {self.}XmlChildEffectExtent := new EffectExtentUnitDecorator(object_.XmlChildEffectExtent);
if not ifnil(object_.XmlChildWrapNone) then if not ifnil(object_.XmlChildWrapNone) then
{self.}XmlChildWrapNone.Copy(object_.XmlChildWrapNone); {self.}WrapNone.Copy(object_.XmlChildWrapNone);
if not ifnil(object_.XmlChildDocPr) then if not ifnil(object_.XmlChildDocPr) then
{self.}XmlChildDocPr := new DocPrUnitDecorator(object_.XmlChildDocPr); {self.}XmlChildDocPr := new DocPrUnitDecorator(object_.XmlChildDocPr);
if not ifnil(object_.XmlChildCNvGraphicFramePr) then if not ifnil(object_.XmlChildCNvGraphicFramePr) then

File diff suppressed because it is too large Load Diff

View File

@ -101,15 +101,6 @@ private
object_: CtrlPr; object_: CtrlPr;
end; end;
type EUnitDecorator = class(E)
public
function Create(_obj: E);
function GetObject();
function Convert();
private
object_: E;
end;
type SSupUnitDecorator = class(SSup) type SSupUnitDecorator = class(SSup)
public public
function Create(_obj: SSup); function Create(_obj: SSup);
@ -128,15 +119,6 @@ private
object_: SSupPr; object_: SSupPr;
end; end;
type SupUnitDecorator = class(Sup)
public
function Create(_obj: Sup);
function GetObject();
function Convert();
private
object_: Sup;
end;
type FUnitDecorator = class(F) type FUnitDecorator = class(F)
public public
function Create(_obj: F); function Create(_obj: F);
@ -155,15 +137,6 @@ private
object_: FPr; object_: FPr;
end; end;
type NumUnitDecorator = class(Num)
public
function Create(_obj: Num);
function GetObject();
function Convert();
private
object_: Num;
end;
type RadUnitDecorator = class(Rad) type RadUnitDecorator = class(Rad)
public public
function Create(_obj: Rad); function Create(_obj: Rad);
@ -182,24 +155,6 @@ private
object_: RadPr; object_: RadPr;
end; end;
type DegUnitDecorator = class(Deg)
public
function Create(_obj: Deg);
function GetObject();
function Convert();
private
object_: Deg;
end;
type DenUnitDecorator = class(Den)
public
function Create(_obj: Den);
function GetObject();
function Convert();
private
object_: Den;
end;
type SSubUnitDecorator = class(SSub) type SSubUnitDecorator = class(SSub)
public public
function Create(_obj: SSub); function Create(_obj: SSub);
@ -218,15 +173,6 @@ private
object_: SSubPr; object_: SSubPr;
end; end;
type SubUnitDecorator = class(Sub)
public
function Create(_obj: Sub);
function GetObject();
function Convert();
private
object_: Sub;
end;
type NaryUnitDecorator = class(Nary) type NaryUnitDecorator = class(Nary)
public public
function Create(_obj: Nary); function Create(_obj: Nary);
@ -344,6 +290,60 @@ private
object_: _Override; object_: _Override;
end; end;
type NumUnitDecorator = class(Num)
public
function Create(_obj: Num);
function GetObject();
function Convert();
private
object_: Num;
end;
type DegUnitDecorator = class(Deg)
public
function Create(_obj: Deg);
function GetObject();
function Convert();
private
object_: Deg;
end;
type EUnitDecorator = class(E)
public
function Create(_obj: E);
function GetObject();
function Convert();
private
object_: E;
end;
type SupUnitDecorator = class(Sup)
public
function Create(_obj: Sup);
function GetObject();
function Convert();
private
object_: Sup;
end;
type DenUnitDecorator = class(Den)
public
function Create(_obj: Den);
function GetObject();
function Convert();
private
object_: Den;
end;
type SubUnitDecorator = class(Sub)
public
function Create(_obj: Sub);
function GetObject();
function Convert();
private
object_: Sub;
end;
implementation implementation
function MathPrUnitDecorator.Create(_obj: MathPr); function MathPrUnitDecorator.Create(_obj: MathPr);
@ -371,7 +371,7 @@ begin
if not ifnil(object_.XmlChildSmallFrac) then if not ifnil(object_.XmlChildSmallFrac) then
{self.}XmlChildSmallFrac := new PureMValUnitDecorator(object_.XmlChildSmallFrac); {self.}XmlChildSmallFrac := new PureMValUnitDecorator(object_.XmlChildSmallFrac);
if not ifnil(object_.XmlChildDispDef) then if not ifnil(object_.XmlChildDispDef) then
{self.}XmlChildDispDef.Copy(object_.XmlChildDispDef); {self.}DispDef.Copy(object_.XmlChildDispDef);
if not ifnil(object_.XmlChildLMargin) then if not ifnil(object_.XmlChildLMargin) then
{self.}XmlChildLMargin := new PureMValUnitDecorator(object_.XmlChildLMargin); {self.}XmlChildLMargin := new PureMValUnitDecorator(object_.XmlChildLMargin);
if not ifnil(object_.XmlChildRMargin) then if not ifnil(object_.XmlChildRMargin) then
@ -483,9 +483,15 @@ begin
elems := object_.SSubs(); elems := object_.SSubs();
for _,elem in elems do for _,elem in elems do
{self.}AppendChild(new SSubUnitDecorator(elem)); {self.}AppendChild(new SSubUnitDecorator(elem));
elems := object_.SSups();
for _,elem in elems do
{self.}AppendChild(new SSupUnitDecorator(elem));
elems := object_.Naries(); elems := object_.Naries();
for _,elem in elems do for _,elem in elems do
{self.}AppendChild(new NaryUnitDecorator(elem)); {self.}AppendChild(new NaryUnitDecorator(elem));
elems := object_.Funcs();
for _,elem in elems do
{self.}AppendChild(new FuncUnitDecorator(elem));
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
@ -637,44 +643,6 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function EUnitDecorator.Create(_obj: E);
begin
class(E).Create();
object_ := _obj;
{self.}Convert();
end;
function EUnitDecorator.GetObject();
begin
return object_;
end;
function EUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
elems := object_.Rs();
for _,elem in elems do
{self.}AppendChild(new RUnitDecorator(elem));
elems := object_.Ds();
for _,elem in elems do
{self.}AppendChild(new DUnitDecorator(elem));
elems := object_.SSups();
for _,elem in elems do
{self.}AppendChild(new SSupUnitDecorator(elem));
elems := object_.SSubs();
for _,elem in elems do
{self.}AppendChild(new SSubUnitDecorator(elem));
elems := object_.Funcs();
for _,elem in elems do
{self.}AppendChild(new FuncUnitDecorator(elem));
if not ifnil(object_.XmlChildF) then
{self.}XmlChildF := new FUnitDecorator(object_.XmlChildF);
if not ifnil(object_.XmlChildCtrlPr) then
{self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr);
tslassigning := tslassigning_backup;
end;
function SSupUnitDecorator.Create(_obj: SSup); function SSupUnitDecorator.Create(_obj: SSup);
begin begin
class(SSup).Create(); class(SSup).Create();
@ -721,30 +689,6 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function SupUnitDecorator.Create(_obj: Sup);
begin
class(Sup).Create();
object_ := _obj;
{self.}Convert();
end;
function SupUnitDecorator.GetObject();
begin
return object_;
end;
function SupUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
elems := object_.Rs();
for _,elem in elems do
{self.}AppendChild(new RUnitDecorator(elem));
if not ifnil(object_.XmlChildCtrlPr) then
{self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr);
tslassigning := tslassigning_backup;
end;
function FUnitDecorator.Create(_obj: F); function FUnitDecorator.Create(_obj: F);
begin begin
class(F).Create(); class(F).Create();
@ -793,32 +737,6 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function NumUnitDecorator.Create(_obj: Num);
begin
class(Num).Create();
object_ := _obj;
{self.}Convert();
end;
function NumUnitDecorator.GetObject();
begin
return object_;
end;
function NumUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
elems := object_.Rs();
for _,elem in elems do
{self.}AppendChild(new RUnitDecorator(elem));
if not ifnil(object_.XmlChildRad) then
{self.}XmlChildRad := new RadUnitDecorator(object_.XmlChildRad);
if not ifnil(object_.XmlChildCtrlPr) then
{self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr);
tslassigning := tslassigning_backup;
end;
function RadUnitDecorator.Create(_obj: Rad); function RadUnitDecorator.Create(_obj: Rad);
begin begin
class(Rad).Create(); class(Rad).Create();
@ -867,49 +785,6 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function DegUnitDecorator.Create(_obj: Deg);
begin
class(Deg).Create();
object_ := _obj;
{self.}Convert();
end;
function DegUnitDecorator.GetObject();
begin
return object_;
end;
function DegUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
if not ifnil(object_.XmlChildCtrlPr) then
{self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr);
tslassigning := tslassigning_backup;
end;
function DenUnitDecorator.Create(_obj: Den);
begin
class(Den).Create();
object_ := _obj;
{self.}Convert();
end;
function DenUnitDecorator.GetObject();
begin
return object_;
end;
function DenUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
elems := object_.Rs();
for _,elem in elems do
{self.}AppendChild(new RUnitDecorator(elem));
tslassigning := tslassigning_backup;
end;
function SSubUnitDecorator.Create(_obj: SSub); function SSubUnitDecorator.Create(_obj: SSub);
begin begin
class(SSub).Create(); class(SSub).Create();
@ -956,30 +831,6 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function SubUnitDecorator.Create(_obj: Sub);
begin
class(Sub).Create();
object_ := _obj;
{self.}Convert();
end;
function SubUnitDecorator.GetObject();
begin
return object_;
end;
function SubUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
elems := object_.Rs();
for _,elem in elems do
{self.}AppendChild(new RUnitDecorator(elem));
if not ifnil(object_.XmlChildCtrlPr) then
{self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr);
tslassigning := tslassigning_backup;
end;
function NaryUnitDecorator.Create(_obj: Nary); function NaryUnitDecorator.Create(_obj: Nary);
begin begin
class(Nary).Create(); class(Nary).Create();
@ -1297,4 +1148,274 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function NumUnitDecorator.Create(_obj: Num);
begin
class(Num).Create();
object_ := _obj;
{self.}Convert();
end;
function NumUnitDecorator.GetObject();
begin
return object_;
end;
function NumUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
if not ifnil(object_.XmlChildCtrlPr) then
{self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr);
elems := object_.Rs();
for _,elem in elems do
{self.}AppendChild(new RUnitDecorator(elem));
elems := object_.Ds();
for _,elem in elems do
{self.}AppendChild(new DUnitDecorator(elem));
elems := object_.Fs();
for _,elem in elems do
{self.}AppendChild(new FUnitDecorator(elem));
elems := object_.Rads();
for _,elem in elems do
{self.}AppendChild(new RadUnitDecorator(elem));
elems := object_.SSubs();
for _,elem in elems do
{self.}AppendChild(new SSubUnitDecorator(elem));
elems := object_.SSups();
for _,elem in elems do
{self.}AppendChild(new SSupUnitDecorator(elem));
elems := object_.Naries();
for _,elem in elems do
{self.}AppendChild(new NaryUnitDecorator(elem));
elems := object_.Funcs();
for _,elem in elems do
{self.}AppendChild(new FuncUnitDecorator(elem));
tslassigning := tslassigning_backup;
end;
function DegUnitDecorator.Create(_obj: Deg);
begin
class(Deg).Create();
object_ := _obj;
{self.}Convert();
end;
function DegUnitDecorator.GetObject();
begin
return object_;
end;
function DegUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
if not ifnil(object_.XmlChildCtrlPr) then
{self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr);
elems := object_.Rs();
for _,elem in elems do
{self.}AppendChild(new RUnitDecorator(elem));
elems := object_.Ds();
for _,elem in elems do
{self.}AppendChild(new DUnitDecorator(elem));
elems := object_.Fs();
for _,elem in elems do
{self.}AppendChild(new FUnitDecorator(elem));
elems := object_.Rads();
for _,elem in elems do
{self.}AppendChild(new RadUnitDecorator(elem));
elems := object_.SSubs();
for _,elem in elems do
{self.}AppendChild(new SSubUnitDecorator(elem));
elems := object_.SSups();
for _,elem in elems do
{self.}AppendChild(new SSupUnitDecorator(elem));
elems := object_.Naries();
for _,elem in elems do
{self.}AppendChild(new NaryUnitDecorator(elem));
elems := object_.Funcs();
for _,elem in elems do
{self.}AppendChild(new FuncUnitDecorator(elem));
tslassigning := tslassigning_backup;
end;
function EUnitDecorator.Create(_obj: E);
begin
class(E).Create();
object_ := _obj;
{self.}Convert();
end;
function EUnitDecorator.GetObject();
begin
return object_;
end;
function EUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
if not ifnil(object_.XmlChildCtrlPr) then
{self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr);
elems := object_.Rs();
for _,elem in elems do
{self.}AppendChild(new RUnitDecorator(elem));
elems := object_.Ds();
for _,elem in elems do
{self.}AppendChild(new DUnitDecorator(elem));
elems := object_.Fs();
for _,elem in elems do
{self.}AppendChild(new FUnitDecorator(elem));
elems := object_.Rads();
for _,elem in elems do
{self.}AppendChild(new RadUnitDecorator(elem));
elems := object_.SSubs();
for _,elem in elems do
{self.}AppendChild(new SSubUnitDecorator(elem));
elems := object_.SSups();
for _,elem in elems do
{self.}AppendChild(new SSupUnitDecorator(elem));
elems := object_.Naries();
for _,elem in elems do
{self.}AppendChild(new NaryUnitDecorator(elem));
elems := object_.Funcs();
for _,elem in elems do
{self.}AppendChild(new FuncUnitDecorator(elem));
tslassigning := tslassigning_backup;
end;
function SupUnitDecorator.Create(_obj: Sup);
begin
class(Sup).Create();
object_ := _obj;
{self.}Convert();
end;
function SupUnitDecorator.GetObject();
begin
return object_;
end;
function SupUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
if not ifnil(object_.XmlChildCtrlPr) then
{self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr);
elems := object_.Rs();
for _,elem in elems do
{self.}AppendChild(new RUnitDecorator(elem));
elems := object_.Ds();
for _,elem in elems do
{self.}AppendChild(new DUnitDecorator(elem));
elems := object_.Fs();
for _,elem in elems do
{self.}AppendChild(new FUnitDecorator(elem));
elems := object_.Rads();
for _,elem in elems do
{self.}AppendChild(new RadUnitDecorator(elem));
elems := object_.SSubs();
for _,elem in elems do
{self.}AppendChild(new SSubUnitDecorator(elem));
elems := object_.SSups();
for _,elem in elems do
{self.}AppendChild(new SSupUnitDecorator(elem));
elems := object_.Naries();
for _,elem in elems do
{self.}AppendChild(new NaryUnitDecorator(elem));
elems := object_.Funcs();
for _,elem in elems do
{self.}AppendChild(new FuncUnitDecorator(elem));
tslassigning := tslassigning_backup;
end;
function DenUnitDecorator.Create(_obj: Den);
begin
class(Den).Create();
object_ := _obj;
{self.}Convert();
end;
function DenUnitDecorator.GetObject();
begin
return object_;
end;
function DenUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
if not ifnil(object_.XmlChildCtrlPr) then
{self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr);
elems := object_.Rs();
for _,elem in elems do
{self.}AppendChild(new RUnitDecorator(elem));
elems := object_.Ds();
for _,elem in elems do
{self.}AppendChild(new DUnitDecorator(elem));
elems := object_.Fs();
for _,elem in elems do
{self.}AppendChild(new FUnitDecorator(elem));
elems := object_.Rads();
for _,elem in elems do
{self.}AppendChild(new RadUnitDecorator(elem));
elems := object_.SSubs();
for _,elem in elems do
{self.}AppendChild(new SSubUnitDecorator(elem));
elems := object_.SSups();
for _,elem in elems do
{self.}AppendChild(new SSupUnitDecorator(elem));
elems := object_.Naries();
for _,elem in elems do
{self.}AppendChild(new NaryUnitDecorator(elem));
elems := object_.Funcs();
for _,elem in elems do
{self.}AppendChild(new FuncUnitDecorator(elem));
tslassigning := tslassigning_backup;
end;
function SubUnitDecorator.Create(_obj: Sub);
begin
class(Sub).Create();
object_ := _obj;
{self.}Convert();
end;
function SubUnitDecorator.GetObject();
begin
return object_;
end;
function SubUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
if not ifnil(object_.XmlChildCtrlPr) then
{self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr);
elems := object_.Rs();
for _,elem in elems do
{self.}AppendChild(new RUnitDecorator(elem));
elems := object_.Ds();
for _,elem in elems do
{self.}AppendChild(new DUnitDecorator(elem));
elems := object_.Fs();
for _,elem in elems do
{self.}AppendChild(new FUnitDecorator(elem));
elems := object_.Rads();
for _,elem in elems do
{self.}AppendChild(new RadUnitDecorator(elem));
elems := object_.SSubs();
for _,elem in elems do
{self.}AppendChild(new SSubUnitDecorator(elem));
elems := object_.SSups();
for _,elem in elems do
{self.}AppendChild(new SSupUnitDecorator(elem));
elems := object_.Naries();
for _,elem in elems do
{self.}AppendChild(new NaryUnitDecorator(elem));
elems := object_.Funcs();
for _,elem in elems do
{self.}AppendChild(new FuncUnitDecorator(elem));
tslassigning := tslassigning_backup;
end;
end. end.

View File

@ -1,6 +1,6 @@
unit VML; unit VML;
interface interface
uses DocxML; uses TSSafeUnitConverter, DocxML;
type Shapetype = class(OpenXmlCompositeElement) type Shapetype = class(OpenXmlCompositeElement)
public public
@ -9,6 +9,8 @@ public
function Create(_parent: tslobj; _prefix: string; _local_name: string);overload; function Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
function Init();override; function Init();override;
function Copy(_obj: Shapetype);override; function Copy(_obj: Shapetype);override;
function ConvertToPoint();override;
public public
// attributes property // attributes property
property AnchorId read ReadXmlAttrAnchorId write WriteXmlAttrAnchorId; property AnchorId read ReadXmlAttrAnchorId write WriteXmlAttrAnchorId;
@ -81,6 +83,8 @@ public
function Create(_parent: tslobj; _prefix: string; _local_name: string);overload; function Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
function Init();override; function Init();override;
function Copy(_obj: Formulas);override; function Copy(_obj: Formulas);override;
function ConvertToPoint();override;
public public
// multi property // multi property
@ -100,6 +104,8 @@ public
function Create(_parent: tslobj; _prefix: string; _local_name: string);overload; function Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
function Init();override; function Init();override;
function Copy(_obj: Lock);override; function Copy(_obj: Lock);override;
function ConvertToPoint();override;
public public
// attributes property // attributes property
property Ext read ReadXmlAttrExt write WriteXmlAttrExt; property Ext read ReadXmlAttrExt write WriteXmlAttrExt;
@ -123,6 +129,8 @@ public
function Create(_parent: tslobj; _prefix: string; _local_name: string);overload; function Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
function Init();override; function Init();override;
function Copy(_obj: F);override; function Copy(_obj: F);override;
function ConvertToPoint();override;
public public
// attributes property // attributes property
property Eqn read ReadXmlAttrEqn write WriteXmlAttrEqn; property Eqn read ReadXmlAttrEqn write WriteXmlAttrEqn;
@ -142,6 +150,8 @@ public
function Create(_parent: tslobj; _prefix: string; _local_name: string);overload; function Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
function Init();override; function Init();override;
function Copy(_obj: Stroke);override; function Copy(_obj: Stroke);override;
function ConvertToPoint();override;
public public
// attributes property // attributes property
property Joinstyle read ReadXmlAttrJoinstyle write WriteXmlAttrJoinstyle; property Joinstyle read ReadXmlAttrJoinstyle write WriteXmlAttrJoinstyle;
@ -161,6 +171,8 @@ public
function Create(_parent: tslobj; _prefix: string; _local_name: string);overload; function Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
function Init();override; function Init();override;
function Copy(_obj: Path);override; function Copy(_obj: Path);override;
function ConvertToPoint();override;
public public
// attributes property // attributes property
property Extrusionok read ReadXmlAttrExtrusionok write WriteXmlAttrExtrusionok; property Extrusionok read ReadXmlAttrExtrusionok write WriteXmlAttrExtrusionok;
@ -200,6 +212,8 @@ public
function Create(_parent: tslobj; _prefix: string; _local_name: string);overload; function Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
function Init();override; function Init();override;
function Copy(_obj: Textpath);override; function Copy(_obj: Textpath);override;
function ConvertToPoint();override;
public public
// attributes property // attributes property
property _On read ReadXmlAttr_On write WriteXmlAttr_On; property _On read ReadXmlAttr_On write WriteXmlAttr_On;
@ -231,6 +245,8 @@ public
function Create(_parent: tslobj; _prefix: string; _local_name: string);overload; function Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
function Init();override; function Init();override;
function Copy(_obj: Handles);override; function Copy(_obj: Handles);override;
function ConvertToPoint();override;
public public
// normal property // normal property
@ -249,6 +265,8 @@ public
function Create(_parent: tslobj; _prefix: string; _local_name: string);overload; function Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
function Init();override; function Init();override;
function Copy(_obj: H);override; function Copy(_obj: H);override;
function ConvertToPoint();override;
public public
// attributes property // attributes property
property Xrange read ReadXmlAttrXrange write WriteXmlAttrXrange; property Xrange read ReadXmlAttrXrange write WriteXmlAttrXrange;
@ -272,6 +290,8 @@ public
function Create(_parent: tslobj; _prefix: string; _local_name: string);overload; function Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
function Init();override; function Init();override;
function Copy(_obj: Shape);override; function Copy(_obj: Shape);override;
function ConvertToPoint();override;
public public
// attributes property // attributes property
property Id read ReadXmlAttrId write WriteXmlAttrId; property Id read ReadXmlAttrId write WriteXmlAttrId;
@ -345,6 +365,8 @@ public
function Create(_parent: tslobj; _prefix: string; _local_name: string);overload; function Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
function Init();override; function Init();override;
function Copy(_obj: Wrap);override; function Copy(_obj: Wrap);override;
function ConvertToPoint();override;
public public
// attributes property // attributes property
property Anchorx read ReadXmlAttrAnchorx write WriteXmlAttrAnchorx; property Anchorx read ReadXmlAttrAnchorx write WriteXmlAttrAnchorx;
@ -368,6 +390,8 @@ public
function Create(_parent: tslobj; _prefix: string; _local_name: string);overload; function Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
function Init();override; function Init();override;
function Copy(_obj: Fill);override; function Copy(_obj: Fill);override;
function ConvertToPoint();override;
public public
// attributes property // attributes property
property Opacity read ReadXmlAttrOpacity write WriteXmlAttrOpacity; property Opacity read ReadXmlAttrOpacity write WriteXmlAttrOpacity;
@ -387,6 +411,8 @@ public
function Create(_parent: tslobj; _prefix: string; _local_name: string);overload; function Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
function Init();override; function Init();override;
function Copy(_obj: Imagedata);override; function Copy(_obj: Imagedata);override;
function ConvertToPoint();override;
public public
// attributes property // attributes property
property Id read ReadXmlAttrId write WriteXmlAttrId; property Id read ReadXmlAttrId write WriteXmlAttrId;
@ -410,6 +436,8 @@ public
function Create(_parent: tslobj; _prefix: string; _local_name: string);overload; function Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
function Init();override; function Init();override;
function Copy(_obj: Textbox);override; function Copy(_obj: Textbox);override;
function ConvertToPoint();override;
public public
// normal property // normal property
@ -428,6 +456,8 @@ public
function Create(_parent: tslobj; _prefix: string; _local_name: string);overload; function Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
function Init();override; function Init();override;
function Copy(_obj: OLEObject);override; function Copy(_obj: OLEObject);override;
function ConvertToPoint();override;
public public
// attributes property // attributes property
property Type read ReadXmlAttrType write WriteXmlAttrType; property Type read ReadXmlAttrType write WriteXmlAttrType;
@ -542,6 +572,22 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function Shapetype.ConvertToPoint();override;
begin
if not ifnil({self.}XmlChildStroke) then
{self.}XmlChildStroke.ConvertToPoint();
if not ifnil({self.}XmlChildFormulas) then
{self.}XmlChildFormulas.ConvertToPoint();
if not ifnil({self.}XmlChildPath) then
{self.}XmlChildPath.ConvertToPoint();
if not ifnil({self.}XmlChildTextpath) then
{self.}XmlChildTextpath.ConvertToPoint();
if not ifnil({self.}XmlChildHandles) then
{self.}XmlChildHandles.ConvertToPoint();
if not ifnil({self.}XmlChildLock) then
{self.}XmlChildLock.ConvertToPoint();
end;
function Shapetype.ReadXmlAttrAnchorId(); function Shapetype.ReadXmlAttrAnchorId();
begin begin
return {self.}XmlAttrAnchorId.Value; return {self.}XmlAttrAnchorId.Value;
@ -773,6 +819,13 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function Formulas.ConvertToPoint();override;
begin
elems := {self.}Fs();
for _,elem in elems do
elem.ConvertToPoint();
end;
function Formulas.ReadFs(_index); function Formulas.ReadFs(_index);
begin begin
ind := ifnil(_index) ? -2 : _index; ind := ifnil(_index) ? -2 : _index;
@ -835,6 +888,11 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function Lock.ConvertToPoint();override;
begin
end;
function Lock.ReadXmlAttrExt(); function Lock.ReadXmlAttrExt();
begin begin
return {self.}XmlAttrExt.Value; return {self.}XmlAttrExt.Value;
@ -903,6 +961,11 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function F.ConvertToPoint();override;
begin
end;
function F.ReadXmlAttrEqn(); function F.ReadXmlAttrEqn();
begin begin
return {self.}XmlAttrEqn.Value; return {self.}XmlAttrEqn.Value;
@ -956,6 +1019,11 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function Stroke.ConvertToPoint();override;
begin
end;
function Stroke.ReadXmlAttrJoinstyle(); function Stroke.ReadXmlAttrJoinstyle();
begin begin
return {self.}XmlAttrJoinstyle.Value; return {self.}XmlAttrJoinstyle.Value;
@ -1024,6 +1092,11 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function Path.ConvertToPoint();override;
begin
end;
function Path.ReadXmlAttrExtrusionok(); function Path.ReadXmlAttrExtrusionok();
begin begin
return {self.}XmlAttrExtrusionok.Value; return {self.}XmlAttrExtrusionok.Value;
@ -1161,6 +1234,11 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function Textpath.ConvertToPoint();override;
begin
end;
function Textpath.ReadXmlAttr_On(); function Textpath.ReadXmlAttr_On();
begin begin
return {self.}XmlAttr_On.Value; return {self.}XmlAttr_On.Value;
@ -1259,6 +1337,12 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function Handles.ConvertToPoint();override;
begin
if not ifnil({self.}XmlChildH) then
{self.}XmlChildH.ConvertToPoint();
end;
function Handles.ReadXmlChildH(): H; function Handles.ReadXmlChildH(): H;
begin begin
if tslassigning and (ifnil({self.}XmlChildH) or {self.}XmlChildH.Removed) then if tslassigning and (ifnil({self.}XmlChildH) or {self.}XmlChildH.Removed) then
@ -1310,6 +1394,11 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function H.ConvertToPoint();override;
begin
end;
function H.ReadXmlAttrXrange(); function H.ReadXmlAttrXrange();
begin begin
return {self.}XmlAttrXrange.Value; return {self.}XmlAttrXrange.Value;
@ -1420,6 +1509,20 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function Shape.ConvertToPoint();override;
begin
if not ifnil({self.}XmlChildFill) then
{self.}XmlChildFill.ConvertToPoint();
if not ifnil({self.}XmlChildTextbox) then
{self.}XmlChildTextbox.ConvertToPoint();
if not ifnil({self.}XmlChildTextpath) then
{self.}XmlChildTextpath.ConvertToPoint();
if not ifnil({self.}XmlChildImagedata) then
{self.}XmlChildImagedata.ConvertToPoint();
if not ifnil({self.}XmlChildWrap) then
{self.}XmlChildWrap.ConvertToPoint();
end;
function Shape.ReadXmlAttrId(); function Shape.ReadXmlAttrId();
begin begin
return {self.}XmlAttrId.Value; return {self.}XmlAttrId.Value;
@ -1661,6 +1764,11 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function Wrap.ConvertToPoint();override;
begin
end;
function Wrap.ReadXmlAttrAnchorx(); function Wrap.ReadXmlAttrAnchorx();
begin begin
return {self.}XmlAttrAnchorx.Value; return {self.}XmlAttrAnchorx.Value;
@ -1729,6 +1837,11 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function Fill.ConvertToPoint();override;
begin
end;
function Fill.ReadXmlAttrOpacity(); function Fill.ReadXmlAttrOpacity();
begin begin
return {self.}XmlAttrOpacity.Value; return {self.}XmlAttrOpacity.Value;
@ -1785,6 +1898,11 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function Imagedata.ConvertToPoint();override;
begin
end;
function Imagedata.ReadXmlAttrId(); function Imagedata.ReadXmlAttrId();
begin begin
return {self.}XmlAttrId.Value; return {self.}XmlAttrId.Value;
@ -1853,6 +1971,12 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function Textbox.ConvertToPoint();override;
begin
if not ifnil({self.}XmlChildTxbxContent) then
{self.}XmlChildTxbxContent.ConvertToPoint();
end;
function Textbox.ReadXmlChildTxbxContent(): TxbxContent; function Textbox.ReadXmlChildTxbxContent(): TxbxContent;
begin begin
if tslassigning and (ifnil({self.}XmlChildTxbxContent) or {self.}XmlChildTxbxContent.Removed) then if tslassigning and (ifnil({self.}XmlChildTxbxContent) or {self.}XmlChildTxbxContent.Removed) then
@ -1916,6 +2040,11 @@ begin
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
end; end;
function OLEObject.ConvertToPoint();override;
begin
end;
function OLEObject.ReadXmlAttrType(); function OLEObject.ReadXmlAttrType();
begin begin
return {self.}XmlAttrType.Value; return {self.}XmlAttrType.Value;

6
cp.ps1
View File

@ -2,14 +2,16 @@ $sourcedir = "D:\code\tinysoft\OfficeXml-dev"
$destdir = "D:\code\tinysoft\OfficeXml" $destdir = "D:\code\tinysoft\OfficeXml"
# 复制tsf脚本 # 复制tsf脚本
Remove-Item -Path ($destdir + "\autoclass\") -Recurse -Force Remove-Item -Path ($destdir + "\autounit\") -Recurse -Force
Remove-Item -Path ($destdir + "\openxml\") -Recurse -Force Remove-Item -Path ($destdir + "\openxml\") -Recurse -Force
Remove-Item -Path ($destdir + "\utils\") -Recurse -Force Remove-Item -Path ($destdir + "\utils\") -Recurse -Force
Remove-Item -Path ($destdir + "\docx\") -Recurse -Force Remove-Item -Path ($destdir + "\docx\") -Recurse -Force
Remove-Item -Path ($destdir + "\pptx\") -Recurse -Force Remove-Item -Path ($destdir + "\pptx\") -Recurse -Force
Copy-Item -Path ($sourcedir + "\funcext\OfficeXml\autoclass\") ($destdir + "\autoclass\") -Recurse -Force Copy-Item -Path ($sourcedir + "\funcext\OfficeXml\autounit\") ($destdir + "\autounit\") -Recurse -Force
Copy-Item -Path ($sourcedir + "\funcext\OfficeXml\utils\") ($destdir + "\utils\") -Recurse -Force Copy-Item -Path ($sourcedir + "\funcext\OfficeXml\utils\") ($destdir + "\utils\") -Recurse -Force
Copy-Item -Path ($sourcedir + "\funcext\OfficeXml\openxml\") ($destdir + "\openxml\") -Recurse -Force Copy-Item -Path ($sourcedir + "\funcext\OfficeXml\openxml\") ($destdir + "\openxml\") -Recurse -Force
Copy-Item -Path ($sourcedir + "\funcext\OfficeXml\docx\") ($destdir + "\docx\") -Recurse -Force Copy-Item -Path ($sourcedir + "\funcext\OfficeXml\docx\") ($destdir + "\docx\") -Recurse -Force
Copy-Item -Path ($sourcedir + "\funcext\OfficeXml\pptx\") ($destdir + "\pptx\") -Recurse -Force Copy-Item -Path ($sourcedir + "\funcext\OfficeXml\pptx\") ($destdir + "\pptx\") -Recurse -Force
Copy-Item -Path ($sourcedir + "\README.md") ($destdir + "\") -Force
Copy-Item -Path ($sourcedir + "\迁移指南.md") ($destdir + "\") -Force

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -9,11 +9,9 @@ public
function AppendChild(_element: OpenXmlElement); function AppendChild(_element: OpenXmlElement);
function InsertAfter(_element: OpenXmlElement; _pos_element: OpenXmlElement); function InsertAfter(_element: OpenXmlElement; _pos_element: OpenXmlElement);
function RemoveChild(_element: OpenXmlElement); function RemoveChild(_element: OpenXmlElement);
function RemoveAttribute(_attr: OpenXmlAttribute);
// function InsertBefore(_pos_obj: tslobj; _obj: tslobj); // function InsertBefore(_pos_obj: tslobj; _obj: tslobj);
// function PrependChild(_obj: tslobj); // function PrependChild(_obj: tslobj);
// function SetAttribute(_obj: OpenXmlAttribute); // function SetAttribute(_obj: OpenXmlAttribute);
// function RemoveAttribute();
public public
function GetOrCreateNode(_obj: tslobj); function GetOrCreateNode(_obj: tslobj);
@ -65,15 +63,16 @@ end;
function OpenXmlCompositeElement.Serialize();override; function OpenXmlCompositeElement.Serialize();override;
begin begin
if {self.}DeleteSelf() then return; if {self.}DeleteSelf() then return;
{self.}GetNode();
// xmlns // xmlns
for k, v in xmlns_ do for k, v in xmlns_ do
{self.}GetNode().SetAttribute(v.ElementName, v.Value); {self.}XmlNode.SetAttribute(v.ElementName, v.Value);
// Attributes // Attributes
for k, v in attributes_ do for k, v in attributes_ do
if not ifnil(v.Value) then if not ifnil(v.Value) then
{self.}GetNode().SetAttribute(v.ElementName, v.Value); {self.}XmlNode.SetAttribute(v.ElementName, v.Value);
else if {self.}XmlNode then else if {self.}XmlNode then
{self.}XmlNode.DeleteAttribute(v.ElementName); {self.}XmlNode.DeleteAttribute(v.ElementName);
@ -152,8 +151,3 @@ begin
_element.Removed := true; _element.Removed := true;
end; end;
function OpenXmlCompositeElement.RemoveAttribute(_attr: OpenXmlAttribute);
begin
_attr.Value := nil;
end;

View File

@ -9,11 +9,16 @@ public
function Serialize();virtual; function Serialize();virtual;
function Marshal(): tableArray;virtual; function Marshal(): tableArray;virtual;
function SetFallback(_fallback: OpenXmlElement);
function RemoveAttribute(_attr: OpenXmlAttribute);
function Attribute(_attr: string; _ns: string): OpenXmlAttribute; function Attribute(_attr: string; _ns: string): OpenXmlAttribute;
function Attributes(): array of OpenXmlAttribute; function Attributes(): array of OpenXmlAttribute;
function Elements(): array of tslobj; function Elements(): array of tslobj;
function Xmlns(_prefix: string): string; function Xmlns(_prefix: string): string;
// 单位转换
function ConvertToPoint();virtual;
protected protected
function GetNode(): XmlNode; function GetNode(): XmlNode;
function DeleteSelf(): boolean; function DeleteSelf(): boolean;
@ -32,6 +37,7 @@ protected
xmlns_: tableArray; xmlns_: tableArray;
sorted_child_: tableArray; sorted_child_: tableArray;
container_: TSOfficeContainer; container_: TSOfficeContainer;
fallback_: OpenXmlElement; // 代理对象
end; end;
function OpenXmlElement.Create(_node: XmlNode);overload; function OpenXmlElement.Create(_node: XmlNode);overload;
@ -53,12 +59,18 @@ begin
{self.}Removed := false; {self.}Removed := false;
{self.}Init(); {self.}Init();
xmlns_ := array(); xmlns_ := array();
fallback_ := nil;
end;
function OpenXmlElement.SetFallback(_fallback: OpenXmlElement);
begin
fallback_ := _fallback;
end; end;
function OpenXmlElement.Attribute(_attr: string; _ns: string): OpenXmlAttribute; function OpenXmlElement.Attribute(_attr: string; _ns: string): OpenXmlAttribute;
begin begin
if ifnil(_ns) then if ifnil(_ns) then
attr_name := ifString({self.}Prefix) and {self.}Prefix <> "" ? format("%s:%%s", {self.}Prefix, _attr) : _attr; attr_name := ifString({self.}Prefix) and {self.}Prefix <> "" ? format("%s:%s", {self.}Prefix, _attr) : _attr;
else else
attr_name := format("%s:%s", _ns, _attr); attr_name := format("%s:%s", _ns, _attr);
return attributes_[attr_name]; return attributes_[attr_name];
@ -67,8 +79,9 @@ end;
function OpenXmlElement.Attributes(): array of OpenXmlAttribute; function OpenXmlElement.Attributes(): array of OpenXmlAttribute;
begin begin
attrs := array(); attrs := array();
for k, v in attributes_ do for k,v in attributes_ do
attrs[length(attrs)] := v; if not ifnil(v.Value) then
attrs[length(attrs)] := v;
return attrs; return attrs;
end; end;
@ -105,3 +118,7 @@ begin
return false; return false;
end; end;
function OpenXmlElement.RemoveAttribute(_attr: OpenXmlAttribute);
begin
_attr.Value := nil;
end;

View File

@ -73,13 +73,16 @@ function OpenXmlSimpleType.Serialize();override;
begin begin
if not ifObj({self.}XmlNode) then if not ifObj({self.}XmlNode) then
begin begin
if not ifnil({self.}XmlAttrVal.Value) then {self.}GetNode().SetAttribute({self.}XmlAttrVal.ElementName, {self.}XmlAttrVal.Value); {self.}GetNode();
if not ifnil({self.}XmlAttrVal.Value) then {self.}XmlNode.SetAttribute({self.}XmlAttrVal.ElementName, {self.}XmlAttrVal.Value);
end end
else begin else begin
if not {self.}Enable or {self.}Removed then if not {self.}Enable or {self.}Removed then
{self.}Parent.XmlNode.DeleteChild({self.}XmlNode); {self.}Parent.XmlNode.DeleteChild({self.}XmlNode);
else if not ifnil({self.}XmlAttrVal.Value) then else if not ifnil({self.}XmlAttrVal.Value) then
{self.}XmlNode.SetAttribute({self.}XmlAttrVal.ElementName, {self.}XmlAttrVal.Value); {self.}XmlNode.SetAttribute({self.}XmlAttrVal.ElementName, {self.}XmlAttrVal.Value);
else if ifnil({self.}XmlAttrVal.Value) then
{self.}XmlNode.DeleteAttribute({self.}XmlAttrVal.ElementName);
end end
end; end;

View File

@ -62,7 +62,7 @@ end;
function PptxComponents.Create(); function PptxComponents.Create();
begin begin
Class(TSComponentsBase).Create(); inherited;
end; end;
function PptxComponents.Init();override; function PptxComponents.Init();override;

View File

@ -3,12 +3,14 @@ public
function Create(); function Create();
function Init();virtual; function Init();virtual;
function InitZip(zip: ZipFile); function InitZip(zip: ZipFile);
function NewFile(): tableArray;
function Open(alias: string; file: string; password: string): tableArray; function Open(alias: string; file: string; password: string): tableArray;
function Save(): array of info; // array(err, errmsg) function Save(): array of info; // array(err, errmsg)
function SaveAs(alias: string; file: string): array of info; function SaveAs(alias: string; file: string): array of info;
function Zip(): ZipFile; function Zip(): ZipFile;
protected protected
function DefaultBinaryData(): binary;virtual;
function GetProp(_variable: tslobj; _name: string): tslobj; function GetProp(_variable: tslobj; _name: string): tslobj;
function GetPropArr(_variable: tslobj; _name: string; _index: integer): tslobj; function GetPropArr(_variable: tslobj; _name: string; _index: integer): tslobj;
function NewObject(_name: string): tslobj;virtual; function NewObject(_name: string): tslobj;virtual;
@ -16,22 +18,26 @@ protected
protected protected
zipfile_: ZipFile; zipfile_: ZipFile;
conf_: tableArray; conf_: tableArray;
end; end;
function TSComponentsBase.Create(); function TSComponentsBase.Create();
begin begin
{self.}Init();
end; end;
function TSComponentsBase.InitZip(zip: ZipFile); function TSComponentsBase.InitZip(zip: ZipFile);
begin begin
{self.}Init();
zipfile_ := zip; zipfile_ := zip;
end; end;
function TSComponentsBase.NewFile(): tableArray;
begin
zipfile_ := new ZipFile();
return zipfile_.LoadFromMem({self.}DefaultBinaryData());
end;
function TSComponentsBase.Open(alias: string; file: string; password: string): tableArray; function TSComponentsBase.Open(alias: string; file: string; password: string): tableArray;
begin begin
{self.}Init();
zipfile_ := new ZipFile(); zipfile_ := new ZipFile();
return zipfile_.Open(alias, file, password); return zipfile_.Open(alias, file, password);
end; end;

View File

@ -1,7 +1,8 @@
type TSOfficeContainer = class type TSOfficeContainer = class
public public
function Create(arr: array of string); function Create(arr: array of string);
function Set(data: any): boolean; // 设置data数据 function Set(data: any): boolean;overload; // 设置data数据
function Set(name: string; index: integer; data: any): boolean;overload;
function Add(data: any): boolean; function Add(data: any): boolean;
function Append(data: any): boolean; function Append(data: any): boolean;
function Insert(data: any): boolean; function Insert(data: any): boolean;
@ -16,7 +17,8 @@ private
bucket_: array of LinkList; bucket_: array of LinkList;
child_: array of string; child_: array of string;
current_index_: integer; current_index_: integer;
last_index_: integer; min_index_; integer;
max_index_: integer;
end; end;
type LinkList = class type LinkList = class
@ -47,22 +49,88 @@ function TSOfficeContainer.Create(arr: array of string);
begin begin
bucket_ := array(); bucket_ := array();
child_ := array(); child_ := array();
min_index_ := 0;
max_index_ := 0;
for str,v in arr do for str,v in arr do
begin begin
child_[str] := v[0]; child_[str] := v[0];
last_index_ := v[0]; if v[0] > max_index_ then max_index_ := v[0];
if v[0] < min_index_ then min_index_ := v[0];
end end
current_index_ := -1; current_index_ := -INF;
end; end;
function TSOfficeContainer.Set(data: any): boolean; function TSOfficeContainer.Set(data: any): boolean;overload;
begin begin
obj := {self.}GetBucketObj(data.ElementName); obj := {self.}GetBucketObj(data.ElementName);
if ifnil(obj) then return false; if ifnil(obj) then return false;
obj.Add(data); obj.Set(data);
return true; return true;
end; end;
function TSOfficeContainer.Set(name: string; index: integer; data: any): boolean;overload;
begin
ind := child_[name];
obj := bucket_[ind];
if ifObj(obj) and obj.Name() = name then
begin
node := obj.First();
while ifObj(node) do
begin
if node.data.Removed then
begin
node := node.next;
continue;
end
index--;
if index = -1 then
begin
new_node := new Node();
new_node.data := data;
new_node.next := node.next;
node.data.Removed := true;
node.next := new_node;
if tail_ = node then
tail_ := new_node;
return true;
end
node := node.next;
end
end
i := max_index_ + 1;
for i:=max_index_+1 to current_index_ do
begin
if i = ind then continue;
obj := bucket_[i];
if ifObj(obj) and obj.Name() = name then
begin
node := obj.First();
while ifObj(node) do
begin
if node.data.Remove then
begin
node := node.next;
continue;
end
index--;
if index = -1 then
begin
new_node := new Node();
new_node.data := data;
new_node.next := node.next;
node.data.Removed := true;
node.next := new_node;
if tail_ = node then
tail_ := new_node;
return true;
end
node := node.next;
end
end
end
return false;
end;
function TSOfficeContainer.Add(data: any): boolean; function TSOfficeContainer.Add(data: any): boolean;
begin begin
obj := {self.}GetBucketObj(data.ElementName); obj := {self.}GetBucketObj(data.ElementName);
@ -80,7 +148,7 @@ begin
if ifObj(obj) and obj.Name() = data.ElementName then obj.Add(data); if ifObj(obj) and obj.Name() = data.ElementName then obj.Add(data);
else begin else begin
obj := new LinkList(data.ElementName); obj := new LinkList(data.ElementName);
current_index_ := current_index_ > last_index_ ? current_index_ + 1 : last_index_ + 1; current_index_ := current_index_ > max_index_ ? current_index_ + 1 : max_index_ + 1;
bucket_[current_index_] := obj; bucket_[current_index_] := obj;
obj.Add(data); obj.Add(data);
end end
@ -102,7 +170,7 @@ end;
function TSOfficeContainer.Insert(data: any): boolean; function TSOfficeContainer.Insert(data: any): boolean;
begin begin
i := last_index_ + 1; i := max_index_ + 1;
while i <= current_index_ do while i <= current_index_ do
begin begin
obj := bucket_[i]; obj := bucket_[i];
@ -129,7 +197,7 @@ end;
function TSOfficeContainer.GetElements(include_removed: boolean = true): array of tslobj; function TSOfficeContainer.GetElements(include_removed: boolean = true): array of tslobj;
begin begin
arr := array(); arr := array();
for i:=0 to current_index_ do for i:=min_index_ to current_index_ do
begin begin
obj := bucket_[i]; obj := bucket_[i];
if ifObj(obj) then if ifObj(obj) then
@ -151,33 +219,43 @@ begin
ind := child_[name]; ind := child_[name];
arr := array(); arr := array();
obj := bucket_[ind]; obj := bucket_[ind];
if ifObj(obj) then if ifObj(obj) and obj.Name() = name then
begin begin
node := obj.First(); node := obj.First();
while ifObj(node) do while ifObj(node) do
begin begin
if node.data.Removed then
begin
node := node.next;
continue;
end
arr[length(arr)] := node.data; arr[length(arr)] := node.data;
index--; index--;
if index = -1 then return node.data; if index = -1 then return node.data;
node := node.next; node := node.next;
end end
end end
i := last_index_ + 1; i := max_index_ + 1;
while i <= current_index_ do for i:=max_index_+1 to current_index_ do
begin begin
if i = ind then continue;
obj := bucket_[i]; obj := bucket_[i];
if ifObj(obj) and obj.Name() = name then if ifObj(obj) and obj.Name() = name then
begin begin
node := obj.First(); node := obj.First();
while ifObj(node) do while ifObj(node) do
begin begin
if node.data.Removed then
begin
node := node.next;
continue;
end
arr[length(arr)] := node.data; arr[length(arr)] := node.data;
index--; index--;
if index = -1 then return node.data; if index = -1 then return node.data;
node := node.next; node := node.next;
end end
end end
i++;
end end
return arr; return arr;
end; end;
@ -208,8 +286,18 @@ function LinkList.Set(data: any)
begin begin
node := new Node(); node := new Node();
node.data := data; node.data := data;
head_.next := node; if tail_ <> head_ then
tail_ := node; begin
tail_.data.Removed := true;
tail_.next := node;
tail_ := node;
size_++;
end
else begin
head_.next := node;
tail_ := node;
size_ := 1;
end
end; end;
function LinkList.Add(data: any) function LinkList.Add(data: any)

View File

@ -1,16 +1,24 @@
unit TSSafeUnitConverter; unit TSSafeUnitConverter;
interface interface
function PointsToTwips(value): real;
function TwipsToPoints(value): real; function TwipsToPoints(value): real;
function EmusToPoints(value): real; function EmusToPoints(value): real;
function HalfPointToPoints(value): real; function HalfPointToPoints(value): real;
function PercentToNumber(value): real; function PercentToNumber(value): real;
function NumberToPercent(value): real;
function ToInt(value): integer; function ToInt(value): integer;
function EighthPointToPoints(value): real; function EighthPointToPoints(value): real;
implementation implementation
uses TSUnitConverter; uses TSUnitConverter;
function PointsToTwips(value): real;
begin
if ifNil(value) then return 0;
new_value := ifString(value) ? strToFloat(value) : value;
return TSUnitConverter.PointsToTwips(new_value);
end;
function TwipsToPoints(value): real; function TwipsToPoints(value): real;
begin begin
if ifNil(value) then return 0; if ifNil(value) then return 0;
@ -39,10 +47,17 @@ uses TSUnitConverter;
return TSUnitConverter.PercentToNumber(new_value); return TSUnitConverter.PercentToNumber(new_value);
end; end;
function NumberToPercent(value): real;
begin
if ifNil(value) then return 0;
new_value := ifString(value) ? strToFloat(value) : value;
return TSUnitConverter.NumberToPercent(new_value);
end;
function ToInt(value): integer; function ToInt(value): integer;
begin begin
if ifNil(value) then return 0; if ifNil(value) then return 0;
return tryStrtoInt(value, r) ? r : 0; return strtoIntDef(value, 0);
end; end;
function EighthPointToPoints(value): real; function EighthPointToPoints(value): real;

View File

@ -1,13 +1,20 @@
unit TSUnitConverter; unit TSUnitConverter;
interface interface
function PointsToTwips(value): real;
function TwipsToPoints(value: real): real; function TwipsToPoints(value: real): real;
function EmusToPoints(value: real): real; function EmusToPoints(value: real): real;
function HalfPointToPoints(value: real): real; function HalfPointToPoints(value: real): real;
function EighthPointToPoints(value: real): real; function EighthPointToPoints(value: real): real;
function PercentToNumber(value: real): real; function PercentToNumber(value: real): real;
function NumberToPercent(value: real): real;
implementation implementation
function PointsToTwips(value): real;
begin
return value * 20;
end;
function TwipsToPoints(value: real): real; function TwipsToPoints(value: real): real;
begin begin
return value / 20; return value / 20;
@ -28,6 +35,11 @@ implementation
return value / 100; return value / 100;
end; end;
function NumberToPercent(value: real): real;
begin
return value * 100;
end;
function EighthPointToPoints(value: real): real; function EighthPointToPoints(value: real): real;
begin begin
return value / 8; return value / 8;

View File

@ -1,6 +1,6 @@
type VBABase = class type VBABase = class
public public
function Create(Par: tslobj; App: Application; Cre: integer); function Create(_parent: tslobj; _application: Application; _creator: integer);
public public
property Application read ReadApplication; property Application read ReadApplication;
@ -9,19 +9,19 @@ public
function ReadApplication(); function ReadApplication();
function ReadParent(); function ReadParent();
function ReadCreator(); function ReadCreator();
private private
[weakref]parent_: tslobj; [weakref]parent_: tslobj;
[weakref]application_: Application; [weakref]application_: Application;
creator_: integer; creator_: integer;
end;
End;
// ============== 实现 ================= // // ============== 实现 ================= //
function VBABase.Create(Par: tslobj; App: Application; Cre: integer); function VBABase.Create(_parent: tslobj; _application: Application; _creator: integer);
begin begin
parent_ := Par; parent_ := _parent;
application_ := App; application_ := _application;
creator_ := Cre; creator_ := _creator;
end; end;
// properties // properties