diff --git a/autounit/DocxML.tsf b/autounit/DocxML.tsf index 7fb8e95..e615779 100644 --- a/autounit/DocxML.tsf +++ b/autounit/DocxML.tsf @@ -2376,14 +2376,23 @@ public function Copy(_obj: SdtContent);override; public + // normal property + property Sdt read ReadXmlChildSdt; + function ReadXmlChildSdt(): Sdt; + // multi property property Ps read ReadPs; + property Rs read ReadRs; function ReadPs(_index); + function ReadRs(_index); function AddP(): P; + function AddR(): R; function AppendP(): P; + function AppendR(): R; public // Children + XmlChildSdt: Sdt; end; type SectPr = class(OpenXmlElement) @@ -3045,9 +3054,11 @@ public property Pos read ReadXmlChildPos; property NumFmt read ReadXmlChildNumFmt; property NumStart read ReadXmlChildNumStart; + property NumRestart read ReadXmlChildNumRestart; function ReadXmlChildPos(): PureWVal; function ReadXmlChildNumFmt(): PureWVal; function ReadXmlChildNumStart(): PureWVal; + function ReadXmlChildNumRestart(): PureWVal; // multi property property Footnotes read ReadFootnotes; @@ -3060,6 +3071,7 @@ public XmlChildPos: PureWVal; XmlChildNumFmt: PureWVal; XmlChildNumStart: PureWVal; + XmlChildNumRestart: PureWVal; end; type EndnotePr = class(OpenXmlElement) @@ -3075,21 +3087,24 @@ public property Pos read ReadXmlChildPos; property NumFmt read ReadXmlChildNumFmt; property NumStart read ReadXmlChildNumStart; + property NumRestart read ReadXmlChildNumRestart; function ReadXmlChildPos(): PureWVal; function ReadXmlChildNumFmt(): PureWVal; function ReadXmlChildNumStart(): PureWVal; + function ReadXmlChildNumRestart(): PureWVal; // multi property - property Endnotes read ReadEndnotes; - function ReadEndnotes(_index); - function AddEndnote(): Endnote; - function AppendEndnote(): Endnote; + property Footnotes read ReadFootnotes; + function ReadFootnotes(_index); + function AddFootnote(): Footnote; + function AppendFootnote(): Footnote; public // Children XmlChildPos: PureWVal; XmlChildNumFmt: PureWVal; XmlChildNumStart: PureWVal; + XmlChildNumRestart: PureWVal; end; type Compat = class(OpenXmlElement) @@ -3860,6 +3875,10 @@ public function ReadXmlAttrIgnorable(); function WriteXmlAttrIgnorable(_value); + // normal property + property Sdt read ReadXmlChildSdt; + function ReadXmlChildSdt(): Sdt; + // multi property property Ps read ReadPs; function ReadPs(_index); @@ -3871,6 +3890,7 @@ public XmlAttrIgnorable: OpenXmlAttribute; // Children + XmlChildSdt: Sdt; end; type Hdr = class(OpenXmlElement) @@ -12772,6 +12792,8 @@ begin ); sorted_child_ := array( pre + "p": array(0, makeweakref(thisFunction(AppendP))), + pre + "r": array(1, makeweakref(thisFunction(AppendR))), + pre + "sdt": array(2, makeweakref(thisFunction(ReadXmlChildSdt))), ); container_ := new TSOfficeContainer(sorted_child_); end; @@ -12781,9 +12803,21 @@ begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); + if not ifnil(_obj.XmlChildSdt) then + {self.}Sdt.Copy(_obj.XmlChildSdt); tslassigning := tslassigning_backup; end; +function SdtContent.ReadXmlChildSdt(): Sdt; +begin + if tslassigning and ifnil({self.}XmlChildSdt) then + begin + {self.}XmlChildSdt := new Sdt(self, {self.}Prefix, "sdt"); + container_.Set({self.}XmlChildSdt); + end + return {self.}XmlChildSdt; +end; + function SdtContent.ReadPs(_index); begin ind := ifnil(_index) ? -2 : _index; @@ -12791,6 +12825,13 @@ begin return container_.Get(pre + "p", ind); end; +function SdtContent.ReadRs(_index); +begin + ind := ifnil(_index) ? -2 : _index; + pre := {self.}Prefix ? {self.}Prefix + ":" : ""; + return container_.Get(pre + "r", ind); +end; + function SdtContent.AddP(): P; begin obj := new P(self, {self.}Prefix, "p"); @@ -12798,6 +12839,13 @@ begin return obj; end; +function SdtContent.AddR(): R; +begin + obj := new R(self, {self.}Prefix, "r"); + container_.Insert(obj); + return obj; +end; + function SdtContent.AppendP(): P; begin obj := new P(self, {self.}Prefix, "p"); @@ -12805,6 +12853,13 @@ begin return obj; end; +function SdtContent.AppendR(): R; +begin + obj := new R(self, {self.}Prefix, "r"); + container_.Append(obj); + return obj; +end; + function SectPr.Create();overload; begin {self.}Create(nil, "w", "sectPr"); @@ -15044,7 +15099,8 @@ begin pre + "pos": array(0, makeweakref(thisFunction(ReadXmlChildPos))), pre + "numFmt": array(1, makeweakref(thisFunction(ReadXmlChildNumFmt))), pre + "numStart": array(2, makeweakref(thisFunction(ReadXmlChildNumStart))), - pre + "footnote": array(3, makeweakref(thisFunction(AppendFootnote))), + pre + "numRestart": array(3, makeweakref(thisFunction(ReadXmlChildNumRestart))), + pre + "footnote": array(4, makeweakref(thisFunction(AppendFootnote))), ); container_ := new TSOfficeContainer(sorted_child_); end; @@ -15060,6 +15116,8 @@ begin {self.}NumFmt.Copy(_obj.XmlChildNumFmt); if not ifnil(_obj.XmlChildNumStart) then {self.}NumStart.Copy(_obj.XmlChildNumStart); + if not ifnil(_obj.XmlChildNumRestart) then + {self.}NumRestart.Copy(_obj.XmlChildNumRestart); tslassigning := tslassigning_backup; end; @@ -15093,6 +15151,16 @@ begin return {self.}XmlChildNumStart; end; +function FootnotePr.ReadXmlChildNumRestart(): PureWVal; +begin + if tslassigning and ifnil({self.}XmlChildNumRestart) then + begin + {self.}XmlChildNumRestart := new PureWVal(self, {self.}Prefix, "numRestart"); + container_.Set({self.}XmlChildNumRestart); + end + return {self.}XmlChildNumRestart; +end; + function FootnotePr.ReadFootnotes(_index); begin ind := ifnil(_index) ? -2 : _index; @@ -15140,7 +15208,8 @@ begin 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))), + pre + "numRestart": array(3, makeweakref(thisFunction(ReadXmlChildNumRestart))), + pre + "footnote": array(4, makeweakref(thisFunction(AppendFootnote))), ); container_ := new TSOfficeContainer(sorted_child_); end; @@ -15156,6 +15225,8 @@ begin {self.}NumFmt.Copy(_obj.XmlChildNumFmt); if not ifnil(_obj.XmlChildNumStart) then {self.}NumStart.Copy(_obj.XmlChildNumStart); + if not ifnil(_obj.XmlChildNumRestart) then + {self.}NumRestart.Copy(_obj.XmlChildNumRestart); tslassigning := tslassigning_backup; end; @@ -15189,23 +15260,33 @@ begin return {self.}XmlChildNumStart; end; -function EndnotePr.ReadEndnotes(_index); +function EndnotePr.ReadXmlChildNumRestart(): PureWVal; +begin + if tslassigning and ifnil({self.}XmlChildNumRestart) then + begin + {self.}XmlChildNumRestart := new PureWVal(self, {self.}Prefix, "numRestart"); + container_.Set({self.}XmlChildNumRestart); + end + return {self.}XmlChildNumRestart; +end; + +function EndnotePr.ReadFootnotes(_index); begin ind := ifnil(_index) ? -2 : _index; pre := {self.}Prefix ? {self.}Prefix + ":" : ""; - return container_.Get(pre + "endnote", ind); + return container_.Get(pre + "footnote", ind); end; -function EndnotePr.AddEndnote(): Endnote; +function EndnotePr.AddFootnote(): Footnote; begin - obj := new Endnote(self, {self.}Prefix, "endnote"); + obj := new Footnote(self, {self.}Prefix, "footnote"); container_.Insert(obj); return obj; end; -function EndnotePr.AppendEndnote(): Endnote; +function EndnotePr.AppendFootnote(): Footnote; begin - obj := new Endnote(self, {self.}Prefix, "endnote"); + obj := new Footnote(self, {self.}Prefix, "footnote"); container_.Append(obj); return obj; end; @@ -17841,6 +17922,7 @@ begin ); sorted_child_ := array( pre + "p": array(0, makeweakref(thisFunction(AppendP))), + pre + "sdt": array(1, makeweakref(thisFunction(ReadXmlChildSdt))), ); container_ := new TSOfficeContainer(sorted_child_); end; @@ -17852,6 +17934,8 @@ begin class(OpenXmlElement).Copy(_obj); if not ifnil(_obj.Ignorable) then {self.}Ignorable := _obj.Ignorable; + if not ifnil(_obj.XmlChildSdt) then + {self.}Sdt.Copy(_obj.XmlChildSdt); tslassigning := tslassigning_backup; end; @@ -17870,6 +17954,16 @@ begin {self.}XmlAttrIgnorable.Value := _value; end; +function Ftr.ReadXmlChildSdt(): Sdt; +begin + if tslassigning and ifnil({self.}XmlChildSdt) then + begin + {self.}XmlChildSdt := new Sdt(self, {self.}Prefix, "sdt"); + container_.Set({self.}XmlChildSdt); + end + return {self.}XmlChildSdt; +end; + function Ftr.ReadPs(_index); begin ind := ifnil(_index) ? -2 : _index; diff --git a/autounit/DocxMLAdapter.tsf b/autounit/DocxMLAdapter.tsf index 457b466..90615ba 100644 --- a/autounit/DocxMLAdapter.tsf +++ b/autounit/DocxMLAdapter.tsf @@ -74,12 +74,12 @@ public function Create(_obj: EndnotePr); function Init(); - function GetEndnoteById(_key: string); - function SetEndnoteById(_key: string; _value: tslobj); + function GetFootnoteById(_key: string); + function SetFootnoteById(_key: string; _value: tslobj); private object_: EndnotePr; - endnote_hash_: tableArray; + footnote_hash_: tableArray; end; type StylesAdapter = class @@ -263,25 +263,25 @@ end; function EndnotePrAdapter.Create(_obj: EndnotePr); begin object_ := _obj; - endnote_hash_ := array(); + footnote_hash_ := array(); {self.}Init(); end; function EndnotePrAdapter.Init(); begin - elements := object_.Endnotes(); + elements := object_.Footnotes(); for k,v in elements do - endnote_hash_[v.Id] := v; + footnote_hash_[v.Id] := v; end; -function EndnotePrAdapter.GetEndnoteById(_key: string); +function EndnotePrAdapter.GetFootnoteById(_key: string); begin - return endnote_hash_[_key]; + return footnote_hash_[_key]; end; -function EndnotePrAdapter.SetEndnoteById(_key: string; _value: tslobj); +function EndnotePrAdapter.SetFootnoteById(_key: string; _value: tslobj); begin - endnote_hash_[_key] := _value; + footnote_hash_[_key] := _value; end; function StylesAdapter.Create(_obj: Styles); diff --git a/autounit/DocxMLUnitDecorator.tsf b/autounit/DocxMLUnitDecorator.tsf index 188db53..36b9ccc 100644 --- a/autounit/DocxMLUnitDecorator.tsf +++ b/autounit/DocxMLUnitDecorator.tsf @@ -3064,6 +3064,11 @@ begin elems := object_.Ps(); for _,elem in elems do {self.}AppendChild(new PUnitDecorator(elem)); + elems := object_.Rs(); + for _,elem in elems do + {self.}AppendChild(new RUnitDecorator(elem)); + if not ifnil(object_.XmlChildSdt) then + {self.}XmlChildSdt := new SdtUnitDecorator(object_.XmlChildSdt); tslassigning := tslassigning_backup; end; @@ -3640,6 +3645,8 @@ begin {self.}XmlChildNumFmt := new PureWValUnitDecorator(object_.XmlChildNumFmt); if not ifnil(object_.XmlChildNumStart) then {self.}XmlChildNumStart := new PureWValUnitDecorator(object_.XmlChildNumStart); + if not ifnil(object_.XmlChildNumRestart) then + {self.}XmlChildNumRestart := new PureWValUnitDecorator(object_.XmlChildNumRestart); elems := object_.Footnotes(); for _,elem in elems do {self.}AppendChild(new FootnoteUnitDecorator(elem)); @@ -3668,9 +3675,11 @@ begin {self.}XmlChildNumFmt := new PureWValUnitDecorator(object_.XmlChildNumFmt); if not ifnil(object_.XmlChildNumStart) then {self.}XmlChildNumStart := new PureWValUnitDecorator(object_.XmlChildNumStart); - elems := object_.Endnotes(); + if not ifnil(object_.XmlChildNumRestart) then + {self.}XmlChildNumRestart := new PureWValUnitDecorator(object_.XmlChildNumRestart); + elems := object_.Footnotes(); for _,elem in elems do - {self.}AppendChild(new EndnoteUnitDecorator(elem)); + {self.}AppendChild(new FootnoteUnitDecorator(elem)); tslassigning := tslassigning_backup; end; @@ -4356,6 +4365,8 @@ begin elems := object_.Ps(); for _,elem in elems do {self.}AppendChild(new PUnitDecorator(elem)); + if not ifnil(object_.XmlChildSdt) then + {self.}XmlChildSdt := new SdtUnitDecorator(object_.XmlChildSdt); tslassigning := tslassigning_backup; end;