From 5a5906a636983f6f9ce050ae1263c422c43f966e Mon Sep 17 00:00:00 2001 From: csh Date: Wed, 13 Nov 2024 17:42:29 +0800 Subject: [PATCH] update config --- .../decorator/docx/PPrUnitDecorator@DOCX.tsf | 2 + .../docx/SpacingUnitDecorator@DOCX.tsf | 2 +- .../docx/TblBorderUnitDecorator@DOCX.tsf | 2 +- .../docx/TblBordersUnitDecorator@DOCX.tsf | 12 +- .../docx/TblCellSpacingUnitDecorator@DOCX.tsf | 32 +++ .../docx/TblPrUnitDecorator@DOCX.tsf | 16 +- .../docx/TcBorderUnitDecorator@DOCX.tsf | 40 ++++ .../docx/TcBordersUnitDecorator@DOCX.tsf | 44 +++++ .../decorator/docx/TcPrUnitDecorator@DOCX.tsf | 2 + .../docx/TrHeightUnitDecorator@DOCX.tsf | 2 + autoclass/docx/PPr@DOCX.tsf | 44 ++++- autoclass/docx/TblBorders@DOCX.tsf | 24 +-- autoclass/docx/TblCellSpacing@DOCX.tsf | 96 +++++++++ autoclass/docx/TblPr@DOCX.tsf | 144 ++++++++++---- autoclass/docx/TcBorder@DOCX.tsf | 184 ++++++++++++++++++ autoclass/docx/TcBorders@DOCX.tsf | 179 +++++++++++++++++ autoclass/docx/TcPr@DOCX.tsf | 16 ++ autoclass/docx/TrHeight@DOCX.tsf | 22 +++ utils/TSSafeUnitConverter.tsf | 8 + utils/TSUnitConverter.tsf | 8 +- 20 files changed, 806 insertions(+), 73 deletions(-) create mode 100644 autoclass/decorator/docx/TblCellSpacingUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/TcBorderUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/TcBordersUnitDecorator@DOCX.tsf create mode 100644 autoclass/docx/TblCellSpacing@DOCX.tsf create mode 100644 autoclass/docx/TcBorder@DOCX.tsf create mode 100644 autoclass/docx/TcBorders@DOCX.tsf diff --git a/autoclass/decorator/docx/PPrUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/PPrUnitDecorator@DOCX.tsf index 6f1af51..039903f 100644 --- a/autoclass/decorator/docx/PPrUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/PPrUnitDecorator@DOCX.tsf @@ -44,6 +44,8 @@ begin {self.}KeepNext.Copy(object_.XmlChildKeepNext); if not ifnil(object_.XmlChildKeepLines) then {self.}KeepLines.Copy(object_.XmlChildKeepLines); + if not ifnil(object_.XmlChildPageBreakBefore) then + {self.}PageBreakBefore.Copy(object_.XmlChildPageBreakBefore); if not ifnil(object_.XmlChildAdjustRightInd) then {self.}XmlChildAdjustRightInd := new PureWValUnitDecorator(object_.XmlChildAdjustRightInd); if not ifnil(object_.XmlChildSpacing) then diff --git a/autoclass/decorator/docx/SpacingUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/SpacingUnitDecorator@DOCX.tsf index 1ad74b3..607d76f 100644 --- a/autoclass/decorator/docx/SpacingUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/SpacingUnitDecorator@DOCX.tsf @@ -37,7 +37,7 @@ begin if not ifnil(object_.XmlAttrAfterAutospacing) then {self.}AfterAutospacing := object_.XmlAttrAfterAutospacing.Value; if not ifnil(object_.XmlAttrLine) then - {self.}Line := TSSafeUnitConverter.TwipsToPoints(object_.XmlAttrLine.Value); + {self.}Line := TSSafeUnitConverter.ToInt(object_.XmlAttrLine.Value); if not ifnil(object_.XmlAttrLineRule) then {self.}LineRule := object_.XmlAttrLineRule.Value; tslassigning := tslassigning_backup; diff --git a/autoclass/decorator/docx/TblBorderUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/TblBorderUnitDecorator@DOCX.tsf index abfd859..2cbdda9 100644 --- a/autoclass/decorator/docx/TblBorderUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/TblBorderUnitDecorator@DOCX.tsf @@ -35,6 +35,6 @@ begin if not ifnil(object_.XmlAttrThemeTint) then {self.}ThemeTint := object_.XmlAttrThemeTint.Value; if not ifnil(object_.XmlAttrSz) then - {self.}Sz := TSSafeUnitConverter.HalfPointToPoints(object_.XmlAttrSz.Value); + {self.}Sz := TSSafeUnitConverter.EighthPointToPoints(object_.XmlAttrSz.Value); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/TblBordersUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/TblBordersUnitDecorator@DOCX.tsf index 2422322..071e75b 100644 --- a/autoclass/decorator/docx/TblBordersUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/TblBordersUnitDecorator@DOCX.tsf @@ -25,16 +25,16 @@ begin tslassigning_backup := tslassigning; tslassigning := 1; if not ifnil(object_.XmlChildTop) then - {self.}XmlChildTop := new tblBorderUnitDecorator(object_.XmlChildTop); + {self.}XmlChildTop := new TblBorderUnitDecorator(object_.XmlChildTop); if not ifnil(object_.XmlChildLeft) then - {self.}XmlChildLeft := new tblBorderUnitDecorator(object_.XmlChildLeft); + {self.}XmlChildLeft := new TblBorderUnitDecorator(object_.XmlChildLeft); if not ifnil(object_.XmlChildBottom) then - {self.}XmlChildBottom := new tblBorderUnitDecorator(object_.XmlChildBottom); + {self.}XmlChildBottom := new TblBorderUnitDecorator(object_.XmlChildBottom); if not ifnil(object_.XmlChildRight) then - {self.}XmlChildRight := new tblBorderUnitDecorator(object_.XmlChildRight); + {self.}XmlChildRight := new TblBorderUnitDecorator(object_.XmlChildRight); if not ifnil(object_.XmlChildInsideH) then - {self.}XmlChildInsideH := new PureWValUnitDecorator(object_.XmlChildInsideH); + {self.}XmlChildInsideH := new TblBorderUnitDecorator(object_.XmlChildInsideH); if not ifnil(object_.XmlChildInsideV) then - {self.}XmlChildInsideV := new PureWValUnitDecorator(object_.XmlChildInsideV); + {self.}XmlChildInsideV := new TblBorderUnitDecorator(object_.XmlChildInsideV); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/TblCellSpacingUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/TblCellSpacingUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..3833f96 --- /dev/null +++ b/autoclass/decorator/docx/TblCellSpacingUnitDecorator@DOCX.tsf @@ -0,0 +1,32 @@ +type TblCellSpacingUnitDecorator = class(TblCellSpacing) +uses TSSafeUnitConverter; +public + function Create(_obj: TblCellSpacing); + function GetObject(); + function Convert(); +private + object_: TblCellSpacing; +end; + +function TblCellSpacingUnitDecorator.Create(_obj: TblCellSpacing); +begin + class(TblCellSpacing).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function TblCellSpacingUnitDecorator.GetObject(); +begin + return object_; +end; + +function TblCellSpacingUnitDecorator.Convert(); +begin + tslassigning_backup := tslassigning; + tslassigning := 1; + if not ifnil(object_.XmlAttrW) then + {self.}W := TSSafeUnitConverter.TwipsToPoints(object_.XmlAttrW.Value); + if not ifnil(object_.XmlAttrType) then + {self.}Type := object_.XmlAttrType.Value; + tslassigning := tslassigning_backup; +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/TblPrUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/TblPrUnitDecorator@DOCX.tsf index fff7f18..6ad4875 100644 --- a/autoclass/decorator/docx/TblPrUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/TblPrUnitDecorator@DOCX.tsf @@ -24,12 +24,10 @@ function TblPrUnitDecorator.Convert(); begin tslassigning_backup := tslassigning; tslassigning := 1; - if not ifnil(object_.XmlChildTblStyleRowBandSize) then - {self.}XmlChildTblStyleRowBandSize := new PureWValUnitDecorator(object_.XmlChildTblStyleRowBandSize); - if not ifnil(object_.XmlChildTblStyleColBandSize) then - {self.}XmlChildTblStyleColBandSize := new PureWValUnitDecorator(object_.XmlChildTblStyleColBandSize); if not ifnil(object_.XmlChildJc) then {self.}XmlChildJc := new PureWValUnitDecorator(object_.XmlChildJc); + if not ifnil(object_.XmlChildShd) then + {self.}XmlChildShd := new ShdUnitDecorator(object_.XmlChildShd); if not ifnil(object_.XmlChildTblStyle) then {self.}XmlChildTblStyle := new PureWValUnitDecorator(object_.XmlChildTblStyle); if not ifnil(object_.XmlChildTblW) then @@ -44,5 +42,15 @@ begin {self.}XmlChildTblBorders := new TblBordersUnitDecorator(object_.XmlChildTblBorders); if not ifnil(object_.XmlChildTblCellMar) then {self.}XmlChildTblCellMar := new TblCellMarUnitDecorator(object_.XmlChildTblCellMar); + if not ifnil(object_.XmlChildTblCellSpacing) then + {self.}XmlChildTblCellSpacing := new TblCellSpacingUnitDecorator(object_.XmlChildTblCellSpacing); + if not ifnil(object_.XmlChildTblCaption) then + {self.}XmlChildTblCaption := new PureWValUnitDecorator(object_.XmlChildTblCaption); + if not ifnil(object_.XmlChildTblDescription) then + {self.}XmlChildTblDescription := new PureWValUnitDecorator(object_.XmlChildTblDescription); + if not ifnil(object_.XmlChildTblStyleRowBandSize) then + {self.}XmlChildTblStyleRowBandSize := new PureWValUnitDecorator(object_.XmlChildTblStyleRowBandSize); + if not ifnil(object_.XmlChildTblStyleColBandSize) then + {self.}XmlChildTblStyleColBandSize := new PureWValUnitDecorator(object_.XmlChildTblStyleColBandSize); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/TcBorderUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/TcBorderUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..b01b771 --- /dev/null +++ b/autoclass/decorator/docx/TcBorderUnitDecorator@DOCX.tsf @@ -0,0 +1,40 @@ +type TcBorderUnitDecorator = class(TcBorder) +uses TSSafeUnitConverter; +public + function Create(_obj: TcBorder); + function GetObject(); + function Convert(); +private + object_: TcBorder; +end; + +function TcBorderUnitDecorator.Create(_obj: TcBorder); +begin + class(TcBorder).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function TcBorderUnitDecorator.GetObject(); +begin + return object_; +end; + +function TcBorderUnitDecorator.Convert(); +begin + tslassigning_backup := tslassigning; + tslassigning := 1; + if not ifnil(object_.XmlAttrVal) then + {self.}Val := object_.XmlAttrVal.Value; + if not ifnil(object_.XmlAttrColor) then + {self.}Color := object_.XmlAttrColor.Value; + if not ifnil(object_.XmlAttrSpace) then + {self.}Space := object_.XmlAttrSpace.Value; + if not ifnil(object_.XmlAttrThemeColor) then + {self.}ThemeColor := object_.XmlAttrThemeColor.Value; + if not ifnil(object_.XmlAttrThemeTint) then + {self.}ThemeTint := object_.XmlAttrThemeTint.Value; + if not ifnil(object_.XmlAttrSz) then + {self.}Sz := TSSafeUnitConverter.EighthPointToPoints(object_.XmlAttrSz.Value); + tslassigning := tslassigning_backup; +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/TcBordersUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/TcBordersUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..5390f89 --- /dev/null +++ b/autoclass/decorator/docx/TcBordersUnitDecorator@DOCX.tsf @@ -0,0 +1,44 @@ +type TcBordersUnitDecorator = class(TcBorders) +uses TSSafeUnitConverter; +public + function Create(_obj: TcBorders); + function GetObject(); + function Convert(); +private + object_: TcBorders; +end; + +function TcBordersUnitDecorator.Create(_obj: TcBorders); +begin + class(TcBorders).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function TcBordersUnitDecorator.GetObject(); +begin + return object_; +end; + +function TcBordersUnitDecorator.Convert(); +begin + tslassigning_backup := tslassigning; + tslassigning := 1; + if not ifnil(object_.XmlChildTop) then + {self.}XmlChildTop := new TcBorderUnitDecorator(object_.XmlChildTop); + if not ifnil(object_.XmlChildLeft) then + {self.}XmlChildLeft := new TcBorderUnitDecorator(object_.XmlChildLeft); + if not ifnil(object_.XmlChildBottom) then + {self.}XmlChildBottom := new TcBorderUnitDecorator(object_.XmlChildBottom); + if not ifnil(object_.XmlChildRight) then + {self.}XmlChildRight := new TcBorderUnitDecorator(object_.XmlChildRight); + if not ifnil(object_.XmlChildTl2Br) then + {self.}XmlChildTl2Br := new TcBorderUnitDecorator(object_.XmlChildTl2Br); + if not ifnil(object_.XmlChildTr2Bl) then + {self.}XmlChildTr2Bl := new TcBorderUnitDecorator(object_.XmlChildTr2Bl); + if not ifnil(object_.XmlChildInsideH) then + {self.}XmlChildInsideH := new TcBorderUnitDecorator(object_.XmlChildInsideH); + if not ifnil(object_.XmlChildInsideV) then + {self.}XmlChildInsideV := new TcBorderUnitDecorator(object_.XmlChildInsideV); + tslassigning := tslassigning_backup; +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/TcPrUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/TcPrUnitDecorator@DOCX.tsf index 46658c4..d78cf5d 100644 --- a/autoclass/decorator/docx/TcPrUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/TcPrUnitDecorator@DOCX.tsf @@ -36,5 +36,7 @@ begin {self.}HideMark.Copy(object_.XmlChildHideMark); if not ifnil(object_.XmlChildShd) then {self.}XmlChildShd := new ShdUnitDecorator(object_.XmlChildShd); + if not ifnil(object_.XmlChildTcBorders) then + {self.}XmlChildTcBorders := new TcBordersUnitDecorator(object_.XmlChildTcBorders); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/TrHeightUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/TrHeightUnitDecorator@DOCX.tsf index 478cbcc..ab217a1 100644 --- a/autoclass/decorator/docx/TrHeightUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/TrHeightUnitDecorator@DOCX.tsf @@ -24,6 +24,8 @@ function TrHeightUnitDecorator.Convert(); begin tslassigning_backup := tslassigning; tslassigning := 1; + if not ifnil(object_.XmlAttrHRule) then + {self.}HRule := object_.XmlAttrHRule.Value; if not ifnil(object_.XmlAttrval) then {self.}val := TSSafeUnitConverter.TwipsToPoints(object_.XmlAttrval.Value); tslassigning := tslassigning_backup; diff --git a/autoclass/docx/PPr@DOCX.tsf b/autoclass/docx/PPr@DOCX.tsf index 5c1c1f9..aee29cd 100644 --- a/autoclass/docx/PPr@DOCX.tsf +++ b/autoclass/docx/PPr@DOCX.tsf @@ -12,6 +12,7 @@ public property WidowControl read ReadXmlChildWidowControl write WriteXmlChildWidowControl; property KeepNext read ReadXmlChildKeepNext write WriteXmlChildKeepNext; property KeepLines read ReadXmlChildKeepLines write WriteXmlChildKeepLines; + property PageBreakBefore read ReadXmlChildPageBreakBefore write WriteXmlChildPageBreakBefore; property ContextualSpacing read ReadXmlChildContextualSpacing write WriteXmlChildContextualSpacing; function ReadXmlChildWidowControl(); function WriteXmlChildWidowControl(_value); @@ -19,6 +20,8 @@ public function WriteXmlChildKeepNext(_value); function ReadXmlChildKeepLines(); function WriteXmlChildKeepLines(_value); + function ReadXmlChildPageBreakBefore(); + function WriteXmlChildPageBreakBefore(_value); function ReadXmlChildContextualSpacing(); function WriteXmlChildContextualSpacing(_value); @@ -64,6 +67,7 @@ public XmlChildInd: Ind; XmlChildKeepNext: OpenXmlEmpty; XmlChildKeepLines: OpenXmlEmpty; + XmlChildPageBreakBefore: OpenXmlEmpty; XmlChildAdjustRightInd: PureWVal; XmlChildSpacing: Spacing; XmlChildOutlineLvl: PureWVal; @@ -108,14 +112,15 @@ begin pre + "ind": array(7, makeweakref(thisFunction(ReadXmlChildInd))), pre + "keepNext": array(8, makeweakref(thisFunction(ReadXmlChildKeepNext))), pre + "keepLines": array(9, makeweakref(thisFunction(ReadXmlChildKeepLines))), - pre + "adjustRightInd": array(10, makeweakref(thisFunction(ReadXmlChildAdjustRightInd))), - pre + "spacing": array(11, makeweakref(thisFunction(ReadXmlChildSpacing))), - pre + "outlineLvl": array(12, makeweakref(thisFunction(ReadXmlChildOutlineLvl))), - pre + "autoSpaceDE": array(13, makeweakref(thisFunction(ReadXmlChildAutoSpaceDE))), - pre + "autoSpaceDN": array(14, makeweakref(thisFunction(ReadXmlChildAutoSpaceDN))), - pre + "rPr": array(15, makeweakref(thisFunction(ReadXmlChildRPr))), - pre + "pBdr": array(16, makeweakref(thisFunction(ReadXmlChildPBdr))), - pre + "contextualSpacing": array(17, makeweakref(thisFunction(ReadXmlChildContextualSpacing))), + pre + "pageBreakBefore": array(10, makeweakref(thisFunction(ReadXmlChildPageBreakBefore))), + pre + "adjustRightInd": array(11, makeweakref(thisFunction(ReadXmlChildAdjustRightInd))), + pre + "spacing": array(12, makeweakref(thisFunction(ReadXmlChildSpacing))), + pre + "outlineLvl": array(13, makeweakref(thisFunction(ReadXmlChildOutlineLvl))), + pre + "autoSpaceDE": array(14, makeweakref(thisFunction(ReadXmlChildAutoSpaceDE))), + pre + "autoSpaceDN": array(15, makeweakref(thisFunction(ReadXmlChildAutoSpaceDN))), + pre + "rPr": array(16, makeweakref(thisFunction(ReadXmlChildRPr))), + pre + "pBdr": array(17, makeweakref(thisFunction(ReadXmlChildPBdr))), + pre + "contextualSpacing": array(18, makeweakref(thisFunction(ReadXmlChildContextualSpacing))), ); container_ := new TSOfficeContainer(sorted_child_); end; @@ -145,6 +150,8 @@ begin ifnil({self.}XmlChildKeepNext) ? {self.}KeepNext.Copy(_obj.XmlChildKeepNext) : {self.}XmlChildKeepNext.Copy(_obj.XmlChildKeepNext); if not ifnil(_obj.XmlChildKeepLines) then ifnil({self.}XmlChildKeepLines) ? {self.}KeepLines.Copy(_obj.XmlChildKeepLines) : {self.}XmlChildKeepLines.Copy(_obj.XmlChildKeepLines); + if not ifnil(_obj.XmlChildPageBreakBefore) then + ifnil({self.}XmlChildPageBreakBefore) ? {self.}PageBreakBefore.Copy(_obj.XmlChildPageBreakBefore) : {self.}XmlChildPageBreakBefore.Copy(_obj.XmlChildPageBreakBefore); if not ifnil(_obj.XmlChildAdjustRightInd) then {self.}AdjustRightInd.Copy(_obj.XmlChildAdjustRightInd); if not ifnil(_obj.XmlChildSpacing) then @@ -227,6 +234,27 @@ begin {self.}XmlChildKeepLines.Value := _value; end; +function PPr.ReadXmlChildPageBreakBefore(); +begin + if tslassigning and ifnil({self.}XmlChildPageBreakBefore) then + begin + {self.}XmlChildPageBreakBefore := new OpenXmlEmpty(self, {self.}Prefix, "pageBreakBefore"); + container_.Set({self.}XmlChildPageBreakBefore); + return {self.}XmlChildPageBreakBefore; + end + return ifnil({self.}XmlChildPageBreakBefore) ? false : {self.}XmlChildPageBreakBefore.BoolValue(); +end; + +function PPr.WriteXmlChildPageBreakBefore(_value); +begin + if ifnil({self.}XmlChildPageBreakBefore) then + begin + {self.}XmlChildPageBreakBefore := new OpenXmlEmpty(self, {self.}Prefix, "pageBreakBefore"); + container_.Set({self.}XmlChildPageBreakBefore); + end + {self.}XmlChildPageBreakBefore.Value := _value; +end; + function PPr.ReadXmlChildContextualSpacing(); begin if tslassigning and ifnil({self.}XmlChildContextualSpacing) then diff --git a/autoclass/docx/TblBorders@DOCX.tsf b/autoclass/docx/TblBorders@DOCX.tsf index c366ac6..8cc3cb3 100644 --- a/autoclass/docx/TblBorders@DOCX.tsf +++ b/autoclass/docx/TblBorders@DOCX.tsf @@ -24,12 +24,12 @@ public public // Children - XmlChildTop: tblBorder; - XmlChildLeft: tblBorder; - XmlChildBottom: tblBorder; - XmlChildRight: tblBorder; - XmlChildInsideH: PureWVal; - XmlChildInsideV: PureWVal; + XmlChildTop: TblBorder; + XmlChildLeft: TblBorder; + XmlChildBottom: TblBorder; + XmlChildRight: TblBorder; + XmlChildInsideH: TblBorder; + XmlChildInsideV: TblBorder; end; @@ -90,7 +90,7 @@ function TblBorders.ReadXmlChildTop(); begin if tslassigning and ifnil({self.}XmlChildTop) then begin - {self.}XmlChildTop := new tblBorder(self, {self.}Prefix, "top"); + {self.}XmlChildTop := new TblBorder(self, {self.}Prefix, "top"); container_.Set({self.}XmlChildTop); end return {self.}XmlChildTop; @@ -100,7 +100,7 @@ function TblBorders.ReadXmlChildLeft(); begin if tslassigning and ifnil({self.}XmlChildLeft) then begin - {self.}XmlChildLeft := new tblBorder(self, {self.}Prefix, "left"); + {self.}XmlChildLeft := new TblBorder(self, {self.}Prefix, "left"); container_.Set({self.}XmlChildLeft); end return {self.}XmlChildLeft; @@ -110,7 +110,7 @@ function TblBorders.ReadXmlChildBottom(); begin if tslassigning and ifnil({self.}XmlChildBottom) then begin - {self.}XmlChildBottom := new tblBorder(self, {self.}Prefix, "bottom"); + {self.}XmlChildBottom := new TblBorder(self, {self.}Prefix, "bottom"); container_.Set({self.}XmlChildBottom); end return {self.}XmlChildBottom; @@ -120,7 +120,7 @@ function TblBorders.ReadXmlChildRight(); begin if tslassigning and ifnil({self.}XmlChildRight) then begin - {self.}XmlChildRight := new tblBorder(self, {self.}Prefix, "right"); + {self.}XmlChildRight := new TblBorder(self, {self.}Prefix, "right"); container_.Set({self.}XmlChildRight); end return {self.}XmlChildRight; @@ -130,7 +130,7 @@ function TblBorders.ReadXmlChildInsideH(); begin if tslassigning and ifnil({self.}XmlChildInsideH) then begin - {self.}XmlChildInsideH := new PureWVal(self, {self.}Prefix, "insideH"); + {self.}XmlChildInsideH := new TblBorder(self, {self.}Prefix, "insideH"); container_.Set({self.}XmlChildInsideH); end return {self.}XmlChildInsideH; @@ -140,7 +140,7 @@ function TblBorders.ReadXmlChildInsideV(); begin if tslassigning and ifnil({self.}XmlChildInsideV) then begin - {self.}XmlChildInsideV := new PureWVal(self, {self.}Prefix, "insideV"); + {self.}XmlChildInsideV := new TblBorder(self, {self.}Prefix, "insideV"); container_.Set({self.}XmlChildInsideV); end return {self.}XmlChildInsideV; diff --git a/autoclass/docx/TblCellSpacing@DOCX.tsf b/autoclass/docx/TblCellSpacing@DOCX.tsf new file mode 100644 index 0000000..4cdeca2 --- /dev/null +++ b/autoclass/docx/TblCellSpacing@DOCX.tsf @@ -0,0 +1,96 @@ +type TblCellSpacing = 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: TblCellSpacing);override; + +public + + // attributes property + property W read ReadXmlAttrW write WriteXmlAttrW; + property Type read ReadXmlAttrType write WriteXmlAttrType; + function ReadXmlAttrW(); + function WriteXmlAttrW(_value); + function ReadXmlAttrType(); + function WriteXmlAttrType(_value); + +public + // Attributes + XmlAttrW: OpenXmlAttribute; + XmlAttrType: OpenXmlAttribute; + + +end; + +function TblCellSpacing.Create();overload; +begin + {self.}Create(nil, "w", "tblCellSpacing"); +end; + +function TblCellSpacing.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function TblCellSpacing.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 TblCellSpacing.Init();override; +begin + pre := {self.}Prefix ? {self.}Prefix + ":" : ""; + attributes_ := array(); + attributes_pf_ := array( + pre + "w": makeweakref(thisFunction(WriteXmlAttrW)), + pre + "type": makeweakref(thisFunction(WriteXmlAttrType)), + ); + sorted_child_ := array( + ); + container_ := new TSOfficeContainer(sorted_child_); +end; + +function TblCellSpacing.Copy(_obj: TblCellSpacing);override; +begin + tslassigning_backup := tslassigning; + tslassigning := 1; + class(OpenXmlElement).Copy(_obj); + if not ifnil(_obj.W) then + {self.}W := _obj.W; + if not ifnil(_obj.Type) then + {self.}Type := _obj.Type; + tslassigning := tslassigning_backup; +end; + +function TblCellSpacing.ReadXmlAttrW(); +begin + return {self.}XmlAttrW.Value; +end; + +function TblCellSpacing.WriteXmlAttrW(_value); +begin + if ifnil({self.}XmlAttrW) then + begin + {self.}XmlAttrW := new OpenXmlAttribute({self.}Prefix, "w", nil); + attributes_[length(attributes_)] := {self.}XmlAttrW; + end + {self.}XmlAttrW.Value := _value; +end; + +function TblCellSpacing.ReadXmlAttrType(); +begin + return {self.}XmlAttrType.Value; +end; + +function TblCellSpacing.WriteXmlAttrType(_value); +begin + if ifnil({self.}XmlAttrType) then + begin + {self.}XmlAttrType := new OpenXmlAttribute({self.}Prefix, "type", nil); + attributes_[length(attributes_)] := {self.}XmlAttrType; + end + {self.}XmlAttrType.Value := _value; +end; diff --git a/autoclass/docx/TblPr@DOCX.tsf b/autoclass/docx/TblPr@DOCX.tsf index 8a28317..604a340 100644 --- a/autoclass/docx/TblPr@DOCX.tsf +++ b/autoclass/docx/TblPr@DOCX.tsf @@ -9,9 +9,8 @@ public public // normal property - property TblStyleRowBandSize read ReadXmlChildTblStyleRowBandSize; - property TblStyleColBandSize read ReadXmlChildTblStyleColBandSize; property Jc read ReadXmlChildJc; + property Shd read ReadXmlChildShd; property TblStyle read ReadXmlChildTblStyle; property TblW read ReadXmlChildTblW; property TblInd read ReadXmlChildTblInd; @@ -19,9 +18,13 @@ public property TblLook read ReadXmlChildTblLook; property TblBorders read ReadXmlChildTblBorders; property TblCellMar read ReadXmlChildTblCellMar; - function ReadXmlChildTblStyleRowBandSize(); - function ReadXmlChildTblStyleColBandSize(); + property TblCellSpacing read ReadXmlChildTblCellSpacing; + property TblCaption read ReadXmlChildTblCaption; + property TblDescription read ReadXmlChildTblDescription; + property TblStyleRowBandSize read ReadXmlChildTblStyleRowBandSize; + property TblStyleColBandSize read ReadXmlChildTblStyleColBandSize; function ReadXmlChildJc(); + function ReadXmlChildShd(); function ReadXmlChildTblStyle(); function ReadXmlChildTblW(); function ReadXmlChildTblInd(); @@ -29,12 +32,16 @@ public function ReadXmlChildTblLook(); function ReadXmlChildTblBorders(); function ReadXmlChildTblCellMar(); + function ReadXmlChildTblCellSpacing(); + function ReadXmlChildTblCaption(); + function ReadXmlChildTblDescription(); + function ReadXmlChildTblStyleRowBandSize(); + function ReadXmlChildTblStyleColBandSize(); public // Children - XmlChildTblStyleRowBandSize: PureWVal; - XmlChildTblStyleColBandSize: PureWVal; XmlChildJc: PureWVal; + XmlChildShd: Shd; XmlChildTblStyle: PureWVal; XmlChildTblW: TblW; XmlChildTblInd: TblW; @@ -42,6 +49,11 @@ public XmlChildTblLook: TblLook; XmlChildTblBorders: TblBorders; XmlChildTblCellMar: TblCellMar; + XmlChildTblCellSpacing: TblCellSpacing; + XmlChildTblCaption: PureWVal; + XmlChildTblDescription: PureWVal; + XmlChildTblStyleRowBandSize: PureWVal; + XmlChildTblStyleColBandSize: PureWVal; end; @@ -68,16 +80,20 @@ begin attributes_pf_ := array( ); sorted_child_ := array( - pre + "tblStyleRowBandSize": array(0, makeweakref(thisFunction(ReadXmlChildTblStyleRowBandSize))), - pre + "tblStyleColBandSize": array(1, makeweakref(thisFunction(ReadXmlChildTblStyleColBandSize))), - pre + "jc": array(2, makeweakref(thisFunction(ReadXmlChildJc))), - pre + "tblStyle": array(3, makeweakref(thisFunction(ReadXmlChildTblStyle))), - pre + "tblW": array(4, makeweakref(thisFunction(ReadXmlChildTblW))), - pre + "tblInd": array(5, makeweakref(thisFunction(ReadXmlChildTblInd))), - pre + "tblLayout": array(6, makeweakref(thisFunction(ReadXmlChildTblLayout))), - pre + "tblLook": array(7, makeweakref(thisFunction(ReadXmlChildTblLook))), - pre + "tblBorders": array(8, makeweakref(thisFunction(ReadXmlChildTblBorders))), - pre + "tblCellMar": array(9, makeweakref(thisFunction(ReadXmlChildTblCellMar))), + pre + "jc": array(0, makeweakref(thisFunction(ReadXmlChildJc))), + pre + "shd": array(1, makeweakref(thisFunction(ReadXmlChildShd))), + pre + "tblStyle": array(2, makeweakref(thisFunction(ReadXmlChildTblStyle))), + pre + "tblW": array(3, makeweakref(thisFunction(ReadXmlChildTblW))), + pre + "tblInd": array(4, makeweakref(thisFunction(ReadXmlChildTblInd))), + pre + "tblLayout": array(5, makeweakref(thisFunction(ReadXmlChildTblLayout))), + pre + "tblLook": array(6, makeweakref(thisFunction(ReadXmlChildTblLook))), + pre + "tblBorders": array(7, makeweakref(thisFunction(ReadXmlChildTblBorders))), + pre + "tblCellMar": array(8, makeweakref(thisFunction(ReadXmlChildTblCellMar))), + pre + "tblCellSpacing": array(9, makeweakref(thisFunction(ReadXmlChildTblCellSpacing))), + pre + "tblCaption": array(10, makeweakref(thisFunction(ReadXmlChildTblCaption))), + pre + "tblDescription": array(11, makeweakref(thisFunction(ReadXmlChildTblDescription))), + pre + "tblStyleRowBandSize": array(12, makeweakref(thisFunction(ReadXmlChildTblStyleRowBandSize))), + pre + "tblStyleColBandSize": array(13, makeweakref(thisFunction(ReadXmlChildTblStyleColBandSize))), ); container_ := new TSOfficeContainer(sorted_child_); end; @@ -87,12 +103,10 @@ begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); - if not ifnil(_obj.XmlChildTblStyleRowBandSize) then - {self.}TblStyleRowBandSize.Copy(_obj.XmlChildTblStyleRowBandSize); - if not ifnil(_obj.XmlChildTblStyleColBandSize) then - {self.}TblStyleColBandSize.Copy(_obj.XmlChildTblStyleColBandSize); if not ifnil(_obj.XmlChildJc) then {self.}Jc.Copy(_obj.XmlChildJc); + if not ifnil(_obj.XmlChildShd) then + {self.}Shd.Copy(_obj.XmlChildShd); if not ifnil(_obj.XmlChildTblStyle) then {self.}TblStyle.Copy(_obj.XmlChildTblStyle); if not ifnil(_obj.XmlChildTblW) then @@ -107,29 +121,19 @@ begin {self.}TblBorders.Copy(_obj.XmlChildTblBorders); if not ifnil(_obj.XmlChildTblCellMar) then {self.}TblCellMar.Copy(_obj.XmlChildTblCellMar); + if not ifnil(_obj.XmlChildTblCellSpacing) then + {self.}TblCellSpacing.Copy(_obj.XmlChildTblCellSpacing); + if not ifnil(_obj.XmlChildTblCaption) then + {self.}TblCaption.Copy(_obj.XmlChildTblCaption); + if not ifnil(_obj.XmlChildTblDescription) then + {self.}TblDescription.Copy(_obj.XmlChildTblDescription); + if not ifnil(_obj.XmlChildTblStyleRowBandSize) then + {self.}TblStyleRowBandSize.Copy(_obj.XmlChildTblStyleRowBandSize); + if not ifnil(_obj.XmlChildTblStyleColBandSize) then + {self.}TblStyleColBandSize.Copy(_obj.XmlChildTblStyleColBandSize); tslassigning := tslassigning_backup; end; -function TblPr.ReadXmlChildTblStyleRowBandSize(); -begin - if tslassigning and ifnil({self.}XmlChildTblStyleRowBandSize) then - begin - {self.}XmlChildTblStyleRowBandSize := new PureWVal(self, {self.}Prefix, "tblStyleRowBandSize"); - container_.Set({self.}XmlChildTblStyleRowBandSize); - end - return {self.}XmlChildTblStyleRowBandSize; -end; - -function TblPr.ReadXmlChildTblStyleColBandSize(); -begin - if tslassigning and ifnil({self.}XmlChildTblStyleColBandSize) then - begin - {self.}XmlChildTblStyleColBandSize := new PureWVal(self, {self.}Prefix, "tblStyleColBandSize"); - container_.Set({self.}XmlChildTblStyleColBandSize); - end - return {self.}XmlChildTblStyleColBandSize; -end; - function TblPr.ReadXmlChildJc(); begin if tslassigning and ifnil({self.}XmlChildJc) then @@ -140,6 +144,16 @@ begin return {self.}XmlChildJc; end; +function TblPr.ReadXmlChildShd(); +begin + if tslassigning and ifnil({self.}XmlChildShd) then + begin + {self.}XmlChildShd := new Shd(self, {self.}Prefix, "shd"); + container_.Set({self.}XmlChildShd); + end + return {self.}XmlChildShd; +end; + function TblPr.ReadXmlChildTblStyle(); begin if tslassigning and ifnil({self.}XmlChildTblStyle) then @@ -209,3 +223,53 @@ begin end return {self.}XmlChildTblCellMar; end; + +function TblPr.ReadXmlChildTblCellSpacing(); +begin + if tslassigning and ifnil({self.}XmlChildTblCellSpacing) then + begin + {self.}XmlChildTblCellSpacing := new TblCellSpacing(self, {self.}Prefix, "tblCellSpacing"); + container_.Set({self.}XmlChildTblCellSpacing); + end + return {self.}XmlChildTblCellSpacing; +end; + +function TblPr.ReadXmlChildTblCaption(); +begin + if tslassigning and ifnil({self.}XmlChildTblCaption) then + begin + {self.}XmlChildTblCaption := new PureWVal(self, {self.}Prefix, "tblCaption"); + container_.Set({self.}XmlChildTblCaption); + end + return {self.}XmlChildTblCaption; +end; + +function TblPr.ReadXmlChildTblDescription(); +begin + if tslassigning and ifnil({self.}XmlChildTblDescription) then + begin + {self.}XmlChildTblDescription := new PureWVal(self, {self.}Prefix, "tblDescription"); + container_.Set({self.}XmlChildTblDescription); + end + return {self.}XmlChildTblDescription; +end; + +function TblPr.ReadXmlChildTblStyleRowBandSize(); +begin + if tslassigning and ifnil({self.}XmlChildTblStyleRowBandSize) then + begin + {self.}XmlChildTblStyleRowBandSize := new PureWVal(self, {self.}Prefix, "tblStyleRowBandSize"); + container_.Set({self.}XmlChildTblStyleRowBandSize); + end + return {self.}XmlChildTblStyleRowBandSize; +end; + +function TblPr.ReadXmlChildTblStyleColBandSize(); +begin + if tslassigning and ifnil({self.}XmlChildTblStyleColBandSize) then + begin + {self.}XmlChildTblStyleColBandSize := new PureWVal(self, {self.}Prefix, "tblStyleColBandSize"); + container_.Set({self.}XmlChildTblStyleColBandSize); + end + return {self.}XmlChildTblStyleColBandSize; +end; diff --git a/autoclass/docx/TcBorder@DOCX.tsf b/autoclass/docx/TcBorder@DOCX.tsf new file mode 100644 index 0000000..4bf38eb --- /dev/null +++ b/autoclass/docx/TcBorder@DOCX.tsf @@ -0,0 +1,184 @@ +type TcBorder = 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: TcBorder);override; + +public + + // attributes property + property Val read ReadXmlAttrVal write WriteXmlAttrVal; + property Color read ReadXmlAttrColor write WriteXmlAttrColor; + property Space read ReadXmlAttrSpace write WriteXmlAttrSpace; + property ThemeColor read ReadXmlAttrThemeColor write WriteXmlAttrThemeColor; + property ThemeTint read ReadXmlAttrThemeTint write WriteXmlAttrThemeTint; + property Sz read ReadXmlAttrSz write WriteXmlAttrSz; + function ReadXmlAttrVal(); + function WriteXmlAttrVal(_value); + function ReadXmlAttrColor(); + function WriteXmlAttrColor(_value); + function ReadXmlAttrSpace(); + function WriteXmlAttrSpace(_value); + function ReadXmlAttrThemeColor(); + function WriteXmlAttrThemeColor(_value); + function ReadXmlAttrThemeTint(); + function WriteXmlAttrThemeTint(_value); + function ReadXmlAttrSz(); + function WriteXmlAttrSz(_value); + +public + // Attributes + XmlAttrVal: OpenXmlAttribute; + XmlAttrColor: OpenXmlAttribute; + XmlAttrSpace: OpenXmlAttribute; + XmlAttrThemeColor: OpenXmlAttribute; + XmlAttrThemeTint: OpenXmlAttribute; + XmlAttrSz: OpenXmlAttribute; + + +end; + +function TcBorder.Create();overload; +begin + {self.}Create(nil, "w", ""); +end; + +function TcBorder.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function TcBorder.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 TcBorder.Init();override; +begin + pre := {self.}Prefix ? {self.}Prefix + ":" : ""; + attributes_ := array(); + attributes_pf_ := array( + pre + "val": makeweakref(thisFunction(WriteXmlAttrVal)), + pre + "color": makeweakref(thisFunction(WriteXmlAttrColor)), + pre + "space": makeweakref(thisFunction(WriteXmlAttrSpace)), + pre + "themeColor": makeweakref(thisFunction(WriteXmlAttrThemeColor)), + pre + "themeTint": makeweakref(thisFunction(WriteXmlAttrThemeTint)), + pre + "sz": makeweakref(thisFunction(WriteXmlAttrSz)), + ); + sorted_child_ := array( + ); + container_ := new TSOfficeContainer(sorted_child_); +end; + +function TcBorder.Copy(_obj: TcBorder);override; +begin + tslassigning_backup := tslassigning; + tslassigning := 1; + class(OpenXmlElement).Copy(_obj); + if not ifnil(_obj.Val) then + {self.}Val := _obj.Val; + if not ifnil(_obj.Color) then + {self.}Color := _obj.Color; + if not ifnil(_obj.Space) then + {self.}Space := _obj.Space; + if not ifnil(_obj.ThemeColor) then + {self.}ThemeColor := _obj.ThemeColor; + if not ifnil(_obj.ThemeTint) then + {self.}ThemeTint := _obj.ThemeTint; + if not ifnil(_obj.Sz) then + {self.}Sz := _obj.Sz; + tslassigning := tslassigning_backup; +end; + +function TcBorder.ReadXmlAttrVal(); +begin + return {self.}XmlAttrVal.Value; +end; + +function TcBorder.WriteXmlAttrVal(_value); +begin + if ifnil({self.}XmlAttrVal) then + begin + {self.}XmlAttrVal := new OpenXmlAttribute({self.}Prefix, "val", nil); + attributes_[length(attributes_)] := {self.}XmlAttrVal; + end + {self.}XmlAttrVal.Value := _value; +end; + +function TcBorder.ReadXmlAttrColor(); +begin + return {self.}XmlAttrColor.Value; +end; + +function TcBorder.WriteXmlAttrColor(_value); +begin + if ifnil({self.}XmlAttrColor) then + begin + {self.}XmlAttrColor := new OpenXmlAttribute({self.}Prefix, "color", nil); + attributes_[length(attributes_)] := {self.}XmlAttrColor; + end + {self.}XmlAttrColor.Value := _value; +end; + +function TcBorder.ReadXmlAttrSpace(); +begin + return {self.}XmlAttrSpace.Value; +end; + +function TcBorder.WriteXmlAttrSpace(_value); +begin + if ifnil({self.}XmlAttrSpace) then + begin + {self.}XmlAttrSpace := new OpenXmlAttribute({self.}Prefix, "space", nil); + attributes_[length(attributes_)] := {self.}XmlAttrSpace; + end + {self.}XmlAttrSpace.Value := _value; +end; + +function TcBorder.ReadXmlAttrThemeColor(); +begin + return {self.}XmlAttrThemeColor.Value; +end; + +function TcBorder.WriteXmlAttrThemeColor(_value); +begin + if ifnil({self.}XmlAttrThemeColor) then + begin + {self.}XmlAttrThemeColor := new OpenXmlAttribute({self.}Prefix, "themeColor", nil); + attributes_[length(attributes_)] := {self.}XmlAttrThemeColor; + end + {self.}XmlAttrThemeColor.Value := _value; +end; + +function TcBorder.ReadXmlAttrThemeTint(); +begin + return {self.}XmlAttrThemeTint.Value; +end; + +function TcBorder.WriteXmlAttrThemeTint(_value); +begin + if ifnil({self.}XmlAttrThemeTint) then + begin + {self.}XmlAttrThemeTint := new OpenXmlAttribute({self.}Prefix, "themeTint", nil); + attributes_[length(attributes_)] := {self.}XmlAttrThemeTint; + end + {self.}XmlAttrThemeTint.Value := _value; +end; + +function TcBorder.ReadXmlAttrSz(); +begin + return {self.}XmlAttrSz.Value; +end; + +function TcBorder.WriteXmlAttrSz(_value); +begin + if ifnil({self.}XmlAttrSz) then + begin + {self.}XmlAttrSz := new OpenXmlAttribute({self.}Prefix, "sz", nil); + attributes_[length(attributes_)] := {self.}XmlAttrSz; + end + {self.}XmlAttrSz.Value := _value; +end; diff --git a/autoclass/docx/TcBorders@DOCX.tsf b/autoclass/docx/TcBorders@DOCX.tsf new file mode 100644 index 0000000..4c283bb --- /dev/null +++ b/autoclass/docx/TcBorders@DOCX.tsf @@ -0,0 +1,179 @@ +type TcBorders = 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: TcBorders);override; + +public + + // normal property + property Top read ReadXmlChildTop; + property Left read ReadXmlChildLeft; + property Bottom read ReadXmlChildBottom; + property Right read ReadXmlChildRight; + property Tl2Br read ReadXmlChildTl2Br; + property Tr2Bl read ReadXmlChildTr2Bl; + property InsideH read ReadXmlChildInsideH; + property InsideV read ReadXmlChildInsideV; + function ReadXmlChildTop(); + function ReadXmlChildLeft(); + function ReadXmlChildBottom(); + function ReadXmlChildRight(); + function ReadXmlChildTl2Br(); + function ReadXmlChildTr2Bl(); + function ReadXmlChildInsideH(); + function ReadXmlChildInsideV(); + +public + // Children + XmlChildTop: TcBorder; + XmlChildLeft: TcBorder; + XmlChildBottom: TcBorder; + XmlChildRight: TcBorder; + XmlChildTl2Br: TcBorder; + XmlChildTr2Bl: TcBorder; + XmlChildInsideH: TcBorder; + XmlChildInsideV: TcBorder; + +end; + +function TcBorders.Create();overload; +begin + {self.}Create(nil, "w", "tcBorders"); +end; + +function TcBorders.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function TcBorders.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 TcBorders.Init();override; +begin + pre := {self.}Prefix ? {self.}Prefix + ":" : ""; + attributes_ := array(); + attributes_pf_ := array( + ); + sorted_child_ := array( + pre + "top": array(0, makeweakref(thisFunction(ReadXmlChildTop))), + pre + "left": array(1, makeweakref(thisFunction(ReadXmlChildLeft))), + pre + "bottom": array(2, makeweakref(thisFunction(ReadXmlChildBottom))), + pre + "right": array(3, makeweakref(thisFunction(ReadXmlChildRight))), + pre + "tl2br": array(4, makeweakref(thisFunction(ReadXmlChildTl2Br))), + pre + "tr2bl": array(5, makeweakref(thisFunction(ReadXmlChildTr2Bl))), + pre + "insideH": array(6, makeweakref(thisFunction(ReadXmlChildInsideH))), + pre + "insideV": array(7, makeweakref(thisFunction(ReadXmlChildInsideV))), + ); + container_ := new TSOfficeContainer(sorted_child_); +end; + +function TcBorders.Copy(_obj: TcBorders);override; +begin + tslassigning_backup := tslassigning; + tslassigning := 1; + class(OpenXmlElement).Copy(_obj); + if not ifnil(_obj.XmlChildTop) then + {self.}Top.Copy(_obj.XmlChildTop); + if not ifnil(_obj.XmlChildLeft) then + {self.}Left.Copy(_obj.XmlChildLeft); + if not ifnil(_obj.XmlChildBottom) then + {self.}Bottom.Copy(_obj.XmlChildBottom); + if not ifnil(_obj.XmlChildRight) then + {self.}Right.Copy(_obj.XmlChildRight); + if not ifnil(_obj.XmlChildTl2Br) then + {self.}Tl2Br.Copy(_obj.XmlChildTl2Br); + if not ifnil(_obj.XmlChildTr2Bl) then + {self.}Tr2Bl.Copy(_obj.XmlChildTr2Bl); + if not ifnil(_obj.XmlChildInsideH) then + {self.}InsideH.Copy(_obj.XmlChildInsideH); + if not ifnil(_obj.XmlChildInsideV) then + {self.}InsideV.Copy(_obj.XmlChildInsideV); + tslassigning := tslassigning_backup; +end; + +function TcBorders.ReadXmlChildTop(); +begin + if tslassigning and ifnil({self.}XmlChildTop) then + begin + {self.}XmlChildTop := new TcBorder(self, {self.}Prefix, "top"); + container_.Set({self.}XmlChildTop); + end + return {self.}XmlChildTop; +end; + +function TcBorders.ReadXmlChildLeft(); +begin + if tslassigning and ifnil({self.}XmlChildLeft) then + begin + {self.}XmlChildLeft := new TcBorder(self, {self.}Prefix, "left"); + container_.Set({self.}XmlChildLeft); + end + return {self.}XmlChildLeft; +end; + +function TcBorders.ReadXmlChildBottom(); +begin + if tslassigning and ifnil({self.}XmlChildBottom) then + begin + {self.}XmlChildBottom := new TcBorder(self, {self.}Prefix, "bottom"); + container_.Set({self.}XmlChildBottom); + end + return {self.}XmlChildBottom; +end; + +function TcBorders.ReadXmlChildRight(); +begin + if tslassigning and ifnil({self.}XmlChildRight) then + begin + {self.}XmlChildRight := new TcBorder(self, {self.}Prefix, "right"); + container_.Set({self.}XmlChildRight); + end + return {self.}XmlChildRight; +end; + +function TcBorders.ReadXmlChildTl2Br(); +begin + if tslassigning and ifnil({self.}XmlChildTl2Br) then + begin + {self.}XmlChildTl2Br := new TcBorder(self, {self.}Prefix, "tl2br"); + container_.Set({self.}XmlChildTl2Br); + end + return {self.}XmlChildTl2Br; +end; + +function TcBorders.ReadXmlChildTr2Bl(); +begin + if tslassigning and ifnil({self.}XmlChildTr2Bl) then + begin + {self.}XmlChildTr2Bl := new TcBorder(self, {self.}Prefix, "tr2bl"); + container_.Set({self.}XmlChildTr2Bl); + end + return {self.}XmlChildTr2Bl; +end; + +function TcBorders.ReadXmlChildInsideH(); +begin + if tslassigning and ifnil({self.}XmlChildInsideH) then + begin + {self.}XmlChildInsideH := new TcBorder(self, {self.}Prefix, "insideH"); + container_.Set({self.}XmlChildInsideH); + end + return {self.}XmlChildInsideH; +end; + +function TcBorders.ReadXmlChildInsideV(); +begin + if tslassigning and ifnil({self.}XmlChildInsideV) then + begin + {self.}XmlChildInsideV := new TcBorder(self, {self.}Prefix, "insideV"); + container_.Set({self.}XmlChildInsideV); + end + return {self.}XmlChildInsideV; +end; diff --git a/autoclass/docx/TcPr@DOCX.tsf b/autoclass/docx/TcPr@DOCX.tsf index 2584c37..31991ea 100644 --- a/autoclass/docx/TcPr@DOCX.tsf +++ b/autoclass/docx/TcPr@DOCX.tsf @@ -21,10 +21,12 @@ public property GridSpan read ReadXmlChildGridSpan; property VAlign read ReadXmlChildVAlign; property Shd read ReadXmlChildShd; + property TcBorders read ReadXmlChildTcBorders; function ReadXmlChildTcW(); function ReadXmlChildGridSpan(); function ReadXmlChildVAlign(); function ReadXmlChildShd(); + function ReadXmlChildTcBorders(); public // Children @@ -34,6 +36,7 @@ public XmlChildVAlign: PureWVal; XmlChildHideMark: OpenXmlEmpty; XmlChildShd: Shd; + XmlChildTcBorders: TcBorders; end; @@ -66,6 +69,7 @@ begin pre + "vAlign": array(3, makeweakref(thisFunction(ReadXmlChildVAlign))), pre + "hideMark": array(4, makeweakref(thisFunction(ReadXmlChildHideMark))), pre + "shd": array(5, makeweakref(thisFunction(ReadXmlChildShd))), + pre + "tcBorders": array(6, makeweakref(thisFunction(ReadXmlChildTcBorders))), ); container_ := new TSOfficeContainer(sorted_child_); end; @@ -87,6 +91,8 @@ begin ifnil({self.}XmlChildHideMark) ? {self.}HideMark.Copy(_obj.XmlChildHideMark) : {self.}XmlChildHideMark.Copy(_obj.XmlChildHideMark); if not ifnil(_obj.XmlChildShd) then {self.}Shd.Copy(_obj.XmlChildShd); + if not ifnil(_obj.XmlChildTcBorders) then + {self.}TcBorders.Copy(_obj.XmlChildTcBorders); tslassigning := tslassigning_backup; end; @@ -171,3 +177,13 @@ begin end return {self.}XmlChildShd; end; + +function TcPr.ReadXmlChildTcBorders(); +begin + if tslassigning and ifnil({self.}XmlChildTcBorders) then + begin + {self.}XmlChildTcBorders := new TcBorders(self, {self.}Prefix, "tcBorders"); + container_.Set({self.}XmlChildTcBorders); + end + return {self.}XmlChildTcBorders; +end; diff --git a/autoclass/docx/TrHeight@DOCX.tsf b/autoclass/docx/TrHeight@DOCX.tsf index 2dec54e..c06aa08 100644 --- a/autoclass/docx/TrHeight@DOCX.tsf +++ b/autoclass/docx/TrHeight@DOCX.tsf @@ -9,12 +9,16 @@ public public // attributes property + property HRule read ReadXmlAttrHRule write WriteXmlAttrHRule; property val read ReadXmlAttrval write WriteXmlAttrval; + function ReadXmlAttrHRule(); + function WriteXmlAttrHRule(_value); function ReadXmlAttrval(); function WriteXmlAttrval(_value); public // Attributes + XmlAttrHRule: OpenXmlAttribute; XmlAttrval: OpenXmlAttribute; @@ -41,6 +45,7 @@ begin pre := {self.}Prefix ? {self.}Prefix + ":" : ""; attributes_ := array(); attributes_pf_ := array( + pre + "hRule": makeweakref(thisFunction(WriteXmlAttrHRule)), pre + "val": makeweakref(thisFunction(WriteXmlAttrval)), ); sorted_child_ := array( @@ -53,11 +58,28 @@ begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); + if not ifnil(_obj.HRule) then + {self.}HRule := _obj.HRule; if not ifnil(_obj.val) then {self.}val := _obj.val; tslassigning := tslassigning_backup; end; +function TrHeight.ReadXmlAttrHRule(); +begin + return {self.}XmlAttrHRule.Value; +end; + +function TrHeight.WriteXmlAttrHRule(_value); +begin + if ifnil({self.}XmlAttrHRule) then + begin + {self.}XmlAttrHRule := new OpenXmlAttribute({self.}Prefix, "hRule", nil); + attributes_[length(attributes_)] := {self.}XmlAttrHRule; + end + {self.}XmlAttrHRule.Value := _value; +end; + function TrHeight.ReadXmlAttrval(); begin return {self.}XmlAttrval.Value; diff --git a/utils/TSSafeUnitConverter.tsf b/utils/TSSafeUnitConverter.tsf index 29debfe..2fea145 100644 --- a/utils/TSSafeUnitConverter.tsf +++ b/utils/TSSafeUnitConverter.tsf @@ -5,6 +5,7 @@ interface function HalfPointToPoints(value): real; function PercentToNumber(value): real; function ToInt(value): integer; + function EighthPointToPoints(value): real; implementation @@ -44,5 +45,12 @@ uses TSUnitConverter; return tryStrtoInt(value, r) ? r : 0; end; + function EighthPointToPoints(value): real; + begin + if ifNil(value) then return 0; + new_value := ifString(value) ? strToFloat(value) : value; + return TSUnitConverter.EighthPointToPoints(new_value); + end; + end. diff --git a/utils/TSUnitConverter.tsf b/utils/TSUnitConverter.tsf index bee8eae..32d350d 100644 --- a/utils/TSUnitConverter.tsf +++ b/utils/TSUnitConverter.tsf @@ -3,6 +3,7 @@ interface function TwipsToPoints(value: real): real; function EmusToPoints(value: real): real; function HalfPointToPoints(value: real): real; + function EighthPointToPoints(value: real): real; function PercentToNumber(value: real): real; implementation @@ -25,7 +26,12 @@ implementation function PercentToNumber(value: real): real; begin return value / 100; - end + end; + + function EighthPointToPoints(value: real): real; + begin + return value / 8; + end; end.