diff --git a/autoclass/decorator/docx/AbstractNumUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/AbstractNumUnitDecorator@DOCX.tsf index 30f2127..e124285 100644 --- a/autoclass/decorator/docx/AbstractNumUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/AbstractNumUnitDecorator@DOCX.tsf @@ -34,5 +34,8 @@ begin {self.}XmlChildMultiLevelType := new PureWValUnitDecorator(object_.XmlChildMultiLevelType); if not ifnil(object_.XmlChildTmpl) then {self.}XmlChildTmpl := new PureWValUnitDecorator(object_.XmlChildTmpl); + elems := object_.Lvls(); + for _,elem in elems do + {self.}AppendChild(new LvlUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/ApUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/ApUnitDecorator@DOCX.tsf index 0e3efe0..830ec70 100644 --- a/autoclass/decorator/docx/ApUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/ApUnitDecorator@DOCX.tsf @@ -28,5 +28,8 @@ begin {self.}XmlChildPPr := new APPrUnitDecorator(object_.XmlChildPPr); if not ifnil(object_.XmlChildEndParaRPr) then {self.}XmlChildEndParaRPr := new ARPrUnitDecorator(object_.XmlChildEndParaRPr); + elems := object_.Rs(); + for _,elem in elems do + {self.}AppendChild(new ARUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/BarChartUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/BarChartUnitDecorator@DOCX.tsf index 8d7f9ef..1560979 100644 --- a/autoclass/decorator/docx/BarChartUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/BarChartUnitDecorator@DOCX.tsf @@ -30,7 +30,13 @@ begin {self.}XmlChildGrouping := new PureValUnitDecorator(object_.XmlChildGrouping); if not ifnil(object_.XmlChildVaryColors) then {self.}XmlChildVaryColors := new PureValUnitDecorator(object_.XmlChildVaryColors); + elems := object_.Sers(); + for _,elem in elems do + {self.}AppendChild(new SerUnitDecorator(elem)); if not ifnil(object_.XmlChildGapWidth) then {self.}XmlChildGapWidth := new PureValUnitDecorator(object_.XmlChildGapWidth); + elems := object_.AxIds(); + for _,elem in elems do + {self.}AppendChild(new PureValUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/BodyUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/BodyUnitDecorator@DOCX.tsf index f461bd4..7fb8fe1 100644 --- a/autoclass/decorator/docx/BodyUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/BodyUnitDecorator@DOCX.tsf @@ -24,6 +24,15 @@ function BodyUnitDecorator.Convert(); begin tslassigning_backup := tslassigning; tslassigning := 1; + elems := object_.Ps(); + for _,elem in elems do + {self.}AppendChild(new PUnitDecorator(elem)); + elems := object_.Tbls(); + for _,elem in elems do + {self.}AppendChild(new TblUnitDecorator(elem)); + elems := object_.Sdts(); + for _,elem in elems do + {self.}AppendChild(new SdtUnitDecorator(elem)); if not ifnil(object_.XmlChildSectPr) then {self.}XmlChildSectPr := new SectPrUnitDecorator(object_.XmlChildSectPr); tslassigning := tslassigning_backup; diff --git a/autoclass/decorator/docx/CacheUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/CacheUnitDecorator@DOCX.tsf index 5973fca..456023b 100644 --- a/autoclass/decorator/docx/CacheUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/CacheUnitDecorator@DOCX.tsf @@ -27,5 +27,8 @@ begin if not ifnil(object_.XmlChildFormatCode) then if not ifnil(object_.XmlChildPtCount) then {self.}XmlChildPtCount := new PureValUnitDecorator(object_.XmlChildPtCount); + elems := object_.Pts(); + for _,elem in elems do + {self.}AppendChild(new PtUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/ColUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/ColUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..94ebf30 --- /dev/null +++ b/autoclass/decorator/docx/ColUnitDecorator@DOCX.tsf @@ -0,0 +1,32 @@ +type ColUnitDecorator = class(Col) +uses TSSafeUnitConverter; +public + function Create(_obj: Col); + function GetObject(); + function Convert(); +private + object_: Col; +end; + +function ColUnitDecorator.Create(_obj: Col); +begin + class(Col).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function ColUnitDecorator.GetObject(); +begin + return object_; +end; + +function ColUnitDecorator.Convert(); +begin + tslassigning_backup := tslassigning; + tslassigning := 1; + if not ifnil(object_.XmlAttrW) then + {self.}W := TSSafeUnitConverter.TwipsToPoints(object_.XmlAttrW.Value); + if not ifnil(object_.XmlAttrSpace) then + {self.}Space := TSSafeUnitConverter.TwipsToPoints(object_.XmlAttrSpace.Value); + tslassigning := tslassigning_backup; +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/ColsUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/ColsUnitDecorator@DOCX.tsf index b2c4477..1ab8b27 100644 --- a/autoclass/decorator/docx/ColsUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/ColsUnitDecorator@DOCX.tsf @@ -24,7 +24,14 @@ function ColsUnitDecorator.Convert(); begin tslassigning_backup := tslassigning; tslassigning := 1; + if not ifnil(object_.XmlAttrNum) then + {self.}Num := TSSafeUnitConverter.ToInt(object_.XmlAttrNum.Value); if not ifnil(object_.XmlAttrSpace) then {self.}Space := TSSafeUnitConverter.TwipsToPoints(object_.XmlAttrSpace.Value); + if not ifnil(object_.XmlAttrEqualWidth) then + {self.}EqualWidth := object_.XmlAttrEqualWidth.Value; + elems := object_.Cols(); + for _,elem in elems do + {self.}AppendChild(new ColUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/CommentUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/CommentUnitDecorator@DOCX.tsf index db8019b..68028d4 100644 --- a/autoclass/decorator/docx/CommentUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/CommentUnitDecorator@DOCX.tsf @@ -30,5 +30,8 @@ begin {self.}Date := object_.XmlAttrDate.Value; if not ifnil(object_.XmlAttrId) then {self.}Id := object_.XmlAttrId.Value; + elems := object_.Ps(); + for _,elem in elems do + {self.}AppendChild(new PUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/CommentsUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/CommentsUnitDecorator@DOCX.tsf index 2292574..8d7e8df 100644 --- a/autoclass/decorator/docx/CommentsUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/CommentsUnitDecorator@DOCX.tsf @@ -60,5 +60,8 @@ begin {self.}XmlnsWpsCustomData := object_.XmlAttrXmlnsWpsCustomData.Value; if not ifnil(object_.XmlAttrMcIgnorable) then {self.}McIgnorable := object_.XmlAttrMcIgnorable.Value; + elems := object_.Comments(); + for _,elem in elems do + {self.}AppendChild(new CommentUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/CompatUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/CompatUnitDecorator@DOCX.tsf index 0ac8275..40de558 100644 --- a/autoclass/decorator/docx/CompatUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/CompatUnitDecorator@DOCX.tsf @@ -38,5 +38,8 @@ begin {self.}AdjustLineHeightInTable.Copy(object_.XmlChildAdjustLineHeightInTable); if not ifnil(object_.XmlChildUseFELayout) then {self.}UseFELayout.Copy(object_.XmlChildUseFELayout); + elems := object_.CompatSettings(); + for _,elem in elems do + {self.}AppendChild(new CompatSettingUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/EffectStyleLstUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/EffectStyleLstUnitDecorator@DOCX.tsf index b8f09da..d17c6f7 100644 --- a/autoclass/decorator/docx/EffectStyleLstUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/EffectStyleLstUnitDecorator@DOCX.tsf @@ -24,5 +24,8 @@ function EffectStyleLstUnitDecorator.Convert(); begin tslassigning_backup := tslassigning; tslassigning := 1; + elems := object_.EffectStyles(); + for _,elem in elems do + {self.}AppendChild(new EffectStyleUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/EndnotePrUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/EndnotePrUnitDecorator@DOCX.tsf index d9515e7..124cd0e 100644 --- a/autoclass/decorator/docx/EndnotePrUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/EndnotePrUnitDecorator@DOCX.tsf @@ -24,5 +24,14 @@ function EndnotePrUnitDecorator.Convert(); begin tslassigning_backup := tslassigning; tslassigning := 1; + if not ifnil(object_.XmlChildPos) then + {self.}XmlChildPos := new PureWValUnitDecorator(object_.XmlChildPos); + if not ifnil(object_.XmlChildNumFmt) then + {self.}XmlChildNumFmt := new PureWValUnitDecorator(object_.XmlChildNumFmt); + if not ifnil(object_.XmlChildNumStart) then + {self.}XmlChildNumStart := new PureWValUnitDecorator(object_.XmlChildNumStart); + elems := object_.Endnotes(); + for _,elem in elems do + {self.}AppendChild(new EndnoteUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/EndnoteUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/EndnoteUnitDecorator@DOCX.tsf index 1128446..1ad85dd 100644 --- a/autoclass/decorator/docx/EndnoteUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/EndnoteUnitDecorator@DOCX.tsf @@ -28,5 +28,8 @@ begin {self.}Type := object_.XmlAttrType.Value; if not ifnil(object_.XmlAttrId) then {self.}Id := object_.XmlAttrId.Value; + elems := object_.Ps(); + for _,elem in elems do + {self.}AppendChild(new PUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/EndnotesUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/EndnotesUnitDecorator@DOCX.tsf index 75485ed..40be7a6 100644 --- a/autoclass/decorator/docx/EndnotesUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/EndnotesUnitDecorator@DOCX.tsf @@ -90,5 +90,8 @@ begin {self.}XmlnsWps := object_.XmlAttrXmlnsWps.Value; if not ifnil(object_.XmlAttrMcIgnorable) then {self.}McIgnorable := object_.XmlAttrMcIgnorable.Value; + elems := object_.Endnotes(); + for _,elem in elems do + {self.}AppendChild(new EndnoteUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/ExtLstUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/ExtLstUnitDecorator@DOCX.tsf index e566a1f..540e436 100644 --- a/autoclass/decorator/docx/ExtLstUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/ExtLstUnitDecorator@DOCX.tsf @@ -24,5 +24,8 @@ function ExtLstUnitDecorator.Convert(); begin tslassigning_backup := tslassigning; tslassigning := 1; + elems := object_.Exts(); + for _,elem in elems do + {self.}AppendChild(new ExtUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/FillStyleLstUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/FillStyleLstUnitDecorator@DOCX.tsf index 73e0c9c..203cf1d 100644 --- a/autoclass/decorator/docx/FillStyleLstUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/FillStyleLstUnitDecorator@DOCX.tsf @@ -24,5 +24,11 @@ function FillStyleLstUnitDecorator.Convert(); begin tslassigning_backup := tslassigning; tslassigning := 1; + elems := object_.SolidFills(); + for _,elem in elems do + {self.}AppendChild(new SolidFillUnitDecorator(elem)); + elems := object_.GradFills(); + for _,elem in elems do + {self.}AppendChild(new GradFillUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/FldSimpleUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/FldSimpleUnitDecorator@DOCX.tsf index 34e7321..2dbb692 100644 --- a/autoclass/decorator/docx/FldSimpleUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/FldSimpleUnitDecorator@DOCX.tsf @@ -26,5 +26,8 @@ begin tslassigning := 1; if not ifnil(object_.XmlAttrInstr) then {self.}Instr := object_.XmlAttrInstr.Value; + elems := object_.Rs(); + for _,elem in elems do + {self.}AppendChild(new RUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/FontsUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/FontsUnitDecorator@DOCX.tsf index aa0fd2e..bb70423 100644 --- a/autoclass/decorator/docx/FontsUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/FontsUnitDecorator@DOCX.tsf @@ -48,5 +48,8 @@ begin {self.}XmlnsW16se := object_.XmlAttrXmlnsW16se.Value; if not ifnil(object_.XmlAttrMcIgnorable) then {self.}McIgnorable := object_.XmlAttrMcIgnorable.Value; + elems := object_.Fonts(); + for _,elem in elems do + {self.}AppendChild(new FontUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/FootnotePrUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/FootnotePrUnitDecorator@DOCX.tsf index e2f7980..bfa4de2 100644 --- a/autoclass/decorator/docx/FootnotePrUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/FootnotePrUnitDecorator@DOCX.tsf @@ -30,5 +30,8 @@ begin {self.}XmlChildNumFmt := new PureWValUnitDecorator(object_.XmlChildNumFmt); if not ifnil(object_.XmlChildNumStart) then {self.}XmlChildNumStart := new PureWValUnitDecorator(object_.XmlChildNumStart); + elems := object_.Footnotes(); + for _,elem in elems do + {self.}AppendChild(new FootnoteUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/FootnoteUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/FootnoteUnitDecorator@DOCX.tsf index 8ec718f..8c1d38d 100644 --- a/autoclass/decorator/docx/FootnoteUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/FootnoteUnitDecorator@DOCX.tsf @@ -28,5 +28,8 @@ begin {self.}Type := object_.XmlAttrType.Value; if not ifnil(object_.XmlAttrId) then {self.}Id := object_.XmlAttrId.Value; + elems := object_.Ps(); + for _,elem in elems do + {self.}AppendChild(new PUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/FootnotesUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/FootnotesUnitDecorator@DOCX.tsf index f8588b2..f82c2b3 100644 --- a/autoclass/decorator/docx/FootnotesUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/FootnotesUnitDecorator@DOCX.tsf @@ -90,5 +90,8 @@ begin {self.}XmlnsWps := object_.XmlAttrXmlnsWps.Value; if not ifnil(object_.XmlAttrMcIgnorable) then {self.}McIgnorable := object_.XmlAttrMcIgnorable.Value; + elems := object_.Footnotes(); + for _,elem in elems do + {self.}AppendChild(new FootnoteUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/FormulasUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/FormulasUnitDecorator@DOCX.tsf index 0ef6961..d1490b8 100644 --- a/autoclass/decorator/docx/FormulasUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/FormulasUnitDecorator@DOCX.tsf @@ -24,5 +24,8 @@ function FormulasUnitDecorator.Convert(); begin tslassigning_backup := tslassigning; tslassigning := 1; + elems := object_.Fs(); + for _,elem in elems do + {self.}AppendChild(new ShapetypeUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/FtrUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/FtrUnitDecorator@DOCX.tsf index 64356c5..1aa79df 100644 --- a/autoclass/decorator/docx/FtrUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/FtrUnitDecorator@DOCX.tsf @@ -54,5 +54,8 @@ begin {self.}XmlnsWps := object_.XmlAttrXmlnsWps.Value; if not ifnil(object_.XmlAttrMcIgnorable) then {self.}McIgnorable := object_.XmlAttrMcIgnorable.Value; + elems := object_.Ps(); + for _,elem in elems do + {self.}AppendChild(new PUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/GsLstUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/GsLstUnitDecorator@DOCX.tsf index 32b4950..b4bdee9 100644 --- a/autoclass/decorator/docx/GsLstUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/GsLstUnitDecorator@DOCX.tsf @@ -24,5 +24,8 @@ function GsLstUnitDecorator.Convert(); begin tslassigning_backup := tslassigning; tslassigning := 1; + elems := object_.Gses(); + for _,elem in elems do + {self.}AppendChild(new GsUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/HdrUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/HdrUnitDecorator@DOCX.tsf index f820cc5..6bc9d3c 100644 --- a/autoclass/decorator/docx/HdrUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/HdrUnitDecorator@DOCX.tsf @@ -54,5 +54,8 @@ begin {self.}XmlnsWps := object_.XmlAttrXmlnsWps.Value; if not ifnil(object_.XmlAttrMcIgnorable) then {self.}McIgnorable := object_.XmlAttrMcIgnorable.Value; + elems := object_.Ps(); + for _,elem in elems do + {self.}AppendChild(new PUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/HyperLinkUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/HyperLinkUnitDecorator@DOCX.tsf index 5083cda..ac153ae 100644 --- a/autoclass/decorator/docx/HyperLinkUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/HyperLinkUnitDecorator@DOCX.tsf @@ -30,5 +30,8 @@ begin {self.}Id := object_.XmlAttrId.Value; if not ifnil(object_.XmlAttrHistory) then {self.}History := object_.XmlAttrHistory.Value; + elems := object_.Rs(); + for _,elem in elems do + {self.}AppendChild(new RUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/LatenStylesUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/LatenStylesUnitDecorator@DOCX.tsf index f9614d5..84986ce 100644 --- a/autoclass/decorator/docx/LatenStylesUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/LatenStylesUnitDecorator@DOCX.tsf @@ -36,5 +36,8 @@ begin {self.}DefQFormat := object_.XmlAttrDefQFormat.Value; if not ifnil(object_.XmlAttrCount) then {self.}Count := object_.XmlAttrCount.Value; + elems := object_.LsdExceptions(); + for _,elem in elems do + {self.}AppendChild(new LsdExceptionUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/LnStyleLstUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/LnStyleLstUnitDecorator@DOCX.tsf index f107131..427206a 100644 --- a/autoclass/decorator/docx/LnStyleLstUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/LnStyleLstUnitDecorator@DOCX.tsf @@ -24,5 +24,8 @@ function LnStyleLstUnitDecorator.Convert(); begin tslassigning_backup := tslassigning; tslassigning := 1; + elems := object_.Lns(); + for _,elem in elems do + {self.}AppendChild(new LnUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/MFontUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/MFontUnitDecorator@DOCX.tsf index eafedb2..dd87dcb 100644 --- a/autoclass/decorator/docx/MFontUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/MFontUnitDecorator@DOCX.tsf @@ -30,5 +30,8 @@ begin {self.}XmlChildEa := new LatinUnitDecorator(object_.XmlChildEa); if not ifnil(object_.XmlChildCs) then {self.}XmlChildCs := new LatinUnitDecorator(object_.XmlChildCs); + elems := object_.Fonts(); + for _,elem in elems do + {self.}AppendChild(new MFontFontUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/NumberingUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/NumberingUnitDecorator@DOCX.tsf index 652267d..ad392da 100644 --- a/autoclass/decorator/docx/NumberingUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/NumberingUnitDecorator@DOCX.tsf @@ -94,5 +94,11 @@ begin {self.}XmlnsWps := object_.XmlAttrXmlnsWps.Value; if not ifnil(object_.XmlAttrMcIgnorable) then {self.}McIgnorable := object_.XmlAttrMcIgnorable.Value; + elems := object_.AbstractNums(); + for _,elem in elems do + {self.}AppendChild(new AbstractNumUnitDecorator(elem)); + elems := object_.Nums(); + for _,elem in elems do + {self.}AppendChild(new NumUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/PPrUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/PPrUnitDecorator@DOCX.tsf index 039903f..665ee33 100644 --- a/autoclass/decorator/docx/PPrUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/PPrUnitDecorator@DOCX.tsf @@ -62,5 +62,11 @@ begin {self.}XmlChildPBdr := new PBdrUnitDecorator(object_.XmlChildPBdr); if not ifnil(object_.XmlChildContextualSpacing) then {self.}ContextualSpacing.Copy(object_.XmlChildContextualSpacing); + if not ifnil(object_.XmlChildShd) then + {self.}XmlChildShd := new ShdUnitDecorator(object_.XmlChildShd); + if not ifnil(object_.XmlChildWordWrap) then + {self.}XmlChildWordWrap := new PureWValUnitDecorator(object_.XmlChildWordWrap); + if not ifnil(object_.XmlChildTextboxTightWrap) then + {self.}XmlChildTextboxTightWrap := new PureWValUnitDecorator(object_.XmlChildTextboxTightWrap); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/PUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/PUnitDecorator@DOCX.tsf index 0bdc3f8..617d21b 100644 --- a/autoclass/decorator/docx/PUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/PUnitDecorator@DOCX.tsf @@ -38,5 +38,26 @@ begin {self.}WRsidP := object_.XmlAttrWRsidP.Value; if not ifnil(object_.XmlChildPPr) then {self.}XmlChildPPr := new PPrUnitDecorator(object_.XmlChildPPr); + elems := object_.Rs(); + for _,elem in elems do + {self.}AppendChild(new RUnitDecorator(elem)); + elems := object_.CommentRangeStarts(); + for _,elem in elems do + {self.}AppendChild(new CommentRangeUnitDecorator(elem)); + elems := object_.CommentRangeEnds(); + for _,elem in elems do + {self.}AppendChild(new CommentRangeUnitDecorator(elem)); + elems := object_.BookmarkStarts(); + for _,elem in elems do + {self.}AppendChild(new BookmarkUnitDecorator(elem)); + elems := object_.BookmarkEnds(); + for _,elem in elems do + {self.}AppendChild(new BookmarkUnitDecorator(elem)); + elems := object_.Hyperlinks(); + for _,elem in elems do + {self.}AppendChild(new HyperLinkUnitDecorator(elem)); + elems := object_.FldSimples(); + for _,elem in elems do + {self.}AppendChild(new FldSimpleUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/RPrUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/RPrUnitDecorator@DOCX.tsf index a71618e..df3471f 100644 --- a/autoclass/decorator/docx/RPrUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/RPrUnitDecorator@DOCX.tsf @@ -56,6 +56,8 @@ begin {self.}U.Copy(object_.XmlChildU); if not ifnil(object_.XmlChildLang) then {self.}XmlChildLang := new LangUnitDecorator(object_.XmlChildLang); + if not ifnil(object_.XmlChildVertAlign) then + {self.}XmlChildVertAlign := new PureWValUnitDecorator(object_.XmlChildVertAlign); if not ifnil(object_.XmlChildW14Ligatures) then {self.}XmlChildW14Ligatures := new PureWValUnitDecorator(object_.XmlChildW14Ligatures); tslassigning := tslassigning_backup; diff --git a/autoclass/decorator/docx/RUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/RUnitDecorator@DOCX.tsf index 8ed4573..0a7e0ef 100644 --- a/autoclass/decorator/docx/RUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/RUnitDecorator@DOCX.tsf @@ -50,9 +50,11 @@ begin {self.}XmlChildDrawing := new DrawingUnitDecorator(object_.XmlChildDrawing); if not ifnil(object_.XmlChildT) then {self.}XmlChildT := new TUnitDecorator(object_.XmlChildT); - if not ifnil(object_.XmlChildFootnoteReference) then - {self.}XmlChildFootnoteReference := new FootnoteReferenceUnitDecorator(object_.XmlChildFootnoteReference); if not ifnil(object_.XmlChildObject) then {self.}XmlChildObject := new ObjectUnitDecorator(object_.XmlChildObject); + if not ifnil(object_.XmlChildFootnoteReference) then + {self.}XmlChildFootnoteReference := new FootnoteReferenceUnitDecorator(object_.XmlChildFootnoteReference); + if not ifnil(object_.XmlChildFootnoteRef) then + {self.}FootnoteRef.Copy(object_.XmlChildFootnoteRef); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/RelationshipsUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/RelationshipsUnitDecorator@DOCX.tsf index 1fc4217..8dda8c1 100644 --- a/autoclass/decorator/docx/RelationshipsUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/RelationshipsUnitDecorator@DOCX.tsf @@ -26,5 +26,8 @@ begin tslassigning := 1; if not ifnil(object_.XmlAttrxmlns) then {self.}xmlns := object_.XmlAttrxmlns.Value; + elems := object_.Relationships(); + for _,elem in elems do + {self.}AppendChild(new RelationshipUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/RichUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/RichUnitDecorator@DOCX.tsf index 85d9e19..05fa93d 100644 --- a/autoclass/decorator/docx/RichUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/RichUnitDecorator@DOCX.tsf @@ -28,5 +28,8 @@ begin {self.}XmlChildBodyPr := new BodyPrUnitDecorator(object_.XmlChildBodyPr); if not ifnil(object_.XmlChildLstStyle) then {self.}LstStyle.Copy(object_.XmlChildLstStyle); + elems := object_.Ps(); + for _,elem in elems do + {self.}AppendChild(new ApUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/RsidsUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/RsidsUnitDecorator@DOCX.tsf index 9e04d35..9005c34 100644 --- a/autoclass/decorator/docx/RsidsUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/RsidsUnitDecorator@DOCX.tsf @@ -26,5 +26,8 @@ begin tslassigning := 1; if not ifnil(object_.XmlChildRsidRoot) then {self.}XmlChildRsidRoot := new PureWValUnitDecorator(object_.XmlChildRsidRoot); + elems := object_.Rsids(); + for _,elem in elems do + {self.}AppendChild(new PureWValUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/SdtContentUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/SdtContentUnitDecorator@DOCX.tsf index f9ea743..87bc6b1 100644 --- a/autoclass/decorator/docx/SdtContentUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/SdtContentUnitDecorator@DOCX.tsf @@ -24,5 +24,8 @@ function SdtContentUnitDecorator.Convert(); begin tslassigning_backup := tslassigning; tslassigning := 1; + elems := object_.Ps(); + for _,elem in elems do + {self.}AppendChild(new PUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/SectPrUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/SectPrUnitDecorator@DOCX.tsf index 64da258..635e6e6 100644 --- a/autoclass/decorator/docx/SectPrUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/SectPrUnitDecorator@DOCX.tsf @@ -28,8 +28,16 @@ begin {self.}WRsidR := object_.XmlAttrWRsidR.Value; if not ifnil(object_.XmlAttrWRsidSect) then {self.}WRsidSect := object_.XmlAttrWRsidSect.Value; + elems := object_.HeaderReferences(); + for _,elem in elems do + {self.}AppendChild(new ReferenceUnitDecorator(elem)); + elems := object_.FooterReferences(); + for _,elem in elems do + {self.}AppendChild(new ReferenceUnitDecorator(elem)); if not ifnil(object_.XmlChildFootnotePr) then {self.}XmlChildFootnotePr := new FootnotePrUnitDecorator(object_.XmlChildFootnotePr); + if not ifnil(object_.XmlChildEndnotePr) then + {self.}XmlChildEndnotePr := new EndnotePrUnitDecorator(object_.XmlChildEndnotePr); if not ifnil(object_.XmlChildType) then {self.}XmlChildType := new PureWValUnitDecorator(object_.XmlChildType); if not ifnil(object_.XmlChildPgSz) then @@ -43,6 +51,6 @@ begin if not ifnil(object_.XmlChildTitlePg) then {self.}TitlePg.Copy(object_.XmlChildTitlePg); if not ifnil(object_.XmlChildDocGrid) then - {self.}XmlChildDocGrid := new docGridUnitDecorator(object_.XmlChildDocGrid); + {self.}XmlChildDocGrid := new DocGridUnitDecorator(object_.XmlChildDocGrid); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/StyleUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/StyleUnitDecorator@DOCX.tsf index 45face3..614ca04 100644 --- a/autoclass/decorator/docx/StyleUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/StyleUnitDecorator@DOCX.tsf @@ -60,5 +60,8 @@ begin {self.}XmlChildTrPr := new TrPrUnitDecorator(object_.XmlChildTrPr); if not ifnil(object_.XmlChildTcPr) then {self.}XmlChildTcPr := new TcPrUnitDecorator(object_.XmlChildTcPr); + elems := object_.TblStylePrs(); + for _,elem in elems do + {self.}AppendChild(new TblStylePrUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/StylesUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/StylesUnitDecorator@DOCX.tsf index 90b3faa..88796e4 100644 --- a/autoclass/decorator/docx/StylesUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/StylesUnitDecorator@DOCX.tsf @@ -52,5 +52,8 @@ begin {self.}XmlChildDocDefaults := new DocDefaultsUnitDecorator(object_.XmlChildDocDefaults); if not ifnil(object_.XmlChildLatenStyles) then {self.}XmlChildLatenStyles := new LatenStylesUnitDecorator(object_.XmlChildLatenStyles); + elems := object_.Styles(); + for _,elem in elems do + {self.}AppendChild(new StyleUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/TabsUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/TabsUnitDecorator@DOCX.tsf index 76c35f6..8fd029b 100644 --- a/autoclass/decorator/docx/TabsUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/TabsUnitDecorator@DOCX.tsf @@ -24,5 +24,8 @@ function TabsUnitDecorator.Convert(); begin tslassigning_backup := tslassigning; tslassigning := 1; + elems := object_.Tabs(); + for _,elem in elems do + {self.}AppendChild(new TabUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/TblGridUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/TblGridUnitDecorator@DOCX.tsf index 95cc2cf..95cb442 100644 --- a/autoclass/decorator/docx/TblGridUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/TblGridUnitDecorator@DOCX.tsf @@ -24,5 +24,8 @@ function TblGridUnitDecorator.Convert(); begin tslassigning_backup := tslassigning; tslassigning := 1; + elems := object_.GridCols(); + for _,elem in elems do + {self.}AppendChild(new GridColUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/TblUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/TblUnitDecorator@DOCX.tsf index 4cc7206..eec42b9 100644 --- a/autoclass/decorator/docx/TblUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/TblUnitDecorator@DOCX.tsf @@ -28,5 +28,8 @@ begin {self.}XmlChildTblPr := new TblPrUnitDecorator(object_.XmlChildTblPr); if not ifnil(object_.XmlChildTblGrid) then {self.}XmlChildTblGrid := new TblGridUnitDecorator(object_.XmlChildTblGrid); + elems := object_.Trs(); + for _,elem in elems do + {self.}AppendChild(new TrUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/TcUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/TcUnitDecorator@DOCX.tsf index d05b74f..844d879 100644 --- a/autoclass/decorator/docx/TcUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/TcUnitDecorator@DOCX.tsf @@ -26,5 +26,11 @@ begin tslassigning := 1; if not ifnil(object_.XmlChildTcPr) then {self.}XmlChildTcPr := new TcPrUnitDecorator(object_.XmlChildTcPr); + elems := object_.Ps(); + for _,elem in elems do + {self.}AppendChild(new PUnitDecorator(elem)); + elems := object_.Tbls(); + for _,elem in elems do + {self.}AppendChild(new TblUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/TrUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/TrUnitDecorator@DOCX.tsf index 90e08c9..9caecb7 100644 --- a/autoclass/decorator/docx/TrUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/TrUnitDecorator@DOCX.tsf @@ -34,5 +34,8 @@ begin {self.}WRsidTr := object_.XmlAttrWRsidTr.Value; if not ifnil(object_.XmlChildTrPr) then {self.}XmlChildTrPr := new TrPrUnitDecorator(object_.XmlChildTrPr); + elems := object_.Tcs(); + for _,elem in elems do + {self.}AppendChild(new TcUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/TxPrUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/TxPrUnitDecorator@DOCX.tsf index 9e41126..e2d7aaf 100644 --- a/autoclass/decorator/docx/TxPrUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/TxPrUnitDecorator@DOCX.tsf @@ -28,5 +28,8 @@ begin {self.}XmlChildBodyPr := new BodyPrUnitDecorator(object_.XmlChildBodyPr); if not ifnil(object_.XmlChildLstStyle) then {self.}LstStyle.Copy(object_.XmlChildLstStyle); + elems := object_.Ps(); + for _,elem in elems do + {self.}AppendChild(new ApUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/TxbxContentUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/TxbxContentUnitDecorator@DOCX.tsf index 4316645..2f766da 100644 --- a/autoclass/decorator/docx/TxbxContentUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/TxbxContentUnitDecorator@DOCX.tsf @@ -24,5 +24,8 @@ function TxbxContentUnitDecorator.Convert(); begin tslassigning_backup := tslassigning; tslassigning := 1; + elems := object_.Ps(); + for _,elem in elems do + {self.}AppendChild(new PUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/TypesUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/TypesUnitDecorator@DOCX.tsf index a151a85..286ce12 100644 --- a/autoclass/decorator/docx/TypesUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/TypesUnitDecorator@DOCX.tsf @@ -26,5 +26,11 @@ begin tslassigning := 1; if not ifnil(object_.XmlAttrxmlns) then {self.}xmlns := object_.XmlAttrxmlns.Value; + elems := object_.Defaults(); + for _,elem in elems do + {self.}AppendChild(new DefaultUnitDecorator(elem)); + elems := object_.Overrides(); + for _,elem in elems do + {self.}AppendChild(new _OverrideUnitDecorator(elem)); tslassigning := tslassigning_backup; end; \ No newline at end of file diff --git a/autoclass/docx/Col@DOCX.tsf b/autoclass/docx/Col@DOCX.tsf new file mode 100644 index 0000000..944f9f1 --- /dev/null +++ b/autoclass/docx/Col@DOCX.tsf @@ -0,0 +1,96 @@ +type Col = 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: Col);override; + +public + + // attributes property + property W read ReadXmlAttrW write WriteXmlAttrW; + property Space read ReadXmlAttrSpace write WriteXmlAttrSpace; + function ReadXmlAttrW(); + function WriteXmlAttrW(_value); + function ReadXmlAttrSpace(); + function WriteXmlAttrSpace(_value); + +public + // Attributes + XmlAttrW: OpenXmlAttribute; + XmlAttrSpace: OpenXmlAttribute; + + +end; + +function Col.Create();overload; +begin + {self.}Create(nil, "w", "col"); +end; + +function Col.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function Col.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 Col.Init();override; +begin + pre := {self.}Prefix ? {self.}Prefix + ":" : ""; + attributes_ := array(); + attributes_pf_ := array( + pre + "w": makeweakref(thisFunction(WriteXmlAttrW)), + pre + "space": makeweakref(thisFunction(WriteXmlAttrSpace)), + ); + sorted_child_ := array( + ); + container_ := new TSOfficeContainer(sorted_child_); +end; + +function Col.Copy(_obj: Col);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.Space) then + {self.}Space := _obj.Space; + tslassigning := tslassigning_backup; +end; + +function Col.ReadXmlAttrW(); +begin + return {self.}XmlAttrW.Value; +end; + +function Col.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 Col.ReadXmlAttrSpace(); +begin + return {self.}XmlAttrSpace.Value; +end; + +function Col.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; diff --git a/autoclass/docx/Cols@DOCX.tsf b/autoclass/docx/Cols@DOCX.tsf index 1a999b4..d43e0b5 100644 --- a/autoclass/docx/Cols@DOCX.tsf +++ b/autoclass/docx/Cols@DOCX.tsf @@ -9,14 +9,29 @@ public public // attributes property + property Num read ReadXmlAttrNum write WriteXmlAttrNum; property Space read ReadXmlAttrSpace write WriteXmlAttrSpace; + property EqualWidth read ReadXmlAttrEqualWidth write WriteXmlAttrEqualWidth; + function ReadXmlAttrNum(); + function WriteXmlAttrNum(_value); function ReadXmlAttrSpace(); function WriteXmlAttrSpace(_value); + function ReadXmlAttrEqualWidth(); + function WriteXmlAttrEqualWidth(_value); + + // multi property + property Cols read ReadCols; + function ReadCols(_index); + function AddCol(): Col; + function AppendCol(): Col; public // Attributes + XmlAttrNum: OpenXmlAttribute; XmlAttrSpace: OpenXmlAttribute; + XmlAttrEqualWidth: OpenXmlAttribute; + // Children end; @@ -41,9 +56,12 @@ begin pre := {self.}Prefix ? {self.}Prefix + ":" : ""; attributes_ := array(); attributes_pf_ := array( + pre + "num": makeweakref(thisFunction(WriteXmlAttrNum)), pre + "space": makeweakref(thisFunction(WriteXmlAttrSpace)), + pre + "equalWidth": makeweakref(thisFunction(WriteXmlAttrEqualWidth)), ); sorted_child_ := array( + pre + "col": array(0, makeweakref(thisFunction(AppendCol))), ); container_ := new TSOfficeContainer(sorted_child_); end; @@ -53,11 +71,30 @@ begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); + if not ifnil(_obj.Num) then + {self.}Num := _obj.Num; if not ifnil(_obj.Space) then {self.}Space := _obj.Space; + if not ifnil(_obj.EqualWidth) then + {self.}EqualWidth := _obj.EqualWidth; tslassigning := tslassigning_backup; end; +function Cols.ReadXmlAttrNum(); +begin + return {self.}XmlAttrNum.Value; +end; + +function Cols.WriteXmlAttrNum(_value); +begin + if ifnil({self.}XmlAttrNum) then + begin + {self.}XmlAttrNum := new OpenXmlAttribute({self.}Prefix, "num", nil); + attributes_[length(attributes_)] := {self.}XmlAttrNum; + end + {self.}XmlAttrNum.Value := _value; +end; + function Cols.ReadXmlAttrSpace(); begin return {self.}XmlAttrSpace.Value; @@ -72,3 +109,39 @@ begin end {self.}XmlAttrSpace.Value := _value; end; + +function Cols.ReadXmlAttrEqualWidth(); +begin + return {self.}XmlAttrEqualWidth.Value; +end; + +function Cols.WriteXmlAttrEqualWidth(_value); +begin + if ifnil({self.}XmlAttrEqualWidth) then + begin + {self.}XmlAttrEqualWidth := new OpenXmlAttribute({self.}Prefix, "equalWidth", nil); + attributes_[length(attributes_)] := {self.}XmlAttrEqualWidth; + end + {self.}XmlAttrEqualWidth.Value := _value; +end; + +function Cols.ReadCols(_index); +begin + ind := ifnil(_index) ? -2 : _index; + pre := {self.}Prefix ? {self.}Prefix + ":" : ""; + return container_.Get(pre + "col", ind); +end; + +function Cols.AddCol(): Col; +begin + obj := new Col(self, {self.}Prefix, "col"); + container_.Insert(obj); + return obj; +end; + +function Cols.AppendCol(): Col; +begin + obj := new Col(self, {self.}Prefix, "col"); + container_.Append(obj); + return obj; +end; diff --git a/autoclass/docx/EndnotePr@DOCX.tsf b/autoclass/docx/EndnotePr@DOCX.tsf index 1010241..f394b4c 100644 --- a/autoclass/docx/EndnotePr@DOCX.tsf +++ b/autoclass/docx/EndnotePr@DOCX.tsf @@ -8,6 +8,14 @@ public public + // normal property + property Pos read ReadXmlChildPos; + property NumFmt read ReadXmlChildNumFmt; + property NumStart read ReadXmlChildNumStart; + function ReadXmlChildPos(); + function ReadXmlChildNumFmt(); + function ReadXmlChildNumStart(); + // multi property property Endnotes read ReadEndnotes; function ReadEndnotes(_index); @@ -16,6 +24,9 @@ public public // Children + XmlChildPos: PureWVal; + XmlChildNumFmt: PureWVal; + XmlChildNumStart: PureWVal; end; @@ -42,7 +53,10 @@ begin attributes_pf_ := array( ); sorted_child_ := array( - pre + "endnote": array(0, makeweakref(thisFunction(AppendEndnote))), + pre + "pos": array(0, makeweakref(thisFunction(ReadXmlChildPos))), + pre + "numFmt": array(1, makeweakref(thisFunction(ReadXmlChildNumFmt))), + pre + "numStart": array(2, makeweakref(thisFunction(ReadXmlChildNumStart))), + pre + "endnote": array(3, makeweakref(thisFunction(AppendEndnote))), ); container_ := new TSOfficeContainer(sorted_child_); end; @@ -52,9 +66,45 @@ begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); + if not ifnil(_obj.XmlChildPos) then + {self.}Pos.Copy(_obj.XmlChildPos); + if not ifnil(_obj.XmlChildNumFmt) then + {self.}NumFmt.Copy(_obj.XmlChildNumFmt); + if not ifnil(_obj.XmlChildNumStart) then + {self.}NumStart.Copy(_obj.XmlChildNumStart); tslassigning := tslassigning_backup; end; +function EndnotePr.ReadXmlChildPos(); +begin + if tslassigning and ifnil({self.}XmlChildPos) then + begin + {self.}XmlChildPos := new PureWVal(self, {self.}Prefix, "pos"); + container_.Set({self.}XmlChildPos); + end + return {self.}XmlChildPos; +end; + +function EndnotePr.ReadXmlChildNumFmt(); +begin + if tslassigning and ifnil({self.}XmlChildNumFmt) then + begin + {self.}XmlChildNumFmt := new PureWVal(self, {self.}Prefix, "numFmt"); + container_.Set({self.}XmlChildNumFmt); + end + return {self.}XmlChildNumFmt; +end; + +function EndnotePr.ReadXmlChildNumStart(); +begin + if tslassigning and ifnil({self.}XmlChildNumStart) then + begin + {self.}XmlChildNumStart := new PureWVal(self, {self.}Prefix, "numStart"); + container_.Set({self.}XmlChildNumStart); + end + return {self.}XmlChildNumStart; +end; + function EndnotePr.ReadEndnotes(_index); begin ind := ifnil(_index) ? -2 : _index; diff --git a/autoclass/docx/PPr@DOCX.tsf b/autoclass/docx/PPr@DOCX.tsf index aee29cd..dad01d4 100644 --- a/autoclass/docx/PPr@DOCX.tsf +++ b/autoclass/docx/PPr@DOCX.tsf @@ -40,6 +40,9 @@ public property AutoSpaceDN read ReadXmlChildAutoSpaceDN; property RPr read ReadXmlChildRPr; property PBdr read ReadXmlChildPBdr; + property Shd read ReadXmlChildShd; + property WordWrap read ReadXmlChildWordWrap; + property TextboxTightWrap read ReadXmlChildTextboxTightWrap; function ReadXmlChildSectPr(); function ReadXmlChildTabs(); function ReadXmlChildSnapToGrid(); @@ -54,6 +57,9 @@ public function ReadXmlChildAutoSpaceDN(); function ReadXmlChildRPr(); function ReadXmlChildPBdr(); + function ReadXmlChildShd(); + function ReadXmlChildWordWrap(); + function ReadXmlChildTextboxTightWrap(); public // Children @@ -76,6 +82,9 @@ public XmlChildRPr: RPr; XmlChildPBdr: PBdr; XmlChildContextualSpacing: OpenXmlEmpty; + XmlChildShd: Shd; + XmlChildWordWrap: PureWVal; + XmlChildTextboxTightWrap: PureWVal; end; @@ -121,6 +130,9 @@ begin pre + "rPr": array(16, makeweakref(thisFunction(ReadXmlChildRPr))), pre + "pBdr": array(17, makeweakref(thisFunction(ReadXmlChildPBdr))), pre + "contextualSpacing": array(18, makeweakref(thisFunction(ReadXmlChildContextualSpacing))), + pre + "shd": array(19, makeweakref(thisFunction(ReadXmlChildShd))), + pre + "wordWrap": array(20, makeweakref(thisFunction(ReadXmlChildWordWrap))), + pre + "textboxTightWrap": array(21, makeweakref(thisFunction(ReadXmlChildTextboxTightWrap))), ); container_ := new TSOfficeContainer(sorted_child_); end; @@ -168,6 +180,12 @@ begin {self.}PBdr.Copy(_obj.XmlChildPBdr); if not ifnil(_obj.XmlChildContextualSpacing) then ifnil({self.}XmlChildContextualSpacing) ? {self.}ContextualSpacing.Copy(_obj.XmlChildContextualSpacing) : {self.}XmlChildContextualSpacing.Copy(_obj.XmlChildContextualSpacing); + if not ifnil(_obj.XmlChildShd) then + {self.}Shd.Copy(_obj.XmlChildShd); + if not ifnil(_obj.XmlChildWordWrap) then + {self.}WordWrap.Copy(_obj.XmlChildWordWrap); + if not ifnil(_obj.XmlChildTextboxTightWrap) then + {self.}TextboxTightWrap.Copy(_obj.XmlChildTextboxTightWrap); tslassigning := tslassigning_backup; end; @@ -415,3 +433,33 @@ begin end return {self.}XmlChildPBdr; end; + +function PPr.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 PPr.ReadXmlChildWordWrap(); +begin + if tslassigning and ifnil({self.}XmlChildWordWrap) then + begin + {self.}XmlChildWordWrap := new PureWVal(self, {self.}Prefix, "wordWrap"); + container_.Set({self.}XmlChildWordWrap); + end + return {self.}XmlChildWordWrap; +end; + +function PPr.ReadXmlChildTextboxTightWrap(); +begin + if tslassigning and ifnil({self.}XmlChildTextboxTightWrap) then + begin + {self.}XmlChildTextboxTightWrap := new PureWVal(self, {self.}Prefix, "textboxTightWrap"); + container_.Set({self.}XmlChildTextboxTightWrap); + end + return {self.}XmlChildTextboxTightWrap; +end; diff --git a/autoclass/docx/R@DOCX.tsf b/autoclass/docx/R@DOCX.tsf index 6589321..a38718e 100644 --- a/autoclass/docx/R@DOCX.tsf +++ b/autoclass/docx/R@DOCX.tsf @@ -23,12 +23,15 @@ public property Separator read ReadXmlChildSeparator write WriteXmlChildSeparator; property ContinuationSeparator read ReadXmlChildContinuationSeparator write WriteXmlChildContinuationSeparator; property LastRenderedPageBreak read ReadXmlChildLastRenderedPageBreak write WriteXmlChildLastRenderedPageBreak; + property FootnoteRef read ReadXmlChildFootnoteRef write WriteXmlChildFootnoteRef; function ReadXmlChildSeparator(); function WriteXmlChildSeparator(_value); function ReadXmlChildContinuationSeparator(); function WriteXmlChildContinuationSeparator(_value); function ReadXmlChildLastRenderedPageBreak(); function WriteXmlChildLastRenderedPageBreak(_value); + function ReadXmlChildFootnoteRef(); + function WriteXmlChildFootnoteRef(_value); // normal property property RPr read ReadXmlChildRPr; @@ -38,8 +41,8 @@ public property AlternateContent read ReadXmlChildAlternateContent; property Drawing read ReadXmlChildDrawing; property T read ReadXmlChildT; - property FootnoteReference read ReadXmlChildFootnoteReference; property Object read ReadXmlChildObject; + property FootnoteReference read ReadXmlChildFootnoteReference; function ReadXmlChildRPr(); function ReadXmlChildBr(); function ReadXmlChildFldChar(); @@ -47,8 +50,8 @@ public function ReadXmlChildAlternateContent(); function ReadXmlChildDrawing(); function ReadXmlChildT(); - function ReadXmlChildFootnoteReference(); function ReadXmlChildObject(); + function ReadXmlChildFootnoteReference(); public // Attributes @@ -67,8 +70,9 @@ public XmlChildAlternateContent: AlternateContent; XmlChildDrawing: Drawing; XmlChildT: T; - XmlChildFootnoteReference: FootnoteReference; XmlChildObject: Object; + XmlChildFootnoteReference: FootnoteReference; + XmlChildFootnoteRef: OpenXmlEmpty; end; @@ -108,8 +112,9 @@ begin "mc:AlternateContent": array(7, makeweakref(thisFunction(ReadXmlChildAlternateContent))), pre + "drawing": array(8, makeweakref(thisFunction(ReadXmlChildDrawing))), pre + "t": array(9, makeweakref(thisFunction(ReadXmlChildT))), - pre + "footnoteReference": array(10, makeweakref(thisFunction(ReadXmlChildFootnoteReference))), - pre + "object": array(11, makeweakref(thisFunction(ReadXmlChildObject))), + pre + "object": array(10, makeweakref(thisFunction(ReadXmlChildObject))), + pre + "footnoteReference": array(11, makeweakref(thisFunction(ReadXmlChildFootnoteReference))), + pre + "footnoteRef": array(12, makeweakref(thisFunction(ReadXmlChildFootnoteRef))), ); container_ := new TSOfficeContainer(sorted_child_); end; @@ -145,10 +150,12 @@ begin {self.}Drawing.Copy(_obj.XmlChildDrawing); if not ifnil(_obj.XmlChildT) then {self.}T.Copy(_obj.XmlChildT); - if not ifnil(_obj.XmlChildFootnoteReference) then - {self.}FootnoteReference.Copy(_obj.XmlChildFootnoteReference); if not ifnil(_obj.XmlChildObject) then {self.}Object.Copy(_obj.XmlChildObject); + if not ifnil(_obj.XmlChildFootnoteReference) then + {self.}FootnoteReference.Copy(_obj.XmlChildFootnoteReference); + if not ifnil(_obj.XmlChildFootnoteRef) then + ifnil({self.}XmlChildFootnoteRef) ? {self.}FootnoteRef.Copy(_obj.XmlChildFootnoteRef) : {self.}XmlChildFootnoteRef.Copy(_obj.XmlChildFootnoteRef); tslassigning := tslassigning_backup; end; @@ -260,6 +267,27 @@ begin {self.}XmlChildLastRenderedPageBreak.Value := _value; end; +function R.ReadXmlChildFootnoteRef(); +begin + if tslassigning and ifnil({self.}XmlChildFootnoteRef) then + begin + {self.}XmlChildFootnoteRef := new OpenXmlEmpty(self, {self.}Prefix, "footnoteRef"); + container_.Set({self.}XmlChildFootnoteRef); + return {self.}XmlChildFootnoteRef; + end + return ifnil({self.}XmlChildFootnoteRef) ? false : {self.}XmlChildFootnoteRef.BoolValue(); +end; + +function R.WriteXmlChildFootnoteRef(_value); +begin + if ifnil({self.}XmlChildFootnoteRef) then + begin + {self.}XmlChildFootnoteRef := new OpenXmlEmpty(self, {self.}Prefix, "footnoteRef"); + container_.Set({self.}XmlChildFootnoteRef); + end + {self.}XmlChildFootnoteRef.Value := _value; +end; + function R.ReadXmlChildRPr(); begin if tslassigning and ifnil({self.}XmlChildRPr) then @@ -330,16 +358,6 @@ begin return {self.}XmlChildT; end; -function R.ReadXmlChildFootnoteReference(); -begin - if tslassigning and ifnil({self.}XmlChildFootnoteReference) then - begin - {self.}XmlChildFootnoteReference := new FootnoteReference(self, {self.}Prefix, "footnoteReference"); - container_.Set({self.}XmlChildFootnoteReference); - end - return {self.}XmlChildFootnoteReference; -end; - function R.ReadXmlChildObject(); begin if tslassigning and ifnil({self.}XmlChildObject) then @@ -349,3 +367,13 @@ begin end return {self.}XmlChildObject; end; + +function R.ReadXmlChildFootnoteReference(); +begin + if tslassigning and ifnil({self.}XmlChildFootnoteReference) then + begin + {self.}XmlChildFootnoteReference := new FootnoteReference(self, {self.}Prefix, "footnoteReference"); + container_.Set({self.}XmlChildFootnoteReference); + end + return {self.}XmlChildFootnoteReference; +end; diff --git a/autoclass/docx/RPr@DOCX.tsf b/autoclass/docx/RPr@DOCX.tsf index cc262b4..437e17b 100644 --- a/autoclass/docx/RPr@DOCX.tsf +++ b/autoclass/docx/RPr@DOCX.tsf @@ -39,6 +39,7 @@ public property Sz read ReadXmlChildSz; property SzCs read ReadXmlChildSzCs; property Lang read ReadXmlChildLang; + property VertAlign read ReadXmlChildVertAlign; property W14Ligatures read ReadXmlChildW14Ligatures; function ReadXmlChildNoProof(); function ReadXmlChildPosition(); @@ -50,6 +51,7 @@ public function ReadXmlChildSz(); function ReadXmlChildSzCs(); function ReadXmlChildLang(); + function ReadXmlChildVertAlign(); function ReadXmlChildW14Ligatures(); public @@ -70,6 +72,7 @@ public XmlChildSzCs: SzCs; XmlChildU: OpenXmlEmpty; XmlChildLang: Lang; + XmlChildVertAlign: PureWVal; XmlChildW14Ligatures: PureWVal; end; @@ -113,7 +116,8 @@ begin pre + "szCs": array(13, makeweakref(thisFunction(ReadXmlChildSzCs))), pre + "u": array(14, makeweakref(thisFunction(ReadXmlChildU))), pre + "lang": array(15, makeweakref(thisFunction(ReadXmlChildLang))), - "w14:ligatures": array(16, makeweakref(thisFunction(ReadXmlChildW14Ligatures))), + pre + "vertAlign": array(16, makeweakref(thisFunction(ReadXmlChildVertAlign))), + "w14:ligatures": array(17, makeweakref(thisFunction(ReadXmlChildW14Ligatures))), ); container_ := new TSOfficeContainer(sorted_child_); end; @@ -155,6 +159,8 @@ begin ifnil({self.}XmlChildU) ? {self.}U.Copy(_obj.XmlChildU) : {self.}XmlChildU.Copy(_obj.XmlChildU); if not ifnil(_obj.XmlChildLang) then {self.}Lang.Copy(_obj.XmlChildLang); + if not ifnil(_obj.XmlChildVertAlign) then + {self.}VertAlign.Copy(_obj.XmlChildVertAlign); if not ifnil(_obj.XmlChildW14Ligatures) then {self.}W14Ligatures.Copy(_obj.XmlChildW14Ligatures); tslassigning := tslassigning_backup; @@ -386,6 +392,16 @@ begin return {self.}XmlChildLang; end; +function RPr.ReadXmlChildVertAlign(); +begin + if tslassigning and ifnil({self.}XmlChildVertAlign) then + begin + {self.}XmlChildVertAlign := new PureWVal(self, {self.}Prefix, "vertAlign"); + container_.Set({self.}XmlChildVertAlign); + end + return {self.}XmlChildVertAlign; +end; + function RPr.ReadXmlChildW14Ligatures(); begin if tslassigning and ifnil({self.}XmlChildW14Ligatures) then diff --git a/autoclass/docx/SectPr@DOCX.tsf b/autoclass/docx/SectPr@DOCX.tsf index 91e40b7..63b4a0e 100644 --- a/autoclass/docx/SectPr@DOCX.tsf +++ b/autoclass/docx/SectPr@DOCX.tsf @@ -23,6 +23,7 @@ public // normal property property FootnotePr read ReadXmlChildFootnotePr; + property EndnotePr read ReadXmlChildEndnotePr; property Type read ReadXmlChildType; property PgSz read ReadXmlChildPgSz; property PgMar read ReadXmlChildPgMar; @@ -30,6 +31,7 @@ public property Cols read ReadXmlChildCols; property DocGrid read ReadXmlChildDocGrid; function ReadXmlChildFootnotePr(); + function ReadXmlChildEndnotePr(); function ReadXmlChildType(); function ReadXmlChildPgSz(); function ReadXmlChildPgMar(); @@ -54,13 +56,14 @@ public // Children XmlChildFootnotePr: FootnotePr; + XmlChildEndnotePr: EndnotePr; XmlChildType: PureWVal; XmlChildPgSz: PgSz; XmlChildPgMar: PgMar; XmlChildPgNumType: PgNumType; XmlChildCols: Cols; XmlChildTitlePg: OpenXmlEmpty; - XmlChildDocGrid: docGrid; + XmlChildDocGrid: DocGrid; end; @@ -92,13 +95,14 @@ begin pre + "headerReference": array(0, makeweakref(thisFunction(AppendHeaderReference))), pre + "footerReference": array(1, makeweakref(thisFunction(AppendFooterReference))), pre + "footnotePr": array(2, makeweakref(thisFunction(ReadXmlChildFootnotePr))), - pre + "type": array(3, makeweakref(thisFunction(ReadXmlChildType))), - pre + "pgSz": array(4, makeweakref(thisFunction(ReadXmlChildPgSz))), - pre + "pgMar": array(5, makeweakref(thisFunction(ReadXmlChildPgMar))), - pre + "pgNumType": array(6, makeweakref(thisFunction(ReadXmlChildPgNumType))), - pre + "cols": array(7, makeweakref(thisFunction(ReadXmlChildCols))), - pre + "titlePg": array(8, makeweakref(thisFunction(ReadXmlChildTitlePg))), - pre + "docGrid": array(9, makeweakref(thisFunction(ReadXmlChildDocGrid))), + pre + "endnotePr": array(3, makeweakref(thisFunction(ReadXmlChildEndnotePr))), + pre + "type": array(4, makeweakref(thisFunction(ReadXmlChildType))), + pre + "pgSz": array(5, makeweakref(thisFunction(ReadXmlChildPgSz))), + pre + "pgMar": array(6, makeweakref(thisFunction(ReadXmlChildPgMar))), + pre + "pgNumType": array(7, makeweakref(thisFunction(ReadXmlChildPgNumType))), + pre + "cols": array(8, makeweakref(thisFunction(ReadXmlChildCols))), + pre + "titlePg": array(9, makeweakref(thisFunction(ReadXmlChildTitlePg))), + pre + "docGrid": array(10, makeweakref(thisFunction(ReadXmlChildDocGrid))), ); container_ := new TSOfficeContainer(sorted_child_); end; @@ -114,6 +118,8 @@ begin {self.}WRsidSect := _obj.WRsidSect; if not ifnil(_obj.XmlChildFootnotePr) then {self.}FootnotePr.Copy(_obj.XmlChildFootnotePr); + if not ifnil(_obj.XmlChildEndnotePr) then + {self.}EndnotePr.Copy(_obj.XmlChildEndnotePr); if not ifnil(_obj.XmlChildType) then {self.}Type.Copy(_obj.XmlChildType); if not ifnil(_obj.XmlChildPgSz) then @@ -192,6 +198,16 @@ begin return {self.}XmlChildFootnotePr; end; +function SectPr.ReadXmlChildEndnotePr(); +begin + if tslassigning and ifnil({self.}XmlChildEndnotePr) then + begin + {self.}XmlChildEndnotePr := new EndnotePr(self, {self.}Prefix, "endnotePr"); + container_.Set({self.}XmlChildEndnotePr); + end + return {self.}XmlChildEndnotePr; +end; + function SectPr.ReadXmlChildType(); begin if tslassigning and ifnil({self.}XmlChildType) then @@ -246,7 +262,7 @@ function SectPr.ReadXmlChildDocGrid(); begin if tslassigning and ifnil({self.}XmlChildDocGrid) then begin - {self.}XmlChildDocGrid := new docGrid(self, {self.}Prefix, "docGrid"); + {self.}XmlChildDocGrid := new DocGrid(self, {self.}Prefix, "docGrid"); container_.Set({self.}XmlChildDocGrid); end return {self.}XmlChildDocGrid; diff --git a/openxml/OpenXmlElement.tsf b/openxml/OpenXmlElement.tsf index e0e2856..00fbbc8 100644 --- a/openxml/OpenXmlElement.tsf +++ b/openxml/OpenXmlElement.tsf @@ -15,18 +15,13 @@ public function Attributes(): array of OpenXmlAttribute; // 增删改查接口 -- 暂不实现 -// public -// function Append(_obj: tslobj): boolean; // OpenXmlElement or OpenXmlPcdata -// function InsertAfter(_pos_obj: tslobj; _obj: tslobj): boolean; -// function InsertBefore(_pos_obj: tslobj; _obj: tslobj): boolean; -// function Prepend(var _obj: tslobj): boolean; -// function Remove(_obj: tslobj): boolean; -// function AddAttribute(_obj: OpenXmlAttribute): boolean; - -// protected -// function IsValidChild(_obj: tslobj); -// function FindChild(_obj: tslobj); -// function InsertChild(_obj: tslobj; _pos: integer); +public + function AppendChild(_obj: tslobj); // OpenXmlElement or OpenXmlPcdata + function InsertAfter(_obj: tslobj; _pos_obj: tslobj); +// function InsertBefore(_pos_obj: tslobj; _obj: tslobj); +// function PrependChild(_obj: tslobj); +// function RemoveChild(_obj: tslobj); +// function SetAttribute(_obj: OpenXmlAttribute); public LocalName: string; // 本地名称 @@ -172,3 +167,12 @@ begin return container_.Get(); end; +function OpenXmlElement.InsertAfter(_obj: tslobj; _pos_obj: tslobj); +begin + container_.InsertAfter(_obj, _pos_obj); +end; + +function OpenXmlElement.AppendChild(_obj: tslobj); +begin + container_.Append(_obj); +end; diff --git a/utils/TSComponentsBase.tsf b/utils/TSComponentsBase.tsf index 6eb69b3..ffda2f8 100644 --- a/utils/TSComponentsBase.tsf +++ b/utils/TSComponentsBase.tsf @@ -3,7 +3,7 @@ public function Create(); function Init();virtual; function InitZip(zip: ZipFile); - function OpenFile(alias: string; file: string; password: string): tableArray; + function Open(alias: string; file: string; password: string): tableArray; function Save(): tableArray; function SaveAs(alias: string; file: string): tableArray; function Zip(): ZipFile; @@ -29,7 +29,7 @@ begin zipfile_ := zip; end; -function TSComponentsBase.OpenFile(alias: string; file: string; password: string): tableArray; +function TSComponentsBase.Open(alias: string; file: string; password: string): tableArray; begin {self.}Init(); zipfile_ := new ZipFile(); diff --git a/utils/TSOfficeContainer.tsf b/utils/TSOfficeContainer.tsf index 3e3de6d..9f731d0 100644 --- a/utils/TSOfficeContainer.tsf +++ b/utils/TSOfficeContainer.tsf @@ -5,6 +5,7 @@ public function Add(data: any): boolean; function Append(data: any): boolean; function Insert(data: any): boolean; + function InsertAfter(data: any; pos_data: any); function Get(name: string; index: integer);overload; function Get(): array of tslobj;overload; @@ -23,6 +24,7 @@ public function Create(name: string); function Set(data: any); function Add(data: any); + function InsertAfter(data: any; pos_data: any): boolean; function Name(): string; function Size(): integer; function First(): Node; @@ -113,6 +115,16 @@ begin return ifnil(child_[data.ElementName]) ? {self.}Append(data) : {self.}Add(data); end; +function TSOfficeContainer.InsertAfter(data: any; pos_data: any); +begin + for i:=0 to current_index_ do + begin + obj := bucket_[i]; + if ifObj(obj) then + if obj.InsertAfter(data, pos_data) then break; + end +end; + function TSOfficeContainer.Get(): array of tslobj;overload; begin arr := array(); @@ -207,6 +219,26 @@ begin size_++; end; +function LinkList.InsertAfter(data: any; pos_data: any): boolean; +begin + node := {self.}First(); + while ifObj(node) do + begin + if node.data = pos_data then + begin + new_node := new Node(); + new_node.data := data; + new_node.next := node.next; + node.next := new_node; + if tail_ = node then tail_ := new_node; + size_++; + return true; + end + node := node.next; + end + return false; +end; + function LinkList.Name(): string; begin return name_;