From 958b62f72c3a8981b2ef4dda8cdb467a2f971d27 Mon Sep 17 00:00:00 2001 From: csh Date: Fri, 14 Feb 2025 15:26:26 +0800 Subject: [PATCH] Fixes and improvements --- autounit/DocxML.tsf | 204 +++++-- autounit/DocxMLUnitDecorator.tsf | 40 +- autounit/DrawingML.tsf | 75 ++- autounit/DrawingMLUnitDecorator.tsf | 6 + autounit/SharedML.tsf | 838 +++++++++++++++++++++++++--- autounit/SharedMLUnitDecorator.tsf | 257 +++++++-- docx/DocxComponents.tsf | 1 - openxml/OpenXmlAttribute.tsf | 2 - utils/vba/XlsxSheetData.tsf | 64 --- utils/vba/XlsxSheetDataRow.tsf | 63 --- 10 files changed, 1259 insertions(+), 291 deletions(-) delete mode 100644 utils/vba/XlsxSheetData.tsf delete mode 100644 utils/vba/XlsxSheetDataRow.tsf diff --git a/autounit/DocxML.tsf b/autounit/DocxML.tsf index 13e5220..7fb8e95 100644 --- a/autounit/DocxML.tsf +++ b/autounit/DocxML.tsf @@ -153,10 +153,12 @@ public // normal property property PPr read ReadXmlChildPPr; property OMathPara read ReadXmlChildOMathPara; + property OMath read ReadXmlChildOMath; property Ins read ReadXmlChildIns; property Del read ReadXmlChildDel; function ReadXmlChildPPr(): PPr; function ReadXmlChildOMathPara(): OMathPara; + function ReadXmlChildOMath(): OMath; function ReadXmlChildIns(): Ins; function ReadXmlChildDel(): Del; @@ -206,6 +208,7 @@ public // Children XmlChildPPr: PPr; XmlChildOMathPara: OMathPara; + XmlChildOMath: OMath; XmlChildIns: Ins; XmlChildDel: Del; end; @@ -219,7 +222,13 @@ public function Copy(_obj: FldSimple);override; public // attributes property + property Dirty read ReadXmlAttrDirty write WriteXmlAttrDirty; + property FldLock read ReadXmlAttrFldLock write WriteXmlAttrFldLock; property Instr read ReadXmlAttrInstr write WriteXmlAttrInstr; + function ReadXmlAttrDirty(); + function WriteXmlAttrDirty(_value); + function ReadXmlAttrFldLock(); + function WriteXmlAttrFldLock(_value); function ReadXmlAttrInstr(); function WriteXmlAttrInstr(_value); @@ -231,6 +240,8 @@ public public // Attributes + XmlAttrDirty: OpenXmlAttribute; + XmlAttrFldLock: OpenXmlAttribute; XmlAttrInstr: OpenXmlAttribute; // Children @@ -1153,15 +1164,17 @@ public function Copy(_obj: RFonts);override; public // attributes property + property Hint read ReadXmlAttrHint write WriteXmlAttrHint; property Ascii read ReadXmlAttrAscii write WriteXmlAttrAscii; property AsciiTheme read ReadXmlAttrAsciiTheme write WriteXmlAttrAsciiTheme; property EastAsia read ReadXmlAttrEastAsia write WriteXmlAttrEastAsia; property EastAsiaTheme read ReadXmlAttrEastAsiaTheme write WriteXmlAttrEastAsiaTheme; property HAnsi read ReadXmlAttrHAnsi write WriteXmlAttrHAnsi; property HAnsiTheme read ReadXmlAttrHAnsiTheme write WriteXmlAttrHAnsiTheme; - property Hint read ReadXmlAttrHint write WriteXmlAttrHint; property Cs read ReadXmlAttrCs write WriteXmlAttrCs; property CsTheme read ReadXmlAttrCsTheme write WriteXmlAttrCsTheme; + function ReadXmlAttrHint(); + function WriteXmlAttrHint(_value); function ReadXmlAttrAscii(); function WriteXmlAttrAscii(_value); function ReadXmlAttrAsciiTheme(); @@ -1174,8 +1187,6 @@ public function WriteXmlAttrHAnsi(_value); function ReadXmlAttrHAnsiTheme(); function WriteXmlAttrHAnsiTheme(_value); - function ReadXmlAttrHint(); - function WriteXmlAttrHint(_value); function ReadXmlAttrCs(); function WriteXmlAttrCs(_value); function ReadXmlAttrCsTheme(); @@ -1183,13 +1194,13 @@ public public // Attributes + XmlAttrHint: OpenXmlAttribute; XmlAttrAscii: OpenXmlAttribute; XmlAttrAsciiTheme: OpenXmlAttribute; XmlAttrEastAsia: OpenXmlAttribute; XmlAttrEastAsiaTheme: OpenXmlAttribute; XmlAttrHAnsi: OpenXmlAttribute; XmlAttrHAnsiTheme: OpenXmlAttribute; - XmlAttrHint: OpenXmlAttribute; XmlAttrCs: OpenXmlAttribute; XmlAttrCsTheme: OpenXmlAttribute; @@ -1233,6 +1244,25 @@ public end; +type PureVal = 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: PureVal);override; +public + // attributes property + property Val read ReadXmlAttrVal write WriteXmlAttrVal; + function ReadXmlAttrVal(); + function WriteXmlAttrVal(_value); + +public + // Attributes + XmlAttrVal: OpenXmlAttribute; + +end; + type PureWVal = class(OpenXmlElement) public function Create();overload; @@ -4536,16 +4566,17 @@ begin sorted_child_ := array( pre + "pPr": array(0, makeweakref(thisFunction(ReadXmlChildPPr))), "m:oMathPara": array(1, makeweakref(thisFunction(ReadXmlChildOMathPara))), - pre + "ins": array(2, makeweakref(thisFunction(ReadXmlChildIns))), - pre + "del": array(3, makeweakref(thisFunction(ReadXmlChildDel))), - pre + "sdt": array(4, makeweakref(thisFunction(AppendSdt))), - pre + "r": array(5, makeweakref(thisFunction(AppendR))), - pre + "commentRangeStart": array(6, makeweakref(thisFunction(AppendCommentRangeStart))), - pre + "commentRangeEnd": array(7, makeweakref(thisFunction(AppendCommentRangeEnd))), - pre + "bookmarkStart": array(8, makeweakref(thisFunction(AppendBookmarkStart))), - pre + "bookmarkEnd": array(9, makeweakref(thisFunction(AppendBookmarkEnd))), - pre + "hyperlink": array(10, makeweakref(thisFunction(AppendHyperLink))), - pre + "fldSimple": array(11, makeweakref(thisFunction(AppendFldSimple))), + "m:oMath": array(2, makeweakref(thisFunction(ReadXmlChildOMath))), + pre + "ins": array(3, makeweakref(thisFunction(ReadXmlChildIns))), + pre + "del": array(4, makeweakref(thisFunction(ReadXmlChildDel))), + pre + "sdt": array(5, makeweakref(thisFunction(AppendSdt))), + pre + "r": array(6, makeweakref(thisFunction(AppendR))), + pre + "commentRangeStart": array(7, makeweakref(thisFunction(AppendCommentRangeStart))), + pre + "commentRangeEnd": array(8, makeweakref(thisFunction(AppendCommentRangeEnd))), + pre + "bookmarkStart": array(9, makeweakref(thisFunction(AppendBookmarkStart))), + pre + "bookmarkEnd": array(10, makeweakref(thisFunction(AppendBookmarkEnd))), + pre + "hyperlink": array(11, makeweakref(thisFunction(AppendHyperLink))), + pre + "fldSimple": array(12, makeweakref(thisFunction(AppendFldSimple))), ); container_ := new TSOfficeContainer(sorted_child_); end; @@ -4571,6 +4602,8 @@ begin {self.}PPr.Copy(_obj.XmlChildPPr); if not ifnil(_obj.XmlChildOMathPara) then {self.}OMathPara.Copy(_obj.XmlChildOMathPara); + if not ifnil(_obj.XmlChildOMath) then + {self.}OMath.Copy(_obj.XmlChildOMath); if not ifnil(_obj.XmlChildIns) then {self.}Ins.Copy(_obj.XmlChildIns); if not ifnil(_obj.XmlChildDel) then @@ -4688,6 +4721,16 @@ begin return {self.}XmlChildOMathPara; end; +function P.ReadXmlChildOMath(): OMath; +begin + if tslassigning and ifnil({self.}XmlChildOMath) then + begin + {self.}XmlChildOMath := new SharedML.OMath(self, "m", "oMath"); + container_.Set({self.}XmlChildOMath); + end + return {self.}XmlChildOMath; +end; + function P.ReadXmlChildIns(): Ins; begin if tslassigning and ifnil({self.}XmlChildIns) then @@ -4897,6 +4940,8 @@ begin pre := {self.}Prefix ? {self.}Prefix + ":" : ""; attributes_ := array(); attributes_pf_ := array( + pre + "dirty": makeweakref(thisFunction(WriteXmlAttrDirty)), + pre + "fldLock": makeweakref(thisFunction(WriteXmlAttrFldLock)), pre + "instr": makeweakref(thisFunction(WriteXmlAttrInstr)), ); sorted_child_ := array( @@ -4910,11 +4955,45 @@ begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); + if not ifnil(_obj.Dirty) then + {self.}Dirty := _obj.Dirty; + if not ifnil(_obj.FldLock) then + {self.}FldLock := _obj.FldLock; if not ifnil(_obj.Instr) then {self.}Instr := _obj.Instr; tslassigning := tslassigning_backup; end; +function FldSimple.ReadXmlAttrDirty(); +begin + return {self.}XmlAttrDirty.Value; +end; + +function FldSimple.WriteXmlAttrDirty(_value); +begin + if ifnil({self.}XmlAttrDirty) then + begin + {self.}XmlAttrDirty := new OpenXmlAttribute({self.}Prefix, "dirty", nil); + attributes_[length(attributes_)] := {self.}XmlAttrDirty; + end + {self.}XmlAttrDirty.Value := _value; +end; + +function FldSimple.ReadXmlAttrFldLock(); +begin + return {self.}XmlAttrFldLock.Value; +end; + +function FldSimple.WriteXmlAttrFldLock(_value); +begin + if ifnil({self.}XmlAttrFldLock) then + begin + {self.}XmlAttrFldLock := new OpenXmlAttribute({self.}Prefix, "fldLock", nil); + attributes_[length(attributes_)] := {self.}XmlAttrFldLock; + end + {self.}XmlAttrFldLock.Value := _value; +end; + function FldSimple.ReadXmlAttrInstr(); begin return {self.}XmlAttrInstr.Value; @@ -7746,8 +7825,8 @@ begin attributes_ := array(); attributes_pf_ := array( pre + "val": makeweakref(thisFunction(WriteXmlAttrVal)), - pre + "Color": makeweakref(thisFunction(WriteXmlAttrColor)), - pre + "Fill": makeweakref(thisFunction(WriteXmlAttrFill)), + pre + "color": makeweakref(thisFunction(WriteXmlAttrColor)), + pre + "fill": makeweakref(thisFunction(WriteXmlAttrFill)), pre + "themeColor": makeweakref(thisFunction(WriteXmlAttrThemeColor)), pre + "themeFill": makeweakref(thisFunction(WriteXmlAttrThemeFill)), pre + "themeFillTint": makeweakref(thisFunction(WriteXmlAttrThemeFillTint)), @@ -7810,7 +7889,7 @@ function Shd.WriteXmlAttrColor(_value); begin if ifnil({self.}XmlAttrColor) then begin - {self.}XmlAttrColor := new OpenXmlAttribute({self.}Prefix, "Color", nil); + {self.}XmlAttrColor := new OpenXmlAttribute({self.}Prefix, "color", nil); attributes_[length(attributes_)] := {self.}XmlAttrColor; end {self.}XmlAttrColor.Value := _value; @@ -7825,7 +7904,7 @@ function Shd.WriteXmlAttrFill(_value); begin if ifnil({self.}XmlAttrFill) then begin - {self.}XmlAttrFill := new OpenXmlAttribute({self.}Prefix, "Fill", nil); + {self.}XmlAttrFill := new OpenXmlAttribute({self.}Prefix, "fill", nil); attributes_[length(attributes_)] := {self.}XmlAttrFill; end {self.}XmlAttrFill.Value := _value; @@ -8585,13 +8664,13 @@ begin pre := {self.}Prefix ? {self.}Prefix + ":" : ""; attributes_ := array(); attributes_pf_ := array( + pre + "hint": makeweakref(thisFunction(WriteXmlAttrHint)), pre + "ascii": makeweakref(thisFunction(WriteXmlAttrAscii)), pre + "asciiTheme": makeweakref(thisFunction(WriteXmlAttrAsciiTheme)), pre + "eastAsia": makeweakref(thisFunction(WriteXmlAttrEastAsia)), pre + "eastAsiaTheme": makeweakref(thisFunction(WriteXmlAttrEastAsiaTheme)), pre + "hAnsi": makeweakref(thisFunction(WriteXmlAttrHAnsi)), pre + "hAnsiTheme": makeweakref(thisFunction(WriteXmlAttrHAnsiTheme)), - pre + "hint": makeweakref(thisFunction(WriteXmlAttrHint)), pre + "cs": makeweakref(thisFunction(WriteXmlAttrCs)), pre + "cstheme": makeweakref(thisFunction(WriteXmlAttrCsTheme)), ); @@ -8605,6 +8684,8 @@ begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); + if not ifnil(_obj.Hint) then + {self.}Hint := _obj.Hint; if not ifnil(_obj.Ascii) then {self.}Ascii := _obj.Ascii; if not ifnil(_obj.AsciiTheme) then @@ -8617,8 +8698,6 @@ begin {self.}HAnsi := _obj.HAnsi; if not ifnil(_obj.HAnsiTheme) then {self.}HAnsiTheme := _obj.HAnsiTheme; - if not ifnil(_obj.Hint) then - {self.}Hint := _obj.Hint; if not ifnil(_obj.Cs) then {self.}Cs := _obj.Cs; if not ifnil(_obj.CsTheme) then @@ -8626,6 +8705,21 @@ begin tslassigning := tslassigning_backup; end; +function RFonts.ReadXmlAttrHint(); +begin + return {self.}XmlAttrHint.Value; +end; + +function RFonts.WriteXmlAttrHint(_value); +begin + if ifnil({self.}XmlAttrHint) then + begin + {self.}XmlAttrHint := new OpenXmlAttribute({self.}Prefix, "hint", nil); + attributes_[length(attributes_)] := {self.}XmlAttrHint; + end + {self.}XmlAttrHint.Value := _value; +end; + function RFonts.ReadXmlAttrAscii(); begin return {self.}XmlAttrAscii.Value; @@ -8716,21 +8810,6 @@ begin {self.}XmlAttrHAnsiTheme.Value := _value; end; -function RFonts.ReadXmlAttrHint(); -begin - return {self.}XmlAttrHint.Value; -end; - -function RFonts.WriteXmlAttrHint(_value); -begin - if ifnil({self.}XmlAttrHint) then - begin - {self.}XmlAttrHint := new OpenXmlAttribute({self.}Prefix, "hint", nil); - attributes_[length(attributes_)] := {self.}XmlAttrHint; - end - {self.}XmlAttrHint.Value := _value; -end; - function RFonts.ReadXmlAttrCs(); begin return {self.}XmlAttrCs.Value; @@ -8867,6 +8946,59 @@ begin {self.}XmlAttrVal.Value := _value; end; +function PureVal.Create();overload; +begin + {self.}Create(nil, "", ""); +end; + +function PureVal.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function PureVal.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 PureVal.Init();override; +begin + pre := {self.}Prefix ? {self.}Prefix + ":" : ""; + attributes_ := array(); + attributes_pf_ := array( + "val": makeweakref(thisFunction(WriteXmlAttrVal)), + ); + sorted_child_ := array( + ); + container_ := new TSOfficeContainer(sorted_child_); +end; + +function PureVal.Copy(_obj: PureVal);override; +begin + tslassigning_backup := tslassigning; + tslassigning := 1; + class(OpenXmlElement).Copy(_obj); + if not ifnil(_obj.Val) then + {self.}Val := _obj.Val; + tslassigning := tslassigning_backup; +end; + +function PureVal.ReadXmlAttrVal(); +begin + return {self.}XmlAttrVal.Value; +end; + +function PureVal.WriteXmlAttrVal(_value); +begin + if ifnil({self.}XmlAttrVal) then + begin + {self.}XmlAttrVal := new OpenXmlAttribute("", "val", nil); + attributes_[length(attributes_)] := {self.}XmlAttrVal; + end + {self.}XmlAttrVal.Value := _value; +end; + function PureWVal.Create();overload; begin {self.}Create(nil, "", ""); diff --git a/autounit/DocxMLUnitDecorator.tsf b/autounit/DocxMLUnitDecorator.tsf index b63f264..188db53 100644 --- a/autounit/DocxMLUnitDecorator.tsf +++ b/autounit/DocxMLUnitDecorator.tsf @@ -245,6 +245,15 @@ private object_: Sz; end; +type PureValUnitDecorator = class(PureVal) +public + function Create(_obj: PureVal); + function GetObject(); + function Convert(); +private + object_: PureVal; +end; + type PureWValUnitDecorator = class(PureWVal) public function Create(_obj: PureWVal); @@ -1177,6 +1186,8 @@ begin {self.}XmlChildPPr := new PPrUnitDecorator(object_.XmlChildPPr); if not ifnil(object_.XmlChildOMathPara) then {self.}XmlChildOMathPara := new OMathParaUnitDecorator(object_.XmlChildOMathPara); + if not ifnil(object_.XmlChildOMath) then + {self.}XmlChildOMath := new OMathUnitDecorator(object_.XmlChildOMath); if not ifnil(object_.XmlChildIns) then {self.}XmlChildIns := new InsUnitDecorator(object_.XmlChildIns); if not ifnil(object_.XmlChildDel) then @@ -1224,6 +1235,10 @@ function FldSimpleUnitDecorator.Convert(); begin tslassigning_backup := tslassigning; tslassigning := 1; + if not ifnil(object_.XmlAttrDirty) then + {self.}Dirty := object_.XmlAttrDirty.Value; + if not ifnil(object_.XmlAttrFldLock) then + {self.}FldLock := object_.XmlAttrFldLock.Value; if not ifnil(object_.XmlAttrInstr) then {self.}Instr := object_.XmlAttrInstr.Value; elems := object_.Rs(); @@ -1949,6 +1964,8 @@ function RFontsUnitDecorator.Convert(); begin tslassigning_backup := tslassigning; tslassigning := 1; + if not ifnil(object_.XmlAttrHint) then + {self.}Hint := object_.XmlAttrHint.Value; if not ifnil(object_.XmlAttrAscii) then {self.}Ascii := object_.XmlAttrAscii.Value; if not ifnil(object_.XmlAttrAsciiTheme) then @@ -1961,8 +1978,6 @@ begin {self.}HAnsi := object_.XmlAttrHAnsi.Value; if not ifnil(object_.XmlAttrHAnsiTheme) then {self.}HAnsiTheme := object_.XmlAttrHAnsiTheme.Value; - if not ifnil(object_.XmlAttrHint) then - {self.}Hint := object_.XmlAttrHint.Value; if not ifnil(object_.XmlAttrCs) then {self.}Cs := object_.XmlAttrCs.Value; if not ifnil(object_.XmlAttrCsTheme) then @@ -2012,6 +2027,27 @@ begin tslassigning := tslassigning_backup; end; +function PureValUnitDecorator.Create(_obj: PureVal); +begin + class(PureVal).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function PureValUnitDecorator.GetObject(); +begin + return object_; +end; + +function PureValUnitDecorator.Convert(); +begin + tslassigning_backup := tslassigning; + tslassigning := 1; + if not ifnil(object_.XmlAttrVal) then + {self.}Val := object_.XmlAttrVal.Value; + tslassigning := tslassigning_backup; +end; + function PureWValUnitDecorator.Create(_obj: PureWVal); begin class(PureWVal).Create(); diff --git a/autounit/DrawingML.tsf b/autounit/DrawingML.tsf index 5530f2d..45679b8 100644 --- a/autounit/DrawingML.tsf +++ b/autounit/DrawingML.tsf @@ -1,6 +1,6 @@ unit DrawingML; interface -uses DrawingML; +uses DocxML; type Theme = class(OpenXmlElement) public @@ -2397,6 +2397,16 @@ public function Init();override; function Copy(_obj: Xfrm);override; public + // attributes property + property FlipH read ReadXmlAttrFlipH write WriteXmlAttrFlipH; + property FlipV read ReadXmlAttrFlipV write WriteXmlAttrFlipV; + property Rot read ReadXmlAttrRot write WriteXmlAttrRot; + function ReadXmlAttrFlipH(); + function WriteXmlAttrFlipH(_value); + function ReadXmlAttrFlipV(); + function WriteXmlAttrFlipV(_value); + function ReadXmlAttrRot(); + function WriteXmlAttrRot(_value); // normal property property Off read ReadXmlChildOff; @@ -2405,6 +2415,11 @@ public function ReadXmlChildExt(): CXY; public + // Attributes + XmlAttrFlipH: OpenXmlAttribute; + XmlAttrFlipV: OpenXmlAttribute; + XmlAttrRot: OpenXmlAttribute; + // Children XmlChildOff: XY; XmlChildExt: CXY; @@ -8654,7 +8669,7 @@ function DocPr.ReadXmlChildExtLst(): ExtLst; begin if tslassigning and ifnil({self.}XmlChildExtLst) then begin - {self.}XmlChildExtLst := new DrawingML.ExtLst(self, {self.}Prefix, "extLst"); + {self.}XmlChildExtLst := new ExtLst(self, {self.}Prefix, "extLst"); container_.Set({self.}XmlChildExtLst); end return {self.}XmlChildExtLst; @@ -9196,7 +9211,7 @@ function Txbx.ReadXmlChildTxbxContent(): TxbxContent; begin if tslassigning and ifnil({self.}XmlChildTxbxContent) then begin - {self.}XmlChildTxbxContent := new TxbxContent(self, "w", "txbxContent"); + {self.}XmlChildTxbxContent := new DocxML.TxbxContent(self, "w", "txbxContent"); container_.Set({self.}XmlChildTxbxContent); end return {self.}XmlChildTxbxContent; @@ -10320,6 +10335,9 @@ begin pre := {self.}Prefix ? {self.}Prefix + ":" : ""; attributes_ := array(); attributes_pf_ := array( + "filpH": makeweakref(thisFunction(WriteXmlAttrFlipH)), + "filpV": makeweakref(thisFunction(WriteXmlAttrFlipV)), + "rot": makeweakref(thisFunction(WriteXmlAttrRot)), ); sorted_child_ := array( pre + "off": array(0, makeweakref(thisFunction(ReadXmlChildOff))), @@ -10333,6 +10351,12 @@ begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); + if not ifnil(_obj.FlipH) then + {self.}FlipH := _obj.FlipH; + if not ifnil(_obj.FlipV) then + {self.}FlipV := _obj.FlipV; + if not ifnil(_obj.Rot) then + {self.}Rot := _obj.Rot; if not ifnil(_obj.XmlChildOff) then {self.}Off.Copy(_obj.XmlChildOff); if not ifnil(_obj.XmlChildExt) then @@ -10340,6 +10364,51 @@ begin tslassigning := tslassigning_backup; end; +function Xfrm.ReadXmlAttrFlipH(); +begin + return {self.}XmlAttrFlipH.Value; +end; + +function Xfrm.WriteXmlAttrFlipH(_value); +begin + if ifnil({self.}XmlAttrFlipH) then + begin + {self.}XmlAttrFlipH := new OpenXmlAttribute("", "filpH", nil); + attributes_[length(attributes_)] := {self.}XmlAttrFlipH; + end + {self.}XmlAttrFlipH.Value := _value; +end; + +function Xfrm.ReadXmlAttrFlipV(); +begin + return {self.}XmlAttrFlipV.Value; +end; + +function Xfrm.WriteXmlAttrFlipV(_value); +begin + if ifnil({self.}XmlAttrFlipV) then + begin + {self.}XmlAttrFlipV := new OpenXmlAttribute("", "filpV", nil); + attributes_[length(attributes_)] := {self.}XmlAttrFlipV; + end + {self.}XmlAttrFlipV.Value := _value; +end; + +function Xfrm.ReadXmlAttrRot(); +begin + return {self.}XmlAttrRot.Value; +end; + +function Xfrm.WriteXmlAttrRot(_value); +begin + if ifnil({self.}XmlAttrRot) then + begin + {self.}XmlAttrRot := new OpenXmlAttribute("", "rot", nil); + attributes_[length(attributes_)] := {self.}XmlAttrRot; + end + {self.}XmlAttrRot.Value := _value; +end; + function Xfrm.ReadXmlChildOff(): XY; begin if tslassigning and ifnil({self.}XmlChildOff) then diff --git a/autounit/DrawingMLUnitDecorator.tsf b/autounit/DrawingMLUnitDecorator.tsf index 9796085..6f0f01f 100644 --- a/autounit/DrawingMLUnitDecorator.tsf +++ b/autounit/DrawingMLUnitDecorator.tsf @@ -3059,6 +3059,12 @@ function XfrmUnitDecorator.Convert(); begin tslassigning_backup := tslassigning; tslassigning := 1; + if not ifnil(object_.XmlAttrFlipH) then + {self.}FlipH := object_.XmlAttrFlipH.Value; + if not ifnil(object_.XmlAttrFlipV) then + {self.}FlipV := object_.XmlAttrFlipV.Value; + if not ifnil(object_.XmlAttrRot) then + {self.}Rot := object_.XmlAttrRot.Value; if not ifnil(object_.XmlChildOff) then {self.}XmlChildOff := new XYUnitDecorator(object_.XmlChildOff); if not ifnil(object_.XmlChildExt) then diff --git a/autounit/SharedML.tsf b/autounit/SharedML.tsf index 7531baf..544bd77 100644 --- a/autounit/SharedML.tsf +++ b/autounit/SharedML.tsf @@ -121,8 +121,12 @@ public public // normal property + property F read ReadXmlChildF; + property Rad read ReadXmlChildRad; property SSub read ReadXmlChildSSub; property Nary read ReadXmlChildNary; + function ReadXmlChildF(): F; + function ReadXmlChildRad(): Rad; function ReadXmlChildSSub(): SSub; function ReadXmlChildNary(): Nary; @@ -138,6 +142,8 @@ public public // Children + XmlChildF: F; + XmlChildRad: Rad; XmlChildSSub: SSub; XmlChildNary: Nary; end; @@ -237,13 +243,28 @@ public public // normal property + property BegChr read ReadXmlChildBegChr; + property EndChr read ReadXmlChildEndChr; + property SepChr read ReadXmlChildSepChr; + property Shp read ReadXmlChildShp; + property Grow read ReadXmlChildGrow; property CtrlPr read ReadXmlChildCtrlPr; property RPr read ReadXmlChildRPr; + function ReadXmlChildBegChr(): PureMVal; + function ReadXmlChildEndChr(): PureMVal; + function ReadXmlChildSepChr(): PureMVal; + function ReadXmlChildShp(): PureMVal; + function ReadXmlChildGrow(): PureMVal; function ReadXmlChildCtrlPr(): CtrlPr; function ReadXmlChildRPr(): RPr; public // Children + XmlChildBegChr: PureMVal; + XmlChildEndChr: PureMVal; + XmlChildSepChr: PureMVal; + XmlChildShp: PureMVal; + XmlChildGrow: PureMVal; XmlChildCtrlPr: CtrlPr; XmlChildRPr: RPr; end; @@ -287,18 +308,22 @@ public // multi property property Rs read ReadRs; property Ds read ReadDs; + property SSups read ReadSSups; property SSubs read ReadSSubs; property Funcs read ReadFuncs; function ReadRs(_index); function ReadDs(_index); + function ReadSSups(_index); function ReadSSubs(_index); function ReadFuncs(_index); function AddR(): R; function AddD(): D; + function AddSSup(): SSup; function AddSSub(): SSub; function AddFunc(): Func; function AppendR(): R; function AppendD(): D; + function AppendSSup(): SSup; function AppendSSub(): SSub; function AppendFunc(): Func; @@ -308,6 +333,72 @@ public XmlChildCtrlPr: CtrlPr; end; +type SSup = 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: SSup);override; +public + + // normal property + property SSupPr read ReadXmlChildSSupPr; + property E read ReadXmlChildE; + property Sup read ReadXmlChildSup; + function ReadXmlChildSSupPr(): SSupPr; + function ReadXmlChildE(): E; + function ReadXmlChildSup(): Sup; + +public + // Children + XmlChildSSupPr: SSupPr; + XmlChildE: E; + XmlChildSup: Sup; +end; + +type SSupPr = 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: SSupPr);override; +public + + // normal property + property CtrlPr read ReadXmlChildCtrlPr; + function ReadXmlChildCtrlPr(): CtrlPr; + +public + // Children + XmlChildCtrlPr: CtrlPr; +end; + +type Sup = 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: Sup);override; +public + + // normal property + property CtrlPr read ReadXmlChildCtrlPr; + function ReadXmlChildCtrlPr(): CtrlPr; + + // multi property + property Rs read ReadRs; + function ReadRs(_index); + function AddR(): R; + function AppendR(): R; + +public + // Children + XmlChildCtrlPr: CtrlPr; +end; + type F = class(OpenXmlElement) public function Create();overload; @@ -362,6 +453,12 @@ public function Copy(_obj: Num);override; public + // normal property + property Rad read ReadXmlChildRad; + property CtrlPr read ReadXmlChildCtrlPr; + function ReadXmlChildRad(): Rad; + function ReadXmlChildCtrlPr(): CtrlPr; + // multi property property Rs read ReadRs; function ReadRs(_index); @@ -370,6 +467,71 @@ public public // Children + XmlChildRad: Rad; + XmlChildCtrlPr: CtrlPr; +end; + +type Rad = 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: Rad);override; +public + + // normal property + property RadPr read ReadXmlChildRadPr; + property Deg read ReadXmlChildDeg; + property E read ReadXmlChildE; + function ReadXmlChildRadPr(): RadPr; + function ReadXmlChildDeg(): Deg; + function ReadXmlChildE(): E; + +public + // Children + XmlChildRadPr: RadPr; + XmlChildDeg: Deg; + XmlChildE: E; +end; + +type RadPr = 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: RadPr);override; +public + + // normal property + property DegHide read ReadXmlChildDegHide; + property CtrlPr read ReadXmlChildCtrlPr; + function ReadXmlChildDegHide(): PureMVal; + function ReadXmlChildCtrlPr(): CtrlPr; + +public + // Children + XmlChildDegHide: PureMVal; + XmlChildCtrlPr: CtrlPr; +end; + +type Deg = 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: Deg);override; +public + + // normal property + property CtrlPr read ReadXmlChildCtrlPr; + function ReadXmlChildCtrlPr(): CtrlPr; + +public + // Children + XmlChildCtrlPr: CtrlPr; end; type Den = class(OpenXmlElement) @@ -495,35 +657,28 @@ public // normal property property Chr read ReadXmlChildChr; + property Grow read ReadXmlChildGrow; + property SubHide read ReadXmlChildSubHide; + property SupHide read ReadXmlChildSupHide; + property LimLoc read ReadXmlChildLimLoc; property CtrlPr read ReadXmlChildCtrlPr; function ReadXmlChildChr(): PureMVal; + function ReadXmlChildGrow(): PureMVal; + function ReadXmlChildSubHide(): PureMVal; + function ReadXmlChildSupHide(): PureMVal; + function ReadXmlChildLimLoc(): PureMVal; function ReadXmlChildCtrlPr(): CtrlPr; public // Children XmlChildChr: PureMVal; + XmlChildGrow: PureMVal; + XmlChildSubHide: PureMVal; + XmlChildSupHide: PureMVal; + XmlChildLimLoc: PureMVal; XmlChildCtrlPr: CtrlPr; end; -type Sup = 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: Sup);override; -public - - // multi property - property Rs read ReadRs; - function ReadRs(_index); - function AddR(): R; - function AppendR(): R; - -public - // Children -end; - type Func = class(OpenXmlElement) public function Create();overload; @@ -1000,8 +1155,8 @@ begin attributes_pf_ := array( ); sorted_child_ := array( - pre + "OMathParaPr": array(0, makeweakref(thisFunction(ReadXmlChildOMathParaPr))), - pre + "OMath": array(1, makeweakref(thisFunction(ReadXmlChildOMath))), + pre + "oMathParaPr": array(0, makeweakref(thisFunction(ReadXmlChildOMathParaPr))), + pre + "oMath": array(1, makeweakref(thisFunction(ReadXmlChildOMath))), ); container_ := new TSOfficeContainer(sorted_child_); end; @@ -1022,7 +1177,7 @@ function OMathPara.ReadXmlChildOMathParaPr(): OMathParaPr; begin if tslassigning and ifnil({self.}XmlChildOMathParaPr) then begin - {self.}XmlChildOMathParaPr := new OMathParaPr(self, {self.}Prefix, "OMathParaPr"); + {self.}XmlChildOMathParaPr := new OMathParaPr(self, {self.}Prefix, "oMathParaPr"); container_.Set({self.}XmlChildOMathParaPr); end return {self.}XmlChildOMathParaPr; @@ -1032,7 +1187,7 @@ function OMathPara.ReadXmlChildOMath(): OMath; begin if tslassigning and ifnil({self.}XmlChildOMath) then begin - {self.}XmlChildOMath := new OMath(self, {self.}Prefix, "OMath"); + {self.}XmlChildOMath := new OMath(self, {self.}Prefix, "oMath"); container_.Set({self.}XmlChildOMath); end return {self.}XmlChildOMath; @@ -1164,8 +1319,10 @@ begin sorted_child_ := array( pre + "r": array(0, makeweakref(thisFunction(AppendR))), pre + "d": array(1, makeweakref(thisFunction(AppendD))), - pre + "sSub": array(2, makeweakref(thisFunction(ReadXmlChildSSub))), - pre + "nary": array(3, makeweakref(thisFunction(ReadXmlChildNary))), + pre + "f": array(2, makeweakref(thisFunction(ReadXmlChildF))), + pre + "rad": array(3, makeweakref(thisFunction(ReadXmlChildRad))), + pre + "sSub": array(4, makeweakref(thisFunction(ReadXmlChildSSub))), + pre + "nary": array(5, makeweakref(thisFunction(ReadXmlChildNary))), ); container_ := new TSOfficeContainer(sorted_child_); end; @@ -1175,6 +1332,10 @@ begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); + if not ifnil(_obj.XmlChildF) then + {self.}F.Copy(_obj.XmlChildF); + if not ifnil(_obj.XmlChildRad) then + {self.}Rad.Copy(_obj.XmlChildRad); if not ifnil(_obj.XmlChildSSub) then {self.}SSub.Copy(_obj.XmlChildSSub); if not ifnil(_obj.XmlChildNary) then @@ -1182,6 +1343,26 @@ begin tslassigning := tslassigning_backup; end; +function OMath.ReadXmlChildF(): F; +begin + if tslassigning and ifnil({self.}XmlChildF) then + begin + {self.}XmlChildF := new F(self, {self.}Prefix, "f"); + container_.Set({self.}XmlChildF); + end + return {self.}XmlChildF; +end; + +function OMath.ReadXmlChildRad(): Rad; +begin + if tslassigning and ifnil({self.}XmlChildRad) then + begin + {self.}XmlChildRad := new Rad(self, {self.}Prefix, "rad"); + container_.Set({self.}XmlChildRad); + end + return {self.}XmlChildRad; +end; + function OMath.ReadXmlChildSSub(): SSub; begin if tslassigning and ifnil({self.}XmlChildSSub) then @@ -1517,8 +1698,13 @@ begin attributes_pf_ := array( ); sorted_child_ := array( - pre + "ctrlPr": array(0, makeweakref(thisFunction(ReadXmlChildCtrlPr))), - "w:rPr": array(1, makeweakref(thisFunction(ReadXmlChildRPr))), + pre + "begChr": array(0, makeweakref(thisFunction(ReadXmlChildBegChr))), + pre + "endChr": array(1, makeweakref(thisFunction(ReadXmlChildEndChr))), + pre + "sepChr": array(2, makeweakref(thisFunction(ReadXmlChildSepChr))), + pre + "shp": array(3, makeweakref(thisFunction(ReadXmlChildShp))), + pre + "grow": array(4, makeweakref(thisFunction(ReadXmlChildGrow))), + pre + "ctrlPr": array(5, makeweakref(thisFunction(ReadXmlChildCtrlPr))), + "w:rPr": array(6, makeweakref(thisFunction(ReadXmlChildRPr))), ); container_ := new TSOfficeContainer(sorted_child_); end; @@ -1528,6 +1714,16 @@ begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); + if not ifnil(_obj.XmlChildBegChr) then + {self.}BegChr.Copy(_obj.XmlChildBegChr); + if not ifnil(_obj.XmlChildEndChr) then + {self.}EndChr.Copy(_obj.XmlChildEndChr); + if not ifnil(_obj.XmlChildSepChr) then + {self.}SepChr.Copy(_obj.XmlChildSepChr); + if not ifnil(_obj.XmlChildShp) then + {self.}Shp.Copy(_obj.XmlChildShp); + if not ifnil(_obj.XmlChildGrow) then + {self.}Grow.Copy(_obj.XmlChildGrow); if not ifnil(_obj.XmlChildCtrlPr) then {self.}CtrlPr.Copy(_obj.XmlChildCtrlPr); if not ifnil(_obj.XmlChildRPr) then @@ -1535,6 +1731,56 @@ begin tslassigning := tslassigning_backup; end; +function DPr.ReadXmlChildBegChr(): PureMVal; +begin + if tslassigning and ifnil({self.}XmlChildBegChr) then + begin + {self.}XmlChildBegChr := new PureMVal(self, {self.}Prefix, "begChr"); + container_.Set({self.}XmlChildBegChr); + end + return {self.}XmlChildBegChr; +end; + +function DPr.ReadXmlChildEndChr(): PureMVal; +begin + if tslassigning and ifnil({self.}XmlChildEndChr) then + begin + {self.}XmlChildEndChr := new PureMVal(self, {self.}Prefix, "endChr"); + container_.Set({self.}XmlChildEndChr); + end + return {self.}XmlChildEndChr; +end; + +function DPr.ReadXmlChildSepChr(): PureMVal; +begin + if tslassigning and ifnil({self.}XmlChildSepChr) then + begin + {self.}XmlChildSepChr := new PureMVal(self, {self.}Prefix, "sepChr"); + container_.Set({self.}XmlChildSepChr); + end + return {self.}XmlChildSepChr; +end; + +function DPr.ReadXmlChildShp(): PureMVal; +begin + if tslassigning and ifnil({self.}XmlChildShp) then + begin + {self.}XmlChildShp := new PureMVal(self, {self.}Prefix, "shp"); + container_.Set({self.}XmlChildShp); + end + return {self.}XmlChildShp; +end; + +function DPr.ReadXmlChildGrow(): PureMVal; +begin + if tslassigning and ifnil({self.}XmlChildGrow) then + begin + {self.}XmlChildGrow := new PureMVal(self, {self.}Prefix, "grow"); + container_.Set({self.}XmlChildGrow); + end + return {self.}XmlChildGrow; +end; + function DPr.ReadXmlChildCtrlPr(): CtrlPr; begin if tslassigning and ifnil({self.}XmlChildCtrlPr) then @@ -1641,10 +1887,11 @@ begin sorted_child_ := array( pre + "r": array(0, makeweakref(thisFunction(AppendR))), pre + "d": array(1, makeweakref(thisFunction(AppendD))), - pre + "f": array(2, makeweakref(thisFunction(ReadXmlChildF))), + pre + "sSup": array(2, makeweakref(thisFunction(AppendSSup))), pre + "sSub": array(3, makeweakref(thisFunction(AppendSSub))), pre + "func": array(4, makeweakref(thisFunction(AppendFunc))), - pre + "ctrlPr": array(5, makeweakref(thisFunction(ReadXmlChildCtrlPr))), + pre + "f": array(5, makeweakref(thisFunction(ReadXmlChildF))), + pre + "ctrlPr": array(6, makeweakref(thisFunction(ReadXmlChildCtrlPr))), ); container_ := new TSOfficeContainer(sorted_child_); end; @@ -1695,6 +1942,13 @@ begin return container_.Get(pre + "d", ind); end; +function E.ReadSSups(_index); +begin + ind := ifnil(_index) ? -2 : _index; + pre := {self.}Prefix ? {self.}Prefix + ":" : ""; + return container_.Get(pre + "sSup", ind); +end; + function E.ReadSSubs(_index); begin ind := ifnil(_index) ? -2 : _index; @@ -1723,6 +1977,13 @@ begin return obj; end; +function E.AddSSup(): SSup; +begin + obj := new SSup(self, {self.}Prefix, "sSup"); + container_.Insert(obj); + return obj; +end; + function E.AddSSub(): SSub; begin obj := new SSub(self, {self.}Prefix, "sSub"); @@ -1751,6 +2012,13 @@ begin return obj; end; +function E.AppendSSup(): SSup; +begin + obj := new SSup(self, {self.}Prefix, "sSup"); + container_.Append(obj); + return obj; +end; + function E.AppendSSub(): SSub; begin obj := new SSub(self, {self.}Prefix, "sSub"); @@ -1765,6 +2033,198 @@ begin return obj; end; +function SSup.Create();overload; +begin + {self.}Create(nil, "m", "sSup"); +end; + +function SSup.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function SSup.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 SSup.Init();override; +begin + pre := {self.}Prefix ? {self.}Prefix + ":" : ""; + attributes_ := array(); + attributes_pf_ := array( + ); + sorted_child_ := array( + pre + "sSupPr": array(0, makeweakref(thisFunction(ReadXmlChildSSupPr))), + pre + "e": array(1, makeweakref(thisFunction(ReadXmlChildE))), + pre + "sup": array(2, makeweakref(thisFunction(ReadXmlChildSup))), + ); + container_ := new TSOfficeContainer(sorted_child_); +end; + +function SSup.Copy(_obj: SSup);override; +begin + tslassigning_backup := tslassigning; + tslassigning := 1; + class(OpenXmlElement).Copy(_obj); + if not ifnil(_obj.XmlChildSSupPr) then + {self.}SSupPr.Copy(_obj.XmlChildSSupPr); + if not ifnil(_obj.XmlChildE) then + {self.}E.Copy(_obj.XmlChildE); + if not ifnil(_obj.XmlChildSup) then + {self.}Sup.Copy(_obj.XmlChildSup); + tslassigning := tslassigning_backup; +end; + +function SSup.ReadXmlChildSSupPr(): SSupPr; +begin + if tslassigning and ifnil({self.}XmlChildSSupPr) then + begin + {self.}XmlChildSSupPr := new SSupPr(self, {self.}Prefix, "sSupPr"); + container_.Set({self.}XmlChildSSupPr); + end + return {self.}XmlChildSSupPr; +end; + +function SSup.ReadXmlChildE(): E; +begin + if tslassigning and ifnil({self.}XmlChildE) then + begin + {self.}XmlChildE := new E(self, {self.}Prefix, "e"); + container_.Set({self.}XmlChildE); + end + return {self.}XmlChildE; +end; + +function SSup.ReadXmlChildSup(): Sup; +begin + if tslassigning and ifnil({self.}XmlChildSup) then + begin + {self.}XmlChildSup := new Sup(self, {self.}Prefix, "sup"); + container_.Set({self.}XmlChildSup); + end + return {self.}XmlChildSup; +end; + +function SSupPr.Create();overload; +begin + {self.}Create(nil, "m", "sSupPr"); +end; + +function SSupPr.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function SSupPr.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 SSupPr.Init();override; +begin + pre := {self.}Prefix ? {self.}Prefix + ":" : ""; + attributes_ := array(); + attributes_pf_ := array( + ); + sorted_child_ := array( + pre + "ctrlPr": array(0, makeweakref(thisFunction(ReadXmlChildCtrlPr))), + ); + container_ := new TSOfficeContainer(sorted_child_); +end; + +function SSupPr.Copy(_obj: SSupPr);override; +begin + tslassigning_backup := tslassigning; + tslassigning := 1; + class(OpenXmlElement).Copy(_obj); + if not ifnil(_obj.XmlChildCtrlPr) then + {self.}CtrlPr.Copy(_obj.XmlChildCtrlPr); + tslassigning := tslassigning_backup; +end; + +function SSupPr.ReadXmlChildCtrlPr(): CtrlPr; +begin + if tslassigning and ifnil({self.}XmlChildCtrlPr) then + begin + {self.}XmlChildCtrlPr := new CtrlPr(self, {self.}Prefix, "ctrlPr"); + container_.Set({self.}XmlChildCtrlPr); + end + return {self.}XmlChildCtrlPr; +end; + +function Sup.Create();overload; +begin + {self.}Create(nil, "m", "sup"); +end; + +function Sup.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function Sup.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 Sup.Init();override; +begin + pre := {self.}Prefix ? {self.}Prefix + ":" : ""; + attributes_ := array(); + attributes_pf_ := array( + ); + sorted_child_ := array( + pre + "r": array(0, makeweakref(thisFunction(AppendR))), + pre + "ctrlPr": array(1, makeweakref(thisFunction(ReadXmlChildCtrlPr))), + ); + container_ := new TSOfficeContainer(sorted_child_); +end; + +function Sup.Copy(_obj: Sup);override; +begin + tslassigning_backup := tslassigning; + tslassigning := 1; + class(OpenXmlElement).Copy(_obj); + if not ifnil(_obj.XmlChildCtrlPr) then + {self.}CtrlPr.Copy(_obj.XmlChildCtrlPr); + tslassigning := tslassigning_backup; +end; + +function Sup.ReadXmlChildCtrlPr(): CtrlPr; +begin + if tslassigning and ifnil({self.}XmlChildCtrlPr) then + begin + {self.}XmlChildCtrlPr := new CtrlPr(self, {self.}Prefix, "ctrlPr"); + container_.Set({self.}XmlChildCtrlPr); + end + return {self.}XmlChildCtrlPr; +end; + +function Sup.ReadRs(_index); +begin + ind := ifnil(_index) ? -2 : _index; + pre := {self.}Prefix ? {self.}Prefix + ":" : ""; + return container_.Get(pre + "r", ind); +end; + +function Sup.AddR(): R; +begin + obj := new R(self, {self.}Prefix, "r"); + container_.Insert(obj); + return obj; +end; + +function Sup.AppendR(): R; +begin + obj := new R(self, {self.}Prefix, "r"); + container_.Append(obj); + return obj; +end; + function F.Create();overload; begin {self.}Create(nil, "m", "f"); @@ -1924,6 +2384,8 @@ begin ); sorted_child_ := array( pre + "r": array(0, makeweakref(thisFunction(AppendR))), + pre + "rad": array(1, makeweakref(thisFunction(ReadXmlChildRad))), + pre + "ctrlPr": array(2, makeweakref(thisFunction(ReadXmlChildCtrlPr))), ); container_ := new TSOfficeContainer(sorted_child_); end; @@ -1933,9 +2395,33 @@ begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); + if not ifnil(_obj.XmlChildRad) then + {self.}Rad.Copy(_obj.XmlChildRad); + if not ifnil(_obj.XmlChildCtrlPr) then + {self.}CtrlPr.Copy(_obj.XmlChildCtrlPr); tslassigning := tslassigning_backup; end; +function Num.ReadXmlChildRad(): Rad; +begin + if tslassigning and ifnil({self.}XmlChildRad) then + begin + {self.}XmlChildRad := new Rad(self, {self.}Prefix, "rad"); + container_.Set({self.}XmlChildRad); + end + return {self.}XmlChildRad; +end; + +function Num.ReadXmlChildCtrlPr(): CtrlPr; +begin + if tslassigning and ifnil({self.}XmlChildCtrlPr) then + begin + {self.}XmlChildCtrlPr := new CtrlPr(self, {self.}Prefix, "ctrlPr"); + container_.Set({self.}XmlChildCtrlPr); + end + return {self.}XmlChildCtrlPr; +end; + function Num.ReadRs(_index); begin ind := ifnil(_index) ? -2 : _index; @@ -1957,6 +2443,189 @@ begin return obj; end; +function Rad.Create();overload; +begin + {self.}Create(nil, "m", "rad"); +end; + +function Rad.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function Rad.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 Rad.Init();override; +begin + pre := {self.}Prefix ? {self.}Prefix + ":" : ""; + attributes_ := array(); + attributes_pf_ := array( + ); + sorted_child_ := array( + pre + "radPr": array(0, makeweakref(thisFunction(ReadXmlChildRadPr))), + pre + "deg": array(1, makeweakref(thisFunction(ReadXmlChildDeg))), + pre + "e": array(2, makeweakref(thisFunction(ReadXmlChildE))), + ); + container_ := new TSOfficeContainer(sorted_child_); +end; + +function Rad.Copy(_obj: Rad);override; +begin + tslassigning_backup := tslassigning; + tslassigning := 1; + class(OpenXmlElement).Copy(_obj); + if not ifnil(_obj.XmlChildRadPr) then + {self.}RadPr.Copy(_obj.XmlChildRadPr); + if not ifnil(_obj.XmlChildDeg) then + {self.}Deg.Copy(_obj.XmlChildDeg); + if not ifnil(_obj.XmlChildE) then + {self.}E.Copy(_obj.XmlChildE); + tslassigning := tslassigning_backup; +end; + +function Rad.ReadXmlChildRadPr(): RadPr; +begin + if tslassigning and ifnil({self.}XmlChildRadPr) then + begin + {self.}XmlChildRadPr := new RadPr(self, {self.}Prefix, "radPr"); + container_.Set({self.}XmlChildRadPr); + end + return {self.}XmlChildRadPr; +end; + +function Rad.ReadXmlChildDeg(): Deg; +begin + if tslassigning and ifnil({self.}XmlChildDeg) then + begin + {self.}XmlChildDeg := new Deg(self, {self.}Prefix, "deg"); + container_.Set({self.}XmlChildDeg); + end + return {self.}XmlChildDeg; +end; + +function Rad.ReadXmlChildE(): E; +begin + if tslassigning and ifnil({self.}XmlChildE) then + begin + {self.}XmlChildE := new E(self, {self.}Prefix, "e"); + container_.Set({self.}XmlChildE); + end + return {self.}XmlChildE; +end; + +function RadPr.Create();overload; +begin + {self.}Create(nil, "m", "radPr"); +end; + +function RadPr.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function RadPr.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 RadPr.Init();override; +begin + pre := {self.}Prefix ? {self.}Prefix + ":" : ""; + attributes_ := array(); + attributes_pf_ := array( + ); + sorted_child_ := array( + pre + "degHide": array(0, makeweakref(thisFunction(ReadXmlChildDegHide))), + pre + "ctrlPr": array(1, makeweakref(thisFunction(ReadXmlChildCtrlPr))), + ); + container_ := new TSOfficeContainer(sorted_child_); +end; + +function RadPr.Copy(_obj: RadPr);override; +begin + tslassigning_backup := tslassigning; + tslassigning := 1; + class(OpenXmlElement).Copy(_obj); + if not ifnil(_obj.XmlChildDegHide) then + {self.}DegHide.Copy(_obj.XmlChildDegHide); + if not ifnil(_obj.XmlChildCtrlPr) then + {self.}CtrlPr.Copy(_obj.XmlChildCtrlPr); + tslassigning := tslassigning_backup; +end; + +function RadPr.ReadXmlChildDegHide(): PureMVal; +begin + if tslassigning and ifnil({self.}XmlChildDegHide) then + begin + {self.}XmlChildDegHide := new PureMVal(self, {self.}Prefix, "degHide"); + container_.Set({self.}XmlChildDegHide); + end + return {self.}XmlChildDegHide; +end; + +function RadPr.ReadXmlChildCtrlPr(): CtrlPr; +begin + if tslassigning and ifnil({self.}XmlChildCtrlPr) then + begin + {self.}XmlChildCtrlPr := new CtrlPr(self, {self.}Prefix, "ctrlPr"); + container_.Set({self.}XmlChildCtrlPr); + end + return {self.}XmlChildCtrlPr; +end; + +function Deg.Create();overload; +begin + {self.}Create(nil, "m", "deg"); +end; + +function Deg.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function Deg.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 Deg.Init();override; +begin + pre := {self.}Prefix ? {self.}Prefix + ":" : ""; + attributes_ := array(); + attributes_pf_ := array( + ); + sorted_child_ := array( + pre + "ctrlPr": array(0, makeweakref(thisFunction(ReadXmlChildCtrlPr))), + ); + container_ := new TSOfficeContainer(sorted_child_); +end; + +function Deg.Copy(_obj: Deg);override; +begin + tslassigning_backup := tslassigning; + tslassigning := 1; + class(OpenXmlElement).Copy(_obj); + if not ifnil(_obj.XmlChildCtrlPr) then + {self.}CtrlPr.Copy(_obj.XmlChildCtrlPr); + tslassigning := tslassigning_backup; +end; + +function Deg.ReadXmlChildCtrlPr(): CtrlPr; +begin + if tslassigning and ifnil({self.}XmlChildCtrlPr) then + begin + {self.}XmlChildCtrlPr := new CtrlPr(self, {self.}Prefix, "ctrlPr"); + container_.Set({self.}XmlChildCtrlPr); + end + return {self.}XmlChildCtrlPr; +end; + function Den.Create();overload; begin {self.}Create(nil, "m", "den"); @@ -2317,7 +2986,11 @@ begin ); sorted_child_ := array( pre + "chr": array(0, makeweakref(thisFunction(ReadXmlChildChr))), - pre + "ctrlPr": array(1, makeweakref(thisFunction(ReadXmlChildCtrlPr))), + pre + "grow": array(1, makeweakref(thisFunction(ReadXmlChildGrow))), + pre + "subHide": array(2, makeweakref(thisFunction(ReadXmlChildSubHide))), + pre + "supHide": array(3, makeweakref(thisFunction(ReadXmlChildSupHide))), + pre + "limLoc": array(4, makeweakref(thisFunction(ReadXmlChildLimLoc))), + pre + "ctrlPr": array(5, makeweakref(thisFunction(ReadXmlChildCtrlPr))), ); container_ := new TSOfficeContainer(sorted_child_); end; @@ -2329,6 +3002,14 @@ begin class(OpenXmlElement).Copy(_obj); if not ifnil(_obj.XmlChildChr) then {self.}Chr.Copy(_obj.XmlChildChr); + if not ifnil(_obj.XmlChildGrow) then + {self.}Grow.Copy(_obj.XmlChildGrow); + if not ifnil(_obj.XmlChildSubHide) then + {self.}SubHide.Copy(_obj.XmlChildSubHide); + if not ifnil(_obj.XmlChildSupHide) then + {self.}SupHide.Copy(_obj.XmlChildSupHide); + if not ifnil(_obj.XmlChildLimLoc) then + {self.}LimLoc.Copy(_obj.XmlChildLimLoc); if not ifnil(_obj.XmlChildCtrlPr) then {self.}CtrlPr.Copy(_obj.XmlChildCtrlPr); tslassigning := tslassigning_backup; @@ -2344,6 +3025,46 @@ begin return {self.}XmlChildChr; end; +function NaryPr.ReadXmlChildGrow(): PureMVal; +begin + if tslassigning and ifnil({self.}XmlChildGrow) then + begin + {self.}XmlChildGrow := new PureMVal(self, {self.}Prefix, "grow"); + container_.Set({self.}XmlChildGrow); + end + return {self.}XmlChildGrow; +end; + +function NaryPr.ReadXmlChildSubHide(): PureMVal; +begin + if tslassigning and ifnil({self.}XmlChildSubHide) then + begin + {self.}XmlChildSubHide := new PureMVal(self, {self.}Prefix, "subHide"); + container_.Set({self.}XmlChildSubHide); + end + return {self.}XmlChildSubHide; +end; + +function NaryPr.ReadXmlChildSupHide(): PureMVal; +begin + if tslassigning and ifnil({self.}XmlChildSupHide) then + begin + {self.}XmlChildSupHide := new PureMVal(self, {self.}Prefix, "supHide"); + container_.Set({self.}XmlChildSupHide); + end + return {self.}XmlChildSupHide; +end; + +function NaryPr.ReadXmlChildLimLoc(): PureMVal; +begin + if tslassigning and ifnil({self.}XmlChildLimLoc) then + begin + {self.}XmlChildLimLoc := new PureMVal(self, {self.}Prefix, "limLoc"); + container_.Set({self.}XmlChildLimLoc); + end + return {self.}XmlChildLimLoc; +end; + function NaryPr.ReadXmlChildCtrlPr(): CtrlPr; begin if tslassigning and ifnil({self.}XmlChildCtrlPr) then @@ -2354,63 +3075,6 @@ begin return {self.}XmlChildCtrlPr; end; -function Sup.Create();overload; -begin - {self.}Create(nil, "m", "sup"); -end; - -function Sup.Create(_node: XmlNode);overload; -begin - class(OpenXmlElement).Create(_node: XmlNode); -end; - -function Sup.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 Sup.Init();override; -begin - pre := {self.}Prefix ? {self.}Prefix + ":" : ""; - attributes_ := array(); - attributes_pf_ := array( - ); - sorted_child_ := array( - pre + "r": array(0, makeweakref(thisFunction(AppendR))), - ); - container_ := new TSOfficeContainer(sorted_child_); -end; - -function Sup.Copy(_obj: Sup);override; -begin - tslassigning_backup := tslassigning; - tslassigning := 1; - class(OpenXmlElement).Copy(_obj); - tslassigning := tslassigning_backup; -end; - -function Sup.ReadRs(_index); -begin - ind := ifnil(_index) ? -2 : _index; - pre := {self.}Prefix ? {self.}Prefix + ":" : ""; - return container_.Get(pre + "r", ind); -end; - -function Sup.AddR(): R; -begin - obj := new R(self, {self.}Prefix, "r"); - container_.Insert(obj); - return obj; -end; - -function Sup.AppendR(): R; -begin - obj := new R(self, {self.}Prefix, "r"); - container_.Append(obj); - return obj; -end; - function Func.Create();overload; begin {self.}Create(nil, "m", "func"); diff --git a/autounit/SharedMLUnitDecorator.tsf b/autounit/SharedMLUnitDecorator.tsf index e14b873..aba32fb 100644 --- a/autounit/SharedMLUnitDecorator.tsf +++ b/autounit/SharedMLUnitDecorator.tsf @@ -110,6 +110,33 @@ private object_: E; end; +type SSupUnitDecorator = class(SSup) +public + function Create(_obj: SSup); + function GetObject(); + function Convert(); +private + object_: SSup; +end; + +type SSupPrUnitDecorator = class(SSupPr) +public + function Create(_obj: SSupPr); + function GetObject(); + function Convert(); +private + object_: SSupPr; +end; + +type SupUnitDecorator = class(Sup) +public + function Create(_obj: Sup); + function GetObject(); + function Convert(); +private + object_: Sup; +end; + type FUnitDecorator = class(F) public function Create(_obj: F); @@ -137,6 +164,33 @@ private object_: Num; end; +type RadUnitDecorator = class(Rad) +public + function Create(_obj: Rad); + function GetObject(); + function Convert(); +private + object_: Rad; +end; + +type RadPrUnitDecorator = class(RadPr) +public + function Create(_obj: RadPr); + function GetObject(); + function Convert(); +private + object_: RadPr; +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); @@ -191,15 +245,6 @@ private object_: NaryPr; end; -type SupUnitDecorator = class(Sup) -public - function Create(_obj: Sup); - function GetObject(); - function Convert(); -private - object_: Sup; -end; - type FuncUnitDecorator = class(Func) public function Create(_obj: Func); @@ -429,6 +474,10 @@ begin elems := object_.Ds(); for _,elem in elems do {self.}AppendChild(new DUnitDecorator(elem)); + if not ifnil(object_.XmlChildF) then + {self.}XmlChildF := new FUnitDecorator(object_.XmlChildF); + if not ifnil(object_.XmlChildRad) then + {self.}XmlChildRad := new RadUnitDecorator(object_.XmlChildRad); if not ifnil(object_.XmlChildSSub) then {self.}XmlChildSSub := new SSubUnitDecorator(object_.XmlChildSSub); if not ifnil(object_.XmlChildNary) then @@ -544,6 +593,16 @@ function DPrUnitDecorator.Convert(); begin tslassigning_backup := tslassigning; tslassigning := 1; + if not ifnil(object_.XmlChildBegChr) then + {self.}XmlChildBegChr := new PureMValUnitDecorator(object_.XmlChildBegChr); + if not ifnil(object_.XmlChildEndChr) then + {self.}XmlChildEndChr := new PureMValUnitDecorator(object_.XmlChildEndChr); + if not ifnil(object_.XmlChildSepChr) then + {self.}XmlChildSepChr := new PureMValUnitDecorator(object_.XmlChildSepChr); + if not ifnil(object_.XmlChildShp) then + {self.}XmlChildShp := new PureMValUnitDecorator(object_.XmlChildShp); + if not ifnil(object_.XmlChildGrow) then + {self.}XmlChildGrow := new PureMValUnitDecorator(object_.XmlChildGrow); if not ifnil(object_.XmlChildCtrlPr) then {self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr); if not ifnil(object_.XmlChildRPr) then @@ -596,14 +655,87 @@ begin elems := object_.Ds(); for _,elem in elems do {self.}AppendChild(new DUnitDecorator(elem)); - if not ifnil(object_.XmlChildF) then - {self.}XmlChildF := new FUnitDecorator(object_.XmlChildF); + 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); +begin + class(SSup).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function SSupUnitDecorator.GetObject(); +begin + return object_; +end; + +function SSupUnitDecorator.Convert(); +begin + tslassigning_backup := tslassigning; + tslassigning := 1; + if not ifnil(object_.XmlChildSSupPr) then + {self.}XmlChildSSupPr := new SSupPrUnitDecorator(object_.XmlChildSSupPr); + if not ifnil(object_.XmlChildE) then + {self.}XmlChildE := new EUnitDecorator(object_.XmlChildE); + if not ifnil(object_.XmlChildSup) then + {self.}XmlChildSup := new SupUnitDecorator(object_.XmlChildSup); + tslassigning := tslassigning_backup; +end; + +function SSupPrUnitDecorator.Create(_obj: SSupPr); +begin + class(SSupPr).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function SSupPrUnitDecorator.GetObject(); +begin + return object_; +end; + +function SSupPrUnitDecorator.Convert(); +begin + tslassigning_backup := tslassigning; + tslassigning := 1; + if not ifnil(object_.XmlChildCtrlPr) then + {self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr); + 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; + 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; @@ -676,6 +808,79 @@ begin 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); +begin + class(Rad).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function RadUnitDecorator.GetObject(); +begin + return object_; +end; + +function RadUnitDecorator.Convert(); +begin + tslassigning_backup := tslassigning; + tslassigning := 1; + if not ifnil(object_.XmlChildRadPr) then + {self.}XmlChildRadPr := new RadPrUnitDecorator(object_.XmlChildRadPr); + if not ifnil(object_.XmlChildDeg) then + {self.}XmlChildDeg := new DegUnitDecorator(object_.XmlChildDeg); + if not ifnil(object_.XmlChildE) then + {self.}XmlChildE := new EUnitDecorator(object_.XmlChildE); + tslassigning := tslassigning_backup; +end; + +function RadPrUnitDecorator.Create(_obj: RadPr); +begin + class(RadPr).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function RadPrUnitDecorator.GetObject(); +begin + return object_; +end; + +function RadPrUnitDecorator.Convert(); +begin + tslassigning_backup := tslassigning; + tslassigning := 1; + if not ifnil(object_.XmlChildDegHide) then + {self.}XmlChildDegHide := new PureMValUnitDecorator(object_.XmlChildDegHide); + if not ifnil(object_.XmlChildCtrlPr) then + {self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr); + 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); tslassigning := tslassigning_backup; end; @@ -816,33 +1021,19 @@ begin tslassigning := 1; if not ifnil(object_.XmlChildChr) then {self.}XmlChildChr := new PureMValUnitDecorator(object_.XmlChildChr); + if not ifnil(object_.XmlChildGrow) then + {self.}XmlChildGrow := new PureMValUnitDecorator(object_.XmlChildGrow); + if not ifnil(object_.XmlChildSubHide) then + {self.}XmlChildSubHide := new PureMValUnitDecorator(object_.XmlChildSubHide); + if not ifnil(object_.XmlChildSupHide) then + {self.}XmlChildSupHide := new PureMValUnitDecorator(object_.XmlChildSupHide); + if not ifnil(object_.XmlChildLimLoc) then + {self.}XmlChildLimLoc := new PureMValUnitDecorator(object_.XmlChildLimLoc); if not ifnil(object_.XmlChildCtrlPr) then {self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr); 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; - elems := object_.Rs(); - for _,elem in elems do - {self.}AppendChild(new RUnitDecorator(elem)); - tslassigning := tslassigning_backup; -end; - function FuncUnitDecorator.Create(_obj: Func); begin class(Func).Create(); diff --git a/docx/DocxComponents.tsf b/docx/DocxComponents.tsf index d53a0b3..79d5f69 100644 --- a/docx/DocxComponents.tsf +++ b/docx/DocxComponents.tsf @@ -227,7 +227,6 @@ end; function DocxComponents.ReadThemes(_index); begin - uses DrawingXml; return {self.}GetPropArr(theme_array_, "theme", _index); end; diff --git a/openxml/OpenXmlAttribute.tsf b/openxml/OpenXmlAttribute.tsf index 0380da5..c57fae2 100644 --- a/openxml/OpenXmlAttribute.tsf +++ b/openxml/OpenXmlAttribute.tsf @@ -11,8 +11,6 @@ public ElementName: string; Value: any; -protected - namespace_uri_: string; end; function OpenXmlAttribute.Create(_prefix: string; _local_name: string);overload; diff --git a/utils/vba/XlsxSheetData.tsf b/utils/vba/XlsxSheetData.tsf deleted file mode 100644 index 21d492c..0000000 --- a/utils/vba/XlsxSheetData.tsf +++ /dev/null @@ -1,64 +0,0 @@ -type XlsxSheetData = class -public - function Create(sheet_data: SheetData); - function Operator[](index: integer): XlsxSheetDataRow; - function Cell(r: integer; c: integer): C; - function Rows(index: integer): XlsxSheetDataRow; - function Serialize(); - -private - rows_: array of XlsxSheetDataRow; - sheet_data_: SheetData; -end; - -function XlsxSheetData.Create(sheet_data: SheetData); -begin - rows_ := array(); - sheet_data_ := sheet_data; - rows := sheet_data.Rows(); - for i:=0 to length(rows)-1 do - begin - r := strToInt(rows[i].R); - rows_[r] := new XlsxSheetDataRow(rows[i]); - end - // println("rows = {}", rows_); -end; - -function Operator XlsxSheetData.[](index: integer): XlsxSheetDataRow; -begin - if ifnil(rows_[index]) and tslassigning then - begin - row := new Row(sheet_data_, "", "row"); - rows_[index] := new XlsxSheetDataRow(row); - pos := -1; - for k,_ in rows_ do // TODO:此处弊端是要遍历所有k,可考虑维护一个新array,用二分 - if pos < k and k < index then pos := k; - pos = -1 ? sheet_data_.AppendChild(row) : sheet_data_.InsertAfter(row, rows_[pos].Data()); - end - return rows_[index]; -end; - -function XlsxSheetData.Rows(index: integer): XlsxSheetDataRow; -begin - return self[index]; -end; - -function XlsxSheetData.Cell(r: integer; c: integer): C; -begin - bk := tslassigning; - tslassigning := 1; - c := self[r][c]; - tslassigning := bk; - return c; -end; - -function XlsxSheetData.Serialize(); -begin - for k,row in rows_ do - begin - r := row.Data(); - r.R := k; - row.Serialize(); - end - // sheet_data_.Serialize(); -end; diff --git a/utils/vba/XlsxSheetDataRow.tsf b/utils/vba/XlsxSheetDataRow.tsf deleted file mode 100644 index 516d398..0000000 --- a/utils/vba/XlsxSheetDataRow.tsf +++ /dev/null @@ -1,63 +0,0 @@ -type XlsxSheetDataRow = class -public - function Create(row: Row); - function Operator[](index: integer): XlsxSheetDataCol; - function Cols(index: integer): XlsxSheetDataCol; - function Data(): Row; - function Serialize(); - -public - row_: Row; - cols_: array of XlsxSheetDataCol; -end; - - -function XlsxSheetDataRow.Create(row: Row); -begin - row_ := row; - cols_ := array(); - cs := row.Cs(); - for i:=0 to length(cs)-1 do - begin - r := cs[i].R; - cell_name := SplitCellName(r); - index := ColumnNameToNumber(cell_name[1])[1]; - cols_[index] := cs[i]; - end - // println("cols_ = {}", cols_); -end; - -function Operator XlsxSheetDataRow.[](index: integer): XlsxSheetDataCol; -begin - if ifnil(cols_[index]) and tslassigning then - begin - col := new C(row_, "", "c"); - cols_[index] := col; - pos := -1; - for k,_ in cols_ do - if pos < k and k < index then pos := k; - pos = -1 ? row_.AppendChild(col) : row_.InsertAfter(col, cols_[pos]); - end - return cols_[index]; -end; - -function XlsxSheetDataRow.Cols(index: integer): XlsxSheetDataCol; -begin - return self[index]; -end; - -function XlsxSheetDataRow.Data(): Row; -begin - return row_; -end; - -function XlsxSheetDataRow.Serialize(); -begin - for k,c in cols_ do - begin - c.R := CoordinatesToCellName(k, row_.R)[1]; - c.Serialize(); - // println("c.R = {}, row.R = {}", c.R, row_.R); - end - row_.Serialize(); -end;