From 7fe85108f620c8ab71dd5dbc5be91d3ed62cfc33 Mon Sep 17 00:00:00 2001 From: csh Date: Mon, 2 Sep 2024 13:52:39 +0800 Subject: [PATCH] update docxconfig --- .../docx/AnchorUnitDecorator@DOCX.tsf | 48 +++ .../docx/BodyPrUnitDecorator@DOCX.tsf | 13 + .../docx/CNvSpPrUnitDecorator@DOCX.tsf | 27 ++ .../docx/ChartSpaceUnitDecorator@DOCX.tsf | 1 - .../docx/ChoiceUnitDecorator@DOCX.tsf | 1 + .../docx/DrawingUnitDecorator@DOCX.tsf | 1 + .../docx/FallbackUnitDecorator@DOCX.tsf | 1 + .../docx/FldSimpleUnitDecorator@DOCX.tsf | 26 ++ .../docx/GraphicDataUnitDecorator@DOCX.tsf | 1 + .../decorator/docx/PathUnitDecorator@DOCX.tsf | 27 ++ .../decorator/docx/PictUnitDecorator@DOCX.tsf | 27 ++ .../docx/PositionHUnitDecorator@DOCX.tsf | 27 ++ .../docx/PositionVUnitDecorator@DOCX.tsf | 27 ++ .../docx/PrstTxWrapUnitDecorator@DOCX.tsf | 27 ++ .../decorator/docx/RUnitDecorator@DOCX.tsf | 1 + .../docx/ScalingUnitDecorator@DOCX.tsf | 1 - .../docx/SectPrUnitDecorator@DOCX.tsf | 1 + .../docx/ShapeUnitDecorator@DOCX.tsf | 32 ++ .../docx/ShapetypeUnitDecorator@DOCX.tsf | 32 ++ .../docx/SizeRelHUnitDecorator@DOCX.tsf | 27 ++ .../docx/SizeRelVUnitDecorator@DOCX.tsf | 27 ++ .../docx/SpLocksUnitDecorator@DOCX.tsf | 26 ++ .../decorator/docx/SpPrUnitDecorator@DOCX.tsf | 1 + .../docx/StrokeUnitDecorator@DOCX.tsf | 26 ++ .../docx/StyleUnitDecorator@DOCX.tsf | 1 - .../docx/TextboxUnitDecorator@DOCX.tsf | 26 ++ .../docx/TxbxContentUnitDecorator@DOCX.tsf | 25 ++ .../decorator/docx/TxbxUnitDecorator@DOCX.tsf | 26 ++ .../docx/WpsStyleUnitDecorator@DOCX.tsf | 29 ++ .../decorator/docx/WspUnitDecorator@DOCX.tsf | 30 ++ .../decorator/docx/XRefUnitDecorator@DOCX.tsf | 27 ++ autoclass/docx/AlternateContent@DOCX.tsf | 2 +- autoclass/docx/Anchor@DOCX.tsf | 379 ++++++++++++++++++ autoclass/docx/BodyPr@DOCX.tsf | 255 +++++++++++- autoclass/docx/CNvSpPr@DOCX.tsf | 117 ++++++ autoclass/docx/ChartSpace@DOCX.tsf | 2 +- autoclass/docx/Choice@DOCX.tsf | 5 + autoclass/docx/Drawing@DOCX.tsf | 5 + autoclass/docx/Fallback@DOCX.tsf | 5 + autoclass/docx/FldSimple@DOCX.tsf | 154 +++++++ autoclass/docx/GraphicData@DOCX.tsf | 5 + autoclass/docx/P@DOCX.tsf | 41 ++ autoclass/docx/Path@DOCX.tsf | 99 +++++ autoclass/docx/Pict@DOCX.tsf | 103 +++++ autoclass/docx/PositionH@DOCX.tsf | 117 ++++++ autoclass/docx/PositionV@DOCX.tsf | 117 ++++++ autoclass/docx/PrstTxWrap@DOCX.tsf | 131 ++++++ autoclass/docx/R@DOCX.tsf | 55 +-- autoclass/docx/Rich@DOCX.tsf | 4 +- autoclass/docx/SectPr@DOCX.tsf | 23 +- autoclass/docx/Shape@DOCX.tsf | 207 ++++++++++ autoclass/docx/Shapetype@DOCX.tsf | 194 +++++++++ autoclass/docx/SizeRelH@DOCX.tsf | 117 ++++++ autoclass/docx/SizeRelV@DOCX.tsf | 117 ++++++ autoclass/docx/SpLocks@DOCX.tsf | 81 ++++ autoclass/docx/SpPr@DOCX.tsf | 19 + autoclass/docx/Stroke@DOCX.tsf | 81 ++++ autoclass/docx/Textbox@DOCX.tsf | 98 +++++ autoclass/docx/TxPr@DOCX.tsf | 4 +- autoclass/docx/Txbx@DOCX.tsf | 98 +++++ autoclass/docx/TxbxContent@DOCX.tsf | 137 +++++++ autoclass/docx/WpsStyle@DOCX.tsf | 113 ++++++ autoclass/docx/Wsp@DOCX.tsf | 118 ++++++ autoclass/docx/XRef@DOCX.tsf | 117 ++++++ docx/Components@DOCX.tsf | 22 +- openxml/OpenXmlEmpty.tsf | 1 + 66 files changed, 3676 insertions(+), 59 deletions(-) create mode 100644 autoclass/decorator/docx/AnchorUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/CNvSpPrUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/FldSimpleUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/PathUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/PictUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/PositionHUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/PositionVUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/PrstTxWrapUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/ShapeUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/ShapetypeUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/SizeRelHUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/SizeRelVUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/SpLocksUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/StrokeUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/TextboxUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/TxbxContentUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/TxbxUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/WpsStyleUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/WspUnitDecorator@DOCX.tsf create mode 100644 autoclass/decorator/docx/XRefUnitDecorator@DOCX.tsf create mode 100644 autoclass/docx/Anchor@DOCX.tsf create mode 100644 autoclass/docx/CNvSpPr@DOCX.tsf create mode 100644 autoclass/docx/FldSimple@DOCX.tsf create mode 100644 autoclass/docx/Path@DOCX.tsf create mode 100644 autoclass/docx/Pict@DOCX.tsf create mode 100644 autoclass/docx/PositionH@DOCX.tsf create mode 100644 autoclass/docx/PositionV@DOCX.tsf create mode 100644 autoclass/docx/PrstTxWrap@DOCX.tsf create mode 100644 autoclass/docx/Shape@DOCX.tsf create mode 100644 autoclass/docx/Shapetype@DOCX.tsf create mode 100644 autoclass/docx/SizeRelH@DOCX.tsf create mode 100644 autoclass/docx/SizeRelV@DOCX.tsf create mode 100644 autoclass/docx/SpLocks@DOCX.tsf create mode 100644 autoclass/docx/Stroke@DOCX.tsf create mode 100644 autoclass/docx/Textbox@DOCX.tsf create mode 100644 autoclass/docx/Txbx@DOCX.tsf create mode 100644 autoclass/docx/TxbxContent@DOCX.tsf create mode 100644 autoclass/docx/WpsStyle@DOCX.tsf create mode 100644 autoclass/docx/Wsp@DOCX.tsf create mode 100644 autoclass/docx/XRef@DOCX.tsf diff --git a/autoclass/decorator/docx/AnchorUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/AnchorUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..fcdcd4b --- /dev/null +++ b/autoclass/decorator/docx/AnchorUnitDecorator@DOCX.tsf @@ -0,0 +1,48 @@ +type AnchorUnitDecorator = class(Anchor) +uses TSSafeUnitConverter; +public + function Create(_obj: Anchor); + function GetObject(); + function Convert(); +private + object_: Anchor; +end; + +function AnchorUnitDecorator.Create(_obj: Anchor); +begin + class(Anchor).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function AnchorUnitDecorator.GetObject(); +begin + return object_; +end; + +function AnchorUnitDecorator.Convert(); +begin + {self.}XmlAttrDistT.Value := object_.XmlAttrDistT.Value; + {self.}XmlAttrDistB.Value := object_.XmlAttrDistB.Value; + {self.}XmlAttrDistL.Value := object_.XmlAttrDistL.Value; + {self.}XmlAttrDistR.Value := object_.XmlAttrDistR.Value; + {self.}XmlAttrSimplePos.Value := object_.XmlAttrSimplePos.Value; + {self.}XmlAttrRelativeHeight.Value := object_.XmlAttrRelativeHeight.Value; + {self.}XmlAttrBehindDoc.Value := object_.XmlAttrBehindDoc.Value; + {self.}XmlAttrLocked.Value := object_.XmlAttrLocked.Value; + {self.}XmlAttrLayoutInCell.Value := object_.XmlAttrLayoutInCell.Value; + {self.}XmlAttrAllowOverlap.Value := object_.XmlAttrAllowOverlap.Value; + {self.}XmlAttrAnchorId.Value := object_.XmlAttrAnchorId.Value; + {self.}XmlAttrEditId.Value := object_.XmlAttrEditId.Value; + {self.}SimplePos := new XYUnitDecorator(object_.SimplePos); + {self.}PositionH := new PositionHUnitDecorator(object_.PositionH); + {self.}PositionV := new PositionVUnitDecorator(object_.PositionV); + {self.}Extent := new CXYUnitDecorator(object_.Extent); + {self.}EffectExtent := new EffectExtentUnitDecorator(object_.EffectExtent); + if not ifnil(object_.XmlChildWrapNone.Value) then {self.}XmlChildWrapNone.Value := object_.XmlChildWrapNone.Value; + {self.}DocPr := new DocPrUnitDecorator(object_.DocPr); + {self.}CNvGraphicFramePr := new CNvGraphicFramePrUnitDecorator(object_.CNvGraphicFramePr); + {self.}Graphic := new GraphicUnitDecorator(object_.Graphic); + {self.}SizeRelH := new SizeRelHUnitDecorator(object_.SizeRelH); + {self.}SizeRelV := new SizeRelVUnitDecorator(object_.SizeRelV); +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/BodyPrUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/BodyPrUnitDecorator@DOCX.tsf index b0fe97f..f0e411e 100644 --- a/autoclass/decorator/docx/BodyPrUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/BodyPrUnitDecorator@DOCX.tsf @@ -25,8 +25,21 @@ begin {self.}XmlAttrRot.Value := object_.XmlAttrRot.Value; {self.}XmlAttrSpcFirstLastPara.Value := object_.XmlAttrSpcFirstLastPara.Value; {self.}XmlAttrVertOverflow.Value := object_.XmlAttrVertOverflow.Value; + {self.}XmlAttrHorzOverflow.Value := object_.XmlAttrHorzOverflow.Value; {self.}XmlAttrVert.Value := object_.XmlAttrVert.Value; {self.}XmlAttrWrap.Value := object_.XmlAttrWrap.Value; + {self.}XmlAttrLIns.Value := TSSafeUnitConverter.EmusToPoints(object_.XmlAttrLIns.Value); + {self.}XmlAttrTIns.Value := TSSafeUnitConverter.EmusToPoints(object_.XmlAttrTIns.Value); + {self.}XmlAttrRIns.Value := TSSafeUnitConverter.EmusToPoints(object_.XmlAttrRIns.Value); + {self.}XmlAttrBIns.Value := TSSafeUnitConverter.EmusToPoints(object_.XmlAttrBIns.Value); + {self.}XmlAttrNumCol.Value := object_.XmlAttrNumCol.Value; + {self.}XmlAttrSpcCol.Value := object_.XmlAttrSpcCol.Value; + {self.}XmlAttrRtlCol.Value := object_.XmlAttrRtlCol.Value; + {self.}XmlAttrFromWordArt.Value := object_.XmlAttrFromWordArt.Value; {self.}XmlAttrAnchor.Value := object_.XmlAttrAnchor.Value; {self.}XmlAttrAnchorCtr.Value := object_.XmlAttrAnchorCtr.Value; + {self.}XmlAttrForceAA.Value := object_.XmlAttrForceAA.Value; + {self.}XmlAttrCompatLnSpc.Value := object_.XmlAttrCompatLnSpc.Value; + {self.}PrstTxWrap := new PrstTxWrapUnitDecorator(object_.PrstTxWrap); + if not ifnil(object_.XmlChildNoAutofit.Value) then {self.}XmlChildNoAutofit.Value := object_.XmlChildNoAutofit.Value; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/CNvSpPrUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/CNvSpPrUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..f1695af --- /dev/null +++ b/autoclass/decorator/docx/CNvSpPrUnitDecorator@DOCX.tsf @@ -0,0 +1,27 @@ +type CNvSpPrUnitDecorator = class(CNvSpPr) +uses TSSafeUnitConverter; +public + function Create(_obj: CNvSpPr); + function GetObject(); + function Convert(); +private + object_: CNvSpPr; +end; + +function CNvSpPrUnitDecorator.Create(_obj: CNvSpPr); +begin + class(CNvSpPr).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function CNvSpPrUnitDecorator.GetObject(); +begin + return object_; +end; + +function CNvSpPrUnitDecorator.Convert(); +begin + {self.}XmlAttrTxBox.Value := object_.XmlAttrTxBox.Value; + {self.}SpLocks := new SpLocksUnitDecorator(object_.SpLocks); +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/ChartSpaceUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/ChartSpaceUnitDecorator@DOCX.tsf index d73d813..a609da0 100644 --- a/autoclass/decorator/docx/ChartSpaceUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/ChartSpaceUnitDecorator@DOCX.tsf @@ -27,7 +27,6 @@ begin {self.}XmlAttrXmlnsR.Value := object_.XmlAttrXmlnsR.Value; {self.}Date1904 := new PureValUnitDecorator(object_.Date1904); {self.}Lang := new PureValUnitDecorator(object_.Lang); - if not ifnil(object_.XmlChildLang.Value) then {self.}XmlChildLang.Value := object_.XmlChildLang.Value; {self.}AlternateContent := new AlternateContentUnitDecorator(object_.AlternateContent); {self.}Chart := new ChartUnitDecorator(object_.Chart); {self.}SpPr := new SpPrUnitDecorator(object_.SpPr); diff --git a/autoclass/decorator/docx/ChoiceUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/ChoiceUnitDecorator@DOCX.tsf index f2304d6..c616a1b 100644 --- a/autoclass/decorator/docx/ChoiceUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/ChoiceUnitDecorator@DOCX.tsf @@ -25,4 +25,5 @@ begin {self.}XmlAttrRequires.Value := object_.XmlAttrRequires.Value; {self.}XmlAttrXmlnsC14.Value := object_.XmlAttrXmlnsC14.Value; {self.}Style := new PureValUnitDecorator(object_.Style); + {self.}Drawing := new DrawingUnitDecorator(object_.Drawing); end; \ No newline at end of file diff --git a/autoclass/decorator/docx/DrawingUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/DrawingUnitDecorator@DOCX.tsf index 90ea822..0e6b816 100644 --- a/autoclass/decorator/docx/DrawingUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/DrawingUnitDecorator@DOCX.tsf @@ -23,4 +23,5 @@ end; function DrawingUnitDecorator.Convert(); begin {self.}_Inline := new _InlineUnitDecorator(object_._Inline); + {self.}Anchor := new AnchorUnitDecorator(object_.Anchor); end; \ No newline at end of file diff --git a/autoclass/decorator/docx/FallbackUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/FallbackUnitDecorator@DOCX.tsf index 9c92967..d58c554 100644 --- a/autoclass/decorator/docx/FallbackUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/FallbackUnitDecorator@DOCX.tsf @@ -23,4 +23,5 @@ end; function FallbackUnitDecorator.Convert(); begin {self.}Style := new PureValUnitDecorator(object_.Style); + {self.}Pict := new PictUnitDecorator(object_.Pict); end; \ No newline at end of file diff --git a/autoclass/decorator/docx/FldSimpleUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/FldSimpleUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..edb0909 --- /dev/null +++ b/autoclass/decorator/docx/FldSimpleUnitDecorator@DOCX.tsf @@ -0,0 +1,26 @@ +type FldSimpleUnitDecorator = class(FldSimple) +uses TSSafeUnitConverter; +public + function Create(_obj: FldSimple); + function GetObject(); + function Convert(); +private + object_: FldSimple; +end; + +function FldSimpleUnitDecorator.Create(_obj: FldSimple); +begin + class(FldSimple).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function FldSimpleUnitDecorator.GetObject(); +begin + return object_; +end; + +function FldSimpleUnitDecorator.Convert(); +begin + {self.}XmlAttrInstr.Value := object_.XmlAttrInstr.Value; +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/GraphicDataUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/GraphicDataUnitDecorator@DOCX.tsf index f9b4ba8..1df5488 100644 --- a/autoclass/decorator/docx/GraphicDataUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/GraphicDataUnitDecorator@DOCX.tsf @@ -25,4 +25,5 @@ begin {self.}XmlAttrUri.Value := object_.XmlAttrUri.Value; {self.}Pic := new PicUnitDecorator(object_.Pic); {self.}Chart := new ChartUnitDecorator(object_.Chart); + {self.}Wsp := new WspUnitDecorator(object_.Wsp); end; \ No newline at end of file diff --git a/autoclass/decorator/docx/PathUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/PathUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..a62c0b3 --- /dev/null +++ b/autoclass/decorator/docx/PathUnitDecorator@DOCX.tsf @@ -0,0 +1,27 @@ +type PathUnitDecorator = class(Path) +uses TSSafeUnitConverter; +public + function Create(_obj: Path); + function GetObject(); + function Convert(); +private + object_: Path; +end; + +function PathUnitDecorator.Create(_obj: Path); +begin + class(Path).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function PathUnitDecorator.GetObject(); +begin + return object_; +end; + +function PathUnitDecorator.Convert(); +begin + {self.}XmlAttrGradientshapeok.Value := object_.XmlAttrGradientshapeok.Value; + {self.}XmlAttrConnecttype.Value := object_.XmlAttrConnecttype.Value; +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/PictUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/PictUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..6a357c7 --- /dev/null +++ b/autoclass/decorator/docx/PictUnitDecorator@DOCX.tsf @@ -0,0 +1,27 @@ +type PictUnitDecorator = class(Pict) +uses TSSafeUnitConverter; +public + function Create(_obj: Pict); + function GetObject(); + function Convert(); +private + object_: Pict; +end; + +function PictUnitDecorator.Create(_obj: Pict); +begin + class(Pict).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function PictUnitDecorator.GetObject(); +begin + return object_; +end; + +function PictUnitDecorator.Convert(); +begin + {self.}Shapetype := new ShapetypeUnitDecorator(object_.Shapetype); + {self.}Shape := new ShapeUnitDecorator(object_.Shape); +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/PositionHUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/PositionHUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..4c4be12 --- /dev/null +++ b/autoclass/decorator/docx/PositionHUnitDecorator@DOCX.tsf @@ -0,0 +1,27 @@ +type PositionHUnitDecorator = class(PositionH) +uses TSSafeUnitConverter; +public + function Create(_obj: PositionH); + function GetObject(); + function Convert(); +private + object_: PositionH; +end; + +function PositionHUnitDecorator.Create(_obj: PositionH); +begin + class(PositionH).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function PositionHUnitDecorator.GetObject(); +begin + return object_; +end; + +function PositionHUnitDecorator.Convert(); +begin + {self.}XmlAttrRelativeFrom.Value := object_.XmlAttrRelativeFrom.Value; + {self.}PosOffset.Text := TSSafeUnitConverter.EmusToPoints(object_.PosOffset.Text); +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/PositionVUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/PositionVUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..ed3afb5 --- /dev/null +++ b/autoclass/decorator/docx/PositionVUnitDecorator@DOCX.tsf @@ -0,0 +1,27 @@ +type PositionVUnitDecorator = class(PositionV) +uses TSSafeUnitConverter; +public + function Create(_obj: PositionV); + function GetObject(); + function Convert(); +private + object_: PositionV; +end; + +function PositionVUnitDecorator.Create(_obj: PositionV); +begin + class(PositionV).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function PositionVUnitDecorator.GetObject(); +begin + return object_; +end; + +function PositionVUnitDecorator.Convert(); +begin + {self.}XmlAttrRelativeFrom.Value := object_.XmlAttrRelativeFrom.Value; + {self.}PosOffset.Text := TSSafeUnitConverter.EmusToPoints(object_.PosOffset.Text); +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/PrstTxWrapUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/PrstTxWrapUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..424b5fc --- /dev/null +++ b/autoclass/decorator/docx/PrstTxWrapUnitDecorator@DOCX.tsf @@ -0,0 +1,27 @@ +type PrstTxWrapUnitDecorator = class(PrstTxWrap) +uses TSSafeUnitConverter; +public + function Create(_obj: PrstTxWrap); + function GetObject(); + function Convert(); +private + object_: PrstTxWrap; +end; + +function PrstTxWrapUnitDecorator.Create(_obj: PrstTxWrap); +begin + class(PrstTxWrap).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function PrstTxWrapUnitDecorator.GetObject(); +begin + return object_; +end; + +function PrstTxWrapUnitDecorator.Convert(); +begin + {self.}XmlAttrPrst.Value := object_.XmlAttrPrst.Value; + if not ifnil(object_.XmlChildAvLst.Value) then {self.}XmlChildAvLst.Value := object_.XmlChildAvLst.Value; +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/RUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/RUnitDecorator@DOCX.tsf index 6700d07..2e1de8e 100644 --- a/autoclass/decorator/docx/RUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/RUnitDecorator@DOCX.tsf @@ -32,6 +32,7 @@ begin if not ifnil(object_.XmlChildSeparator.Value) then {self.}XmlChildSeparator.Value := object_.XmlChildSeparator.Value; if not ifnil(object_.XmlChildContinuationSeparator.Value) then {self.}XmlChildContinuationSeparator.Value := object_.XmlChildContinuationSeparator.Value; if not ifnil(object_.XmlChildLastRenderedPageBreak.Value) then {self.}XmlChildLastRenderedPageBreak.Value := object_.XmlChildLastRenderedPageBreak.Value; + {self.}AlternateContent := new AlternateContentUnitDecorator(object_.AlternateContent); {self.}Drawing := new DrawingUnitDecorator(object_.Drawing); {self.}T := new TUnitDecorator(object_.T); end; \ No newline at end of file diff --git a/autoclass/decorator/docx/ScalingUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/ScalingUnitDecorator@DOCX.tsf index 3bd3a72..5c28937 100644 --- a/autoclass/decorator/docx/ScalingUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/ScalingUnitDecorator@DOCX.tsf @@ -23,5 +23,4 @@ end; function ScalingUnitDecorator.Convert(); begin {self.}Orientation := new PureValUnitDecorator(object_.Orientation); - if not ifnil(object_.XmlChildOrientation.Value) then {self.}XmlChildOrientation.Value := object_.XmlChildOrientation.Value; end; \ No newline at end of file diff --git a/autoclass/decorator/docx/SectPrUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/SectPrUnitDecorator@DOCX.tsf index 6596c9a..488a53f 100644 --- a/autoclass/decorator/docx/SectPrUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/SectPrUnitDecorator@DOCX.tsf @@ -29,5 +29,6 @@ begin {self.}PgMar := new PgMarUnitDecorator(object_.PgMar); {self.}PgNumType := new PgNumTypeUnitDecorator(object_.PgNumType); {self.}Cols := new ColsUnitDecorator(object_.Cols); + if not ifnil(object_.XmlChildTitlePg.Value) then {self.}XmlChildTitlePg.Value := object_.XmlChildTitlePg.Value; {self.}DocGrid := new docGridUnitDecorator(object_.DocGrid); end; \ No newline at end of file diff --git a/autoclass/decorator/docx/ShapeUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/ShapeUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..574aaf4 --- /dev/null +++ b/autoclass/decorator/docx/ShapeUnitDecorator@DOCX.tsf @@ -0,0 +1,32 @@ +type ShapeUnitDecorator = class(Shape) +uses TSSafeUnitConverter; +public + function Create(_obj: Shape); + function GetObject(); + function Convert(); +private + object_: Shape; +end; + +function ShapeUnitDecorator.Create(_obj: Shape); +begin + class(Shape).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function ShapeUnitDecorator.GetObject(); +begin + return object_; +end; + +function ShapeUnitDecorator.Convert(); +begin + {self.}XmlAttrId.Value := object_.XmlAttrId.Value; + {self.}XmlAttrSpid.Value := object_.XmlAttrSpid.Value; + {self.}XmlAttrType.Value := object_.XmlAttrType.Value; + {self.}XmlAttrGfxdata.Value := object_.XmlAttrGfxdata.Value; + {self.}XmlAttrFilled.Value := object_.XmlAttrFilled.Value; + {self.}XmlAttrStroked.Value := object_.XmlAttrStroked.Value; + {self.}Textbox := new TextboxUnitDecorator(object_.Textbox); +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/ShapetypeUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/ShapetypeUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..e413544 --- /dev/null +++ b/autoclass/decorator/docx/ShapetypeUnitDecorator@DOCX.tsf @@ -0,0 +1,32 @@ +type ShapetypeUnitDecorator = class(Shapetype) +uses TSSafeUnitConverter; +public + function Create(_obj: Shapetype); + function GetObject(); + function Convert(); +private + object_: Shapetype; +end; + +function ShapetypeUnitDecorator.Create(_obj: Shapetype); +begin + class(Shapetype).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function ShapetypeUnitDecorator.GetObject(); +begin + return object_; +end; + +function ShapetypeUnitDecorator.Convert(); +begin + {self.}XmlAttrAnchorId.Value := object_.XmlAttrAnchorId.Value; + {self.}XmlAttrId.Value := object_.XmlAttrId.Value; + {self.}XmlAttrCoordsize.Value := object_.XmlAttrCoordsize.Value; + {self.}XmlAttrSpt.Value := object_.XmlAttrSpt.Value; + {self.}XmlAttrPath.Value := object_.XmlAttrPath.Value; + {self.}Stroke := new StrokeUnitDecorator(object_.Stroke); + {self.}Path := new PathUnitDecorator(object_.Path); +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/SizeRelHUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/SizeRelHUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..28c1dc5 --- /dev/null +++ b/autoclass/decorator/docx/SizeRelHUnitDecorator@DOCX.tsf @@ -0,0 +1,27 @@ +type SizeRelHUnitDecorator = class(SizeRelH) +uses TSSafeUnitConverter; +public + function Create(_obj: SizeRelH); + function GetObject(); + function Convert(); +private + object_: SizeRelH; +end; + +function SizeRelHUnitDecorator.Create(_obj: SizeRelH); +begin + class(SizeRelH).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function SizeRelHUnitDecorator.GetObject(); +begin + return object_; +end; + +function SizeRelHUnitDecorator.Convert(); +begin + {self.}XmlAttrRelativeFrom.Value := object_.XmlAttrRelativeFrom.Value; + {self.}PctWidth.Text := TSSafeUnitConverter.EmusToPoints(object_.PctWidth.Text); +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/SizeRelVUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/SizeRelVUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..3a59042 --- /dev/null +++ b/autoclass/decorator/docx/SizeRelVUnitDecorator@DOCX.tsf @@ -0,0 +1,27 @@ +type SizeRelVUnitDecorator = class(SizeRelV) +uses TSSafeUnitConverter; +public + function Create(_obj: SizeRelV); + function GetObject(); + function Convert(); +private + object_: SizeRelV; +end; + +function SizeRelVUnitDecorator.Create(_obj: SizeRelV); +begin + class(SizeRelV).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function SizeRelVUnitDecorator.GetObject(); +begin + return object_; +end; + +function SizeRelVUnitDecorator.Convert(); +begin + {self.}XmlAttrRelativeFrom.Value := object_.XmlAttrRelativeFrom.Value; + {self.}PctHeight.Text := TSSafeUnitConverter.EmusToPoints(object_.PctHeight.Text); +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/SpLocksUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/SpLocksUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..20676aa --- /dev/null +++ b/autoclass/decorator/docx/SpLocksUnitDecorator@DOCX.tsf @@ -0,0 +1,26 @@ +type SpLocksUnitDecorator = class(SpLocks) +uses TSSafeUnitConverter; +public + function Create(_obj: SpLocks); + function GetObject(); + function Convert(); +private + object_: SpLocks; +end; + +function SpLocksUnitDecorator.Create(_obj: SpLocks); +begin + class(SpLocks).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function SpLocksUnitDecorator.GetObject(); +begin + return object_; +end; + +function SpLocksUnitDecorator.Convert(); +begin + {self.}XmlAttrNoChangeArrowheads.Value := object_.XmlAttrNoChangeArrowheads.Value; +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/SpPrUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/SpPrUnitDecorator@DOCX.tsf index 35daa11..157fb69 100644 --- a/autoclass/decorator/docx/SpPrUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/SpPrUnitDecorator@DOCX.tsf @@ -22,6 +22,7 @@ end; function SpPrUnitDecorator.Convert(); begin + {self.}XmlAttrBwMode.Value := object_.XmlAttrBwMode.Value; {self.}Xfrm := new XfrmUnitDecorator(object_.Xfrm); {self.}PrstGeom := new PrstGeomUnitDecorator(object_.PrstGeom); if not ifnil(object_.XmlChildNoFill.Value) then {self.}XmlChildNoFill.Value := object_.XmlChildNoFill.Value; diff --git a/autoclass/decorator/docx/StrokeUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/StrokeUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..6ca680f --- /dev/null +++ b/autoclass/decorator/docx/StrokeUnitDecorator@DOCX.tsf @@ -0,0 +1,26 @@ +type StrokeUnitDecorator = class(Stroke) +uses TSSafeUnitConverter; +public + function Create(_obj: Stroke); + function GetObject(); + function Convert(); +private + object_: Stroke; +end; + +function StrokeUnitDecorator.Create(_obj: Stroke); +begin + class(Stroke).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function StrokeUnitDecorator.GetObject(); +begin + return object_; +end; + +function StrokeUnitDecorator.Convert(); +begin + {self.}XmlAttrJoinstyle.Value := object_.XmlAttrJoinstyle.Value; +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/StyleUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/StyleUnitDecorator@DOCX.tsf index 24adc7e..dfeebf4 100644 --- a/autoclass/decorator/docx/StyleUnitDecorator@DOCX.tsf +++ b/autoclass/decorator/docx/StyleUnitDecorator@DOCX.tsf @@ -35,7 +35,6 @@ begin if not ifnil(object_.XmlChildUnhideWhenUsed.Value) then {self.}XmlChildUnhideWhenUsed.Value := object_.XmlChildUnhideWhenUsed.Value; if not ifnil(object_.XmlChildQFormat.Value) then {self.}XmlChildQFormat.Value := object_.XmlChildQFormat.Value; {self.}Rsid := new PureWValUnitDecorator(object_.Rsid); - if not ifnil(object_.XmlChildRsid.Value) then {self.}XmlChildRsid.Value := object_.XmlChildRsid.Value; {self.}PPr := new PPrUnitDecorator(object_.PPr); {self.}RPr := new RPrUnitDecorator(object_.RPr); {self.}TblPr := new TblPrUnitDecorator(object_.TblPr); diff --git a/autoclass/decorator/docx/TextboxUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/TextboxUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..10aa730 --- /dev/null +++ b/autoclass/decorator/docx/TextboxUnitDecorator@DOCX.tsf @@ -0,0 +1,26 @@ +type TextboxUnitDecorator = class(Textbox) +uses TSSafeUnitConverter; +public + function Create(_obj: Textbox); + function GetObject(); + function Convert(); +private + object_: Textbox; +end; + +function TextboxUnitDecorator.Create(_obj: Textbox); +begin + class(Textbox).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function TextboxUnitDecorator.GetObject(); +begin + return object_; +end; + +function TextboxUnitDecorator.Convert(); +begin + {self.}TxbxContent := new TxbxContentUnitDecorator(object_.TxbxContent); +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/TxbxContentUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/TxbxContentUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..0244e1e --- /dev/null +++ b/autoclass/decorator/docx/TxbxContentUnitDecorator@DOCX.tsf @@ -0,0 +1,25 @@ +type TxbxContentUnitDecorator = class(TxbxContent) +uses TSSafeUnitConverter; +public + function Create(_obj: TxbxContent); + function GetObject(); + function Convert(); +private + object_: TxbxContent; +end; + +function TxbxContentUnitDecorator.Create(_obj: TxbxContent); +begin + class(TxbxContent).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function TxbxContentUnitDecorator.GetObject(); +begin + return object_; +end; + +function TxbxContentUnitDecorator.Convert(); +begin +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/TxbxUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/TxbxUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..d850863 --- /dev/null +++ b/autoclass/decorator/docx/TxbxUnitDecorator@DOCX.tsf @@ -0,0 +1,26 @@ +type TxbxUnitDecorator = class(Txbx) +uses TSSafeUnitConverter; +public + function Create(_obj: Txbx); + function GetObject(); + function Convert(); +private + object_: Txbx; +end; + +function TxbxUnitDecorator.Create(_obj: Txbx); +begin + class(Txbx).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function TxbxUnitDecorator.GetObject(); +begin + return object_; +end; + +function TxbxUnitDecorator.Convert(); +begin + {self.}TxbxContent := new TxbxContentUnitDecorator(object_.TxbxContent); +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/WpsStyleUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/WpsStyleUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..29de0ae --- /dev/null +++ b/autoclass/decorator/docx/WpsStyleUnitDecorator@DOCX.tsf @@ -0,0 +1,29 @@ +type WpsStyleUnitDecorator = class(WpsStyle) +uses TSSafeUnitConverter; +public + function Create(_obj: WpsStyle); + function GetObject(); + function Convert(); +private + object_: WpsStyle; +end; + +function WpsStyleUnitDecorator.Create(_obj: WpsStyle); +begin + class(WpsStyle).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function WpsStyleUnitDecorator.GetObject(); +begin + return object_; +end; + +function WpsStyleUnitDecorator.Convert(); +begin + {self.}LnRef := new XRefUnitDecorator(object_.LnRef); + {self.}FillRef := new XRefUnitDecorator(object_.FillRef); + {self.}EffectRef := new XRefUnitDecorator(object_.EffectRef); + {self.}FontRef := new XRefUnitDecorator(object_.FontRef); +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/WspUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/WspUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..b8a9523 --- /dev/null +++ b/autoclass/decorator/docx/WspUnitDecorator@DOCX.tsf @@ -0,0 +1,30 @@ +type WspUnitDecorator = class(Wsp) +uses TSSafeUnitConverter; +public + function Create(_obj: Wsp); + function GetObject(); + function Convert(); +private + object_: Wsp; +end; + +function WspUnitDecorator.Create(_obj: Wsp); +begin + class(Wsp).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function WspUnitDecorator.GetObject(); +begin + return object_; +end; + +function WspUnitDecorator.Convert(); +begin + {self.}CNvSpPr := new CNvSpPrUnitDecorator(object_.CNvSpPr); + {self.}SpPr := new SpPrUnitDecorator(object_.SpPr); + {self.}Txbx := new TxbxUnitDecorator(object_.Txbx); + {self.}Style := new WpsStyleUnitDecorator(object_.Style); + {self.}BodyPr := new BodyPrUnitDecorator(object_.BodyPr); +end; \ No newline at end of file diff --git a/autoclass/decorator/docx/XRefUnitDecorator@DOCX.tsf b/autoclass/decorator/docx/XRefUnitDecorator@DOCX.tsf new file mode 100644 index 0000000..37bf7fe --- /dev/null +++ b/autoclass/decorator/docx/XRefUnitDecorator@DOCX.tsf @@ -0,0 +1,27 @@ +type XRefUnitDecorator = class(XRef) +uses TSSafeUnitConverter; +public + function Create(_obj: XRef); + function GetObject(); + function Convert(); +private + object_: XRef; +end; + +function XRefUnitDecorator.Create(_obj: XRef); +begin + class(XRef).Create(); + object_ := _obj; + {self.}Convert(); +end; + +function XRefUnitDecorator.GetObject(); +begin + return object_; +end; + +function XRefUnitDecorator.Convert(); +begin + {self.}XmlAttrIdx.Value := object_.XmlAttrIdx.Value; + {self.}SchemeClr := new SchemeClrUnitDecorator(object_.SchemeClr); +end; \ No newline at end of file diff --git a/autoclass/docx/AlternateContent@DOCX.tsf b/autoclass/docx/AlternateContent@DOCX.tsf index 4244bf1..d1573d8 100644 --- a/autoclass/docx/AlternateContent@DOCX.tsf +++ b/autoclass/docx/AlternateContent@DOCX.tsf @@ -25,7 +25,7 @@ end; function AlternateContent.Create();overload; begin - {self.}Create(nil, "mc", "alternateContent"); + {self.}Create(nil, "mc", "AlternateContent"); end; function AlternateContent.Create(_node: XmlNode);overload; diff --git a/autoclass/docx/Anchor@DOCX.tsf b/autoclass/docx/Anchor@DOCX.tsf new file mode 100644 index 0000000..0309d53 --- /dev/null +++ b/autoclass/docx/Anchor@DOCX.tsf @@ -0,0 +1,379 @@ +type Anchor = 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 InitAttributes();override; + function InitChildren();override; + function InitNode(_node: XmlNode);override; + function Copy(_obj: Anchor);override; + + property DistT read ReadXmlAttrDistT write WriteXmlAttrDistT; + property DistB read ReadXmlAttrDistB write WriteXmlAttrDistB; + property DistL read ReadXmlAttrDistL write WriteXmlAttrDistL; + property DistR read ReadXmlAttrDistR write WriteXmlAttrDistR; + property SimplePos read ReadXmlAttrSimplePos write WriteXmlAttrSimplePos; + property RelativeHeight read ReadXmlAttrRelativeHeight write WriteXmlAttrRelativeHeight; + property BehindDoc read ReadXmlAttrBehindDoc write WriteXmlAttrBehindDoc; + property Locked read ReadXmlAttrLocked write WriteXmlAttrLocked; + property LayoutInCell read ReadXmlAttrLayoutInCell write WriteXmlAttrLayoutInCell; + property AllowOverlap read ReadXmlAttrAllowOverlap write WriteXmlAttrAllowOverlap; + property AnchorId read ReadXmlAttrAnchorId write WriteXmlAttrAnchorId; + property EditId read ReadXmlAttrEditId write WriteXmlAttrEditId; + function ReadXmlAttrDistT(); + function WriteXmlAttrDistT(_value); + function ReadXmlAttrDistB(); + function WriteXmlAttrDistB(_value); + function ReadXmlAttrDistL(); + function WriteXmlAttrDistL(_value); + function ReadXmlAttrDistR(); + function WriteXmlAttrDistR(_value); + function ReadXmlAttrSimplePos(); + function WriteXmlAttrSimplePos(_value); + function ReadXmlAttrRelativeHeight(); + function WriteXmlAttrRelativeHeight(_value); + function ReadXmlAttrBehindDoc(); + function WriteXmlAttrBehindDoc(_value); + function ReadXmlAttrLocked(); + function WriteXmlAttrLocked(_value); + function ReadXmlAttrLayoutInCell(); + function WriteXmlAttrLayoutInCell(_value); + function ReadXmlAttrAllowOverlap(); + function WriteXmlAttrAllowOverlap(_value); + function ReadXmlAttrAnchorId(); + function WriteXmlAttrAnchorId(_value); + function ReadXmlAttrEditId(); + function WriteXmlAttrEditId(_value); + + property WrapNone read ReadXmlChildWrapNone write WriteXmlChildWrapNone; + function ReadXmlChildWrapNone(); + function WriteXmlChildWrapNone(_value); + +public + // Attributes + XmlAttrDistT: OpenXmlAttribute; + XmlAttrDistB: OpenXmlAttribute; + XmlAttrDistL: OpenXmlAttribute; + XmlAttrDistR: OpenXmlAttribute; + XmlAttrSimplePos: OpenXmlAttribute; + XmlAttrRelativeHeight: OpenXmlAttribute; + XmlAttrBehindDoc: OpenXmlAttribute; + XmlAttrLocked: OpenXmlAttribute; + XmlAttrLayoutInCell: OpenXmlAttribute; + XmlAttrAllowOverlap: OpenXmlAttribute; + XmlAttrAnchorId: OpenXmlAttribute; + XmlAttrEditId: OpenXmlAttribute; + + // Children + SimplePos: XY; + PositionH: PositionH; + PositionV: PositionV; + Extent: CXY; + EffectExtent: EffectExtent; + XmlChildWrapNone: OpenXmlEmpty; + DocPr: DocPr; + CNvGraphicFramePr: CNvGraphicFramePr; + Graphic: Graphic; + SizeRelH: SizeRelH; + SizeRelV: SizeRelV; + +end; + +function Anchor.Create();overload; +begin + {self.}Create(nil, "wp", "anchor"); +end; + +function Anchor.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function Anchor.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; +begin + class(OpenXmlElement).Create(_parent, _prefix, _local_name); +end; + +function Anchor.Init();override; +begin + {self.}XmlAttrDistT := new OpenXmlAttribute(nil, "distT", nil); + {self.}XmlAttrDistB := new OpenXmlAttribute(nil, "distB", nil); + {self.}XmlAttrDistL := new OpenXmlAttribute(nil, "distL", nil); + {self.}XmlAttrDistR := new OpenXmlAttribute(nil, "distR", nil); + {self.}XmlAttrSimplePos := new OpenXmlAttribute(nil, "simplePos", nil); + {self.}XmlAttrRelativeHeight := new OpenXmlAttribute(nil, "relativeHeight", nil); + {self.}XmlAttrBehindDoc := new OpenXmlAttribute(nil, "behindDoc", nil); + {self.}XmlAttrLocked := new OpenXmlAttribute(nil, "locked", nil); + {self.}XmlAttrLayoutInCell := new OpenXmlAttribute(nil, "layoutInCell", nil); + {self.}XmlAttrAllowOverlap := new OpenXmlAttribute(nil, "allowOverlap", nil); + {self.}XmlAttrAnchorId := new OpenXmlAttribute("wp14", "anchorId", nil); + {self.}XmlAttrEditId := new OpenXmlAttribute("wp14", "editId", nil); + {self.}SimplePos := new XY(self, {self.}Prefix, "simplePos"); + {self.}PositionH := new PositionH(self, {self.}Prefix, "positionH"); + {self.}PositionV := new PositionV(self, {self.}Prefix, "positionV"); + {self.}Extent := new CXY(self, {self.}Prefix, "extent"); + {self.}EffectExtent := new EffectExtent(self, {self.}Prefix, "effectExtent"); + {self.}XmlChildWrapNone := new OpenXmlEmpty(self, {self.}Prefix, "wrapNone"); + {self.}DocPr := new DocPr(self, {self.}Prefix, "docPr"); + {self.}CNvGraphicFramePr := new CNvGraphicFramePr(self, {self.}Prefix, "cNvGraphicFramePr"); + {self.}Graphic := new Graphic(self, "a", "graphic"); + {self.}SizeRelH := new SizeRelH(self, "wp14", "sizeRelH"); + {self.}SizeRelV := new SizeRelV(self, "wp14", "sizeRelV"); +end; + +function Anchor.InitAttributes();override; +begin + attributes_ := array( + {self.}XmlAttrDistT, + {self.}XmlAttrDistB, + {self.}XmlAttrDistL, + {self.}XmlAttrDistR, + {self.}XmlAttrSimplePos, + {self.}XmlAttrRelativeHeight, + {self.}XmlAttrBehindDoc, + {self.}XmlAttrLocked, + {self.}XmlAttrLayoutInCell, + {self.}XmlAttrAllowOverlap, + {self.}XmlAttrAnchorId, + {self.}XmlAttrEditId, + ); +end; + +function Anchor.InitChildren();override; +begin + child_elements_ := array( + 0: {self.}SimplePos, + 1: {self.}PositionH, + 2: {self.}PositionV, + 3: {self.}Extent, + 4: {self.}EffectExtent, + 5: {self.}XmlChildWrapNone, + 6: {self.}DocPr, + 7: {self.}CNvGraphicFramePr, + 8: {self.}Graphic, + 9: {self.}SizeRelH, + 10: {self.}SizeRelV, + ); + sorted_child_ := array( + "": -1, + {self.}SimplePos.ElementName: 0, + {self.}PositionH.ElementName: 1, + {self.}PositionV.ElementName: 2, + {self.}Extent.ElementName: 3, + {self.}EffectExtent.ElementName: 4, + {self.}XmlChildWrapNone.ElementName: 5, + {self.}DocPr.ElementName: 6, + {self.}CNvGraphicFramePr.ElementName: 7, + {self.}Graphic.ElementName: 8, + {self.}SizeRelH.ElementName: 9, + {self.}SizeRelV.ElementName: 10, + ); +end; + +function Anchor.InitNode(_node: XmlNode);override; +begin + if ifObj({self.}XmlNode) then + for k,v in child_elements_ do v.InitNode(nil); + {self.}XmlNode := ifObj(_node) ? _node : nil; + node := ifObj(_node) ? _node.FirstChild() : nil; + flag := false; + if ifnil(child_elements_[0]) and length(child_elements_) > 0 then + begin + flag := true; + arr := child_elements_; + child_elements_ := array(); + end + pre := ifString({self.}Prefix) ? {self.}Prefix + ":" : ""; + while ifObj(node) do + begin + node_name := node.GetName(); + pos := sorted_child_[node_name]; + if ifnil(pos) or pos = -1 then + begin + obj := nil; + case node_name of + end; + if ifObj(obj) then obj.InitNode(node); + end + else if flag then + begin + obj := arr[pos]; + obj.InitNode(node); + child_elements_[length(child_elements_)] := obj; + end + else begin + child_elements_[pos].InitNode(node); + end + node := node.NextElement(); + end +end; + +function Anchor.Copy(_obj: Anchor);override; +begin + if not ifnil(_obj.XmlAttrDistT.Value) then + {self.}XmlAttrDistT.Value := _obj.XmlAttrDistT.Value; + if not ifnil(_obj.XmlAttrDistB.Value) then + {self.}XmlAttrDistB.Value := _obj.XmlAttrDistB.Value; + if not ifnil(_obj.XmlAttrDistL.Value) then + {self.}XmlAttrDistL.Value := _obj.XmlAttrDistL.Value; + if not ifnil(_obj.XmlAttrDistR.Value) then + {self.}XmlAttrDistR.Value := _obj.XmlAttrDistR.Value; + if not ifnil(_obj.XmlAttrSimplePos.Value) then + {self.}XmlAttrSimplePos.Value := _obj.XmlAttrSimplePos.Value; + if not ifnil(_obj.XmlAttrRelativeHeight.Value) then + {self.}XmlAttrRelativeHeight.Value := _obj.XmlAttrRelativeHeight.Value; + if not ifnil(_obj.XmlAttrBehindDoc.Value) then + {self.}XmlAttrBehindDoc.Value := _obj.XmlAttrBehindDoc.Value; + if not ifnil(_obj.XmlAttrLocked.Value) then + {self.}XmlAttrLocked.Value := _obj.XmlAttrLocked.Value; + if not ifnil(_obj.XmlAttrLayoutInCell.Value) then + {self.}XmlAttrLayoutInCell.Value := _obj.XmlAttrLayoutInCell.Value; + if not ifnil(_obj.XmlAttrAllowOverlap.Value) then + {self.}XmlAttrAllowOverlap.Value := _obj.XmlAttrAllowOverlap.Value; + if not ifnil(_obj.XmlAttrAnchorId.Value) then + {self.}XmlAttrAnchorId.Value := _obj.XmlAttrAnchorId.Value; + if not ifnil(_obj.XmlAttrEditId.Value) then + {self.}XmlAttrEditId.Value := _obj.XmlAttrEditId.Value; + {self.}SimplePos.Copy(_obj.SimplePos); + {self.}PositionH.Copy(_obj.PositionH); + {self.}PositionV.Copy(_obj.PositionV); + {self.}Extent.Copy(_obj.Extent); + {self.}EffectExtent.Copy(_obj.EffectExtent); + {self.}XmlChildWrapNone.Copy(_obj.XmlChildWrapNone); + {self.}DocPr.Copy(_obj.DocPr); + {self.}CNvGraphicFramePr.Copy(_obj.CNvGraphicFramePr); + {self.}Graphic.Copy(_obj.Graphic); + {self.}SizeRelH.Copy(_obj.SizeRelH); + {self.}SizeRelV.Copy(_obj.SizeRelV); +end; + +function Anchor.ReadXmlAttrDistT(); +begin + return {self.}XmlAttrDistT.Value; +end; + +function Anchor.WriteXmlAttrDistT(_value); +begin + {self.}XmlAttrDistT.Value := _value; +end; + +function Anchor.ReadXmlAttrDistB(); +begin + return {self.}XmlAttrDistB.Value; +end; + +function Anchor.WriteXmlAttrDistB(_value); +begin + {self.}XmlAttrDistB.Value := _value; +end; + +function Anchor.ReadXmlAttrDistL(); +begin + return {self.}XmlAttrDistL.Value; +end; + +function Anchor.WriteXmlAttrDistL(_value); +begin + {self.}XmlAttrDistL.Value := _value; +end; + +function Anchor.ReadXmlAttrDistR(); +begin + return {self.}XmlAttrDistR.Value; +end; + +function Anchor.WriteXmlAttrDistR(_value); +begin + {self.}XmlAttrDistR.Value := _value; +end; + +function Anchor.ReadXmlAttrSimplePos(); +begin + return {self.}XmlAttrSimplePos.Value; +end; + +function Anchor.WriteXmlAttrSimplePos(_value); +begin + {self.}XmlAttrSimplePos.Value := _value; +end; + +function Anchor.ReadXmlAttrRelativeHeight(); +begin + return {self.}XmlAttrRelativeHeight.Value; +end; + +function Anchor.WriteXmlAttrRelativeHeight(_value); +begin + {self.}XmlAttrRelativeHeight.Value := _value; +end; + +function Anchor.ReadXmlAttrBehindDoc(); +begin + return {self.}XmlAttrBehindDoc.Value; +end; + +function Anchor.WriteXmlAttrBehindDoc(_value); +begin + {self.}XmlAttrBehindDoc.Value := _value; +end; + +function Anchor.ReadXmlAttrLocked(); +begin + return {self.}XmlAttrLocked.Value; +end; + +function Anchor.WriteXmlAttrLocked(_value); +begin + {self.}XmlAttrLocked.Value := _value; +end; + +function Anchor.ReadXmlAttrLayoutInCell(); +begin + return {self.}XmlAttrLayoutInCell.Value; +end; + +function Anchor.WriteXmlAttrLayoutInCell(_value); +begin + {self.}XmlAttrLayoutInCell.Value := _value; +end; + +function Anchor.ReadXmlAttrAllowOverlap(); +begin + return {self.}XmlAttrAllowOverlap.Value; +end; + +function Anchor.WriteXmlAttrAllowOverlap(_value); +begin + {self.}XmlAttrAllowOverlap.Value := _value; +end; + +function Anchor.ReadXmlAttrAnchorId(); +begin + return {self.}XmlAttrAnchorId.Value; +end; + +function Anchor.WriteXmlAttrAnchorId(_value); +begin + {self.}XmlAttrAnchorId.Value := _value; +end; + +function Anchor.ReadXmlAttrEditId(); +begin + return {self.}XmlAttrEditId.Value; +end; + +function Anchor.WriteXmlAttrEditId(_value); +begin + {self.}XmlAttrEditId.Value := _value; +end; + +function Anchor.ReadXmlChildWrapNone(); +begin + return ifnil({self.}XmlChildWrapNone.Value) ? false : true; +end; + +function Anchor.WriteXmlChildWrapNone(_value); +begin + {self.}XmlChildWrapNone.Value := _value; +end; diff --git a/autoclass/docx/BodyPr@DOCX.tsf b/autoclass/docx/BodyPr@DOCX.tsf index 466ee86..224bb63 100644 --- a/autoclass/docx/BodyPr@DOCX.tsf +++ b/autoclass/docx/BodyPr@DOCX.tsf @@ -12,36 +12,86 @@ public property Rot read ReadXmlAttrRot write WriteXmlAttrRot; property SpcFirstLastPara read ReadXmlAttrSpcFirstLastPara write WriteXmlAttrSpcFirstLastPara; property VertOverflow read ReadXmlAttrVertOverflow write WriteXmlAttrVertOverflow; + property HorzOverflow read ReadXmlAttrHorzOverflow write WriteXmlAttrHorzOverflow; property Vert read ReadXmlAttrVert write WriteXmlAttrVert; property Wrap read ReadXmlAttrWrap write WriteXmlAttrWrap; + property LIns read ReadXmlAttrLIns write WriteXmlAttrLIns; + property TIns read ReadXmlAttrTIns write WriteXmlAttrTIns; + property RIns read ReadXmlAttrRIns write WriteXmlAttrRIns; + property BIns read ReadXmlAttrBIns write WriteXmlAttrBIns; + property NumCol read ReadXmlAttrNumCol write WriteXmlAttrNumCol; + property SpcCol read ReadXmlAttrSpcCol write WriteXmlAttrSpcCol; + property RtlCol read ReadXmlAttrRtlCol write WriteXmlAttrRtlCol; + property FromWordArt read ReadXmlAttrFromWordArt write WriteXmlAttrFromWordArt; property Anchor read ReadXmlAttrAnchor write WriteXmlAttrAnchor; property AnchorCtr read ReadXmlAttrAnchorCtr write WriteXmlAttrAnchorCtr; + property ForceAA read ReadXmlAttrForceAA write WriteXmlAttrForceAA; + property CompatLnSpc read ReadXmlAttrCompatLnSpc write WriteXmlAttrCompatLnSpc; function ReadXmlAttrRot(); function WriteXmlAttrRot(_value); function ReadXmlAttrSpcFirstLastPara(); function WriteXmlAttrSpcFirstLastPara(_value); function ReadXmlAttrVertOverflow(); function WriteXmlAttrVertOverflow(_value); + function ReadXmlAttrHorzOverflow(); + function WriteXmlAttrHorzOverflow(_value); function ReadXmlAttrVert(); function WriteXmlAttrVert(_value); function ReadXmlAttrWrap(); function WriteXmlAttrWrap(_value); + function ReadXmlAttrLIns(); + function WriteXmlAttrLIns(_value); + function ReadXmlAttrTIns(); + function WriteXmlAttrTIns(_value); + function ReadXmlAttrRIns(); + function WriteXmlAttrRIns(_value); + function ReadXmlAttrBIns(); + function WriteXmlAttrBIns(_value); + function ReadXmlAttrNumCol(); + function WriteXmlAttrNumCol(_value); + function ReadXmlAttrSpcCol(); + function WriteXmlAttrSpcCol(_value); + function ReadXmlAttrRtlCol(); + function WriteXmlAttrRtlCol(_value); + function ReadXmlAttrFromWordArt(); + function WriteXmlAttrFromWordArt(_value); function ReadXmlAttrAnchor(); function WriteXmlAttrAnchor(_value); function ReadXmlAttrAnchorCtr(); function WriteXmlAttrAnchorCtr(_value); + function ReadXmlAttrForceAA(); + function WriteXmlAttrForceAA(_value); + function ReadXmlAttrCompatLnSpc(); + function WriteXmlAttrCompatLnSpc(_value); + + property NoAutofit read ReadXmlChildNoAutofit write WriteXmlChildNoAutofit; + function ReadXmlChildNoAutofit(); + function WriteXmlChildNoAutofit(_value); public // Attributes XmlAttrRot: OpenXmlAttribute; XmlAttrSpcFirstLastPara: OpenXmlAttribute; XmlAttrVertOverflow: OpenXmlAttribute; + XmlAttrHorzOverflow: OpenXmlAttribute; XmlAttrVert: OpenXmlAttribute; XmlAttrWrap: OpenXmlAttribute; + XmlAttrLIns: OpenXmlAttribute; + XmlAttrTIns: OpenXmlAttribute; + XmlAttrRIns: OpenXmlAttribute; + XmlAttrBIns: OpenXmlAttribute; + XmlAttrNumCol: OpenXmlAttribute; + XmlAttrSpcCol: OpenXmlAttribute; + XmlAttrRtlCol: OpenXmlAttribute; + XmlAttrFromWordArt: OpenXmlAttribute; XmlAttrAnchor: OpenXmlAttribute; XmlAttrAnchorCtr: OpenXmlAttribute; + XmlAttrForceAA: OpenXmlAttribute; + XmlAttrCompatLnSpc: OpenXmlAttribute; // Children + PrstTxWrap: PrstTxWrap; + XmlChildNoAutofit: OpenXmlEmpty; end; @@ -65,10 +115,23 @@ begin {self.}XmlAttrRot := new OpenXmlAttribute(nil, "rot", nil); {self.}XmlAttrSpcFirstLastPara := new OpenXmlAttribute(nil, "spcFirstLastPara", nil); {self.}XmlAttrVertOverflow := new OpenXmlAttribute(nil, "vertOverflow", nil); + {self.}XmlAttrHorzOverflow := new OpenXmlAttribute(nil, "horzOverflow", nil); {self.}XmlAttrVert := new OpenXmlAttribute(nil, "vert", nil); - {self.}XmlAttrWrap := new OpenXmlAttribute(nil, "Wrap", nil); + {self.}XmlAttrWrap := new OpenXmlAttribute(nil, "wrap", nil); + {self.}XmlAttrLIns := new OpenXmlAttribute(nil, "lIns", nil); + {self.}XmlAttrTIns := new OpenXmlAttribute(nil, "TIns", nil); + {self.}XmlAttrRIns := new OpenXmlAttribute(nil, "rIns", nil); + {self.}XmlAttrBIns := new OpenXmlAttribute(nil, "bIns", nil); + {self.}XmlAttrNumCol := new OpenXmlAttribute(nil, "numCol", nil); + {self.}XmlAttrSpcCol := new OpenXmlAttribute(nil, "spcCol", nil); + {self.}XmlAttrRtlCol := new OpenXmlAttribute(nil, "rtlCol", nil); + {self.}XmlAttrFromWordArt := new OpenXmlAttribute(nil, "fromWordArt", nil); {self.}XmlAttrAnchor := new OpenXmlAttribute(nil, "anchor", nil); {self.}XmlAttrAnchorCtr := new OpenXmlAttribute(nil, "anchorCtr", nil); + {self.}XmlAttrForceAA := new OpenXmlAttribute(nil, "forceAA", nil); + {self.}XmlAttrCompatLnSpc := new OpenXmlAttribute(nil, "compatLnSpc", nil); + {self.}PrstTxWrap := new PrstTxWrap(self, "a", "prstTxWrap"); + {self.}XmlChildNoAutofit := new OpenXmlEmpty(self, "a", "noAutofit"); end; function BodyPr.InitAttributes();override; @@ -77,19 +140,34 @@ begin {self.}XmlAttrRot, {self.}XmlAttrSpcFirstLastPara, {self.}XmlAttrVertOverflow, + {self.}XmlAttrHorzOverflow, {self.}XmlAttrVert, {self.}XmlAttrWrap, + {self.}XmlAttrLIns, + {self.}XmlAttrTIns, + {self.}XmlAttrRIns, + {self.}XmlAttrBIns, + {self.}XmlAttrNumCol, + {self.}XmlAttrSpcCol, + {self.}XmlAttrRtlCol, + {self.}XmlAttrFromWordArt, {self.}XmlAttrAnchor, {self.}XmlAttrAnchorCtr, + {self.}XmlAttrForceAA, + {self.}XmlAttrCompatLnSpc, ); end; function BodyPr.InitChildren();override; begin child_elements_ := array( + 0: {self.}PrstTxWrap, + 1: {self.}XmlChildNoAutofit, ); sorted_child_ := array( "": -1, + {self.}PrstTxWrap.ElementName: 0, + {self.}XmlChildNoAutofit.ElementName: 1, ); end; @@ -98,6 +176,37 @@ begin if ifObj({self.}XmlNode) then for k,v in child_elements_ do v.InitNode(nil); {self.}XmlNode := ifObj(_node) ? _node : nil; + node := ifObj(_node) ? _node.FirstChild() : nil; + flag := false; + if ifnil(child_elements_[0]) and length(child_elements_) > 0 then + begin + flag := true; + arr := child_elements_; + child_elements_ := array(); + end + pre := ifString({self.}Prefix) ? {self.}Prefix + ":" : ""; + while ifObj(node) do + begin + node_name := node.GetName(); + pos := sorted_child_[node_name]; + if ifnil(pos) or pos = -1 then + begin + obj := nil; + case node_name of + end; + if ifObj(obj) then obj.InitNode(node); + end + else if flag then + begin + obj := arr[pos]; + obj.InitNode(node); + child_elements_[length(child_elements_)] := obj; + end + else begin + child_elements_[pos].InitNode(node); + end + node := node.NextElement(); + end end; function BodyPr.Copy(_obj: BodyPr);override; @@ -108,14 +217,38 @@ begin {self.}XmlAttrSpcFirstLastPara.Value := _obj.XmlAttrSpcFirstLastPara.Value; if not ifnil(_obj.XmlAttrVertOverflow.Value) then {self.}XmlAttrVertOverflow.Value := _obj.XmlAttrVertOverflow.Value; + if not ifnil(_obj.XmlAttrHorzOverflow.Value) then + {self.}XmlAttrHorzOverflow.Value := _obj.XmlAttrHorzOverflow.Value; if not ifnil(_obj.XmlAttrVert.Value) then {self.}XmlAttrVert.Value := _obj.XmlAttrVert.Value; if not ifnil(_obj.XmlAttrWrap.Value) then {self.}XmlAttrWrap.Value := _obj.XmlAttrWrap.Value; + if not ifnil(_obj.XmlAttrLIns.Value) then + {self.}XmlAttrLIns.Value := _obj.XmlAttrLIns.Value; + if not ifnil(_obj.XmlAttrTIns.Value) then + {self.}XmlAttrTIns.Value := _obj.XmlAttrTIns.Value; + if not ifnil(_obj.XmlAttrRIns.Value) then + {self.}XmlAttrRIns.Value := _obj.XmlAttrRIns.Value; + if not ifnil(_obj.XmlAttrBIns.Value) then + {self.}XmlAttrBIns.Value := _obj.XmlAttrBIns.Value; + if not ifnil(_obj.XmlAttrNumCol.Value) then + {self.}XmlAttrNumCol.Value := _obj.XmlAttrNumCol.Value; + if not ifnil(_obj.XmlAttrSpcCol.Value) then + {self.}XmlAttrSpcCol.Value := _obj.XmlAttrSpcCol.Value; + if not ifnil(_obj.XmlAttrRtlCol.Value) then + {self.}XmlAttrRtlCol.Value := _obj.XmlAttrRtlCol.Value; + if not ifnil(_obj.XmlAttrFromWordArt.Value) then + {self.}XmlAttrFromWordArt.Value := _obj.XmlAttrFromWordArt.Value; if not ifnil(_obj.XmlAttrAnchor.Value) then {self.}XmlAttrAnchor.Value := _obj.XmlAttrAnchor.Value; if not ifnil(_obj.XmlAttrAnchorCtr.Value) then {self.}XmlAttrAnchorCtr.Value := _obj.XmlAttrAnchorCtr.Value; + if not ifnil(_obj.XmlAttrForceAA.Value) then + {self.}XmlAttrForceAA.Value := _obj.XmlAttrForceAA.Value; + if not ifnil(_obj.XmlAttrCompatLnSpc.Value) then + {self.}XmlAttrCompatLnSpc.Value := _obj.XmlAttrCompatLnSpc.Value; + {self.}PrstTxWrap.Copy(_obj.PrstTxWrap); + {self.}XmlChildNoAutofit.Copy(_obj.XmlChildNoAutofit); end; function BodyPr.ReadXmlAttrRot(); @@ -148,6 +281,16 @@ begin {self.}XmlAttrVertOverflow.Value := _value; end; +function BodyPr.ReadXmlAttrHorzOverflow(); +begin + return {self.}XmlAttrHorzOverflow.Value; +end; + +function BodyPr.WriteXmlAttrHorzOverflow(_value); +begin + {self.}XmlAttrHorzOverflow.Value := _value; +end; + function BodyPr.ReadXmlAttrVert(); begin return {self.}XmlAttrVert.Value; @@ -168,6 +311,86 @@ begin {self.}XmlAttrWrap.Value := _value; end; +function BodyPr.ReadXmlAttrLIns(); +begin + return {self.}XmlAttrLIns.Value; +end; + +function BodyPr.WriteXmlAttrLIns(_value); +begin + {self.}XmlAttrLIns.Value := _value; +end; + +function BodyPr.ReadXmlAttrTIns(); +begin + return {self.}XmlAttrTIns.Value; +end; + +function BodyPr.WriteXmlAttrTIns(_value); +begin + {self.}XmlAttrTIns.Value := _value; +end; + +function BodyPr.ReadXmlAttrRIns(); +begin + return {self.}XmlAttrRIns.Value; +end; + +function BodyPr.WriteXmlAttrRIns(_value); +begin + {self.}XmlAttrRIns.Value := _value; +end; + +function BodyPr.ReadXmlAttrBIns(); +begin + return {self.}XmlAttrBIns.Value; +end; + +function BodyPr.WriteXmlAttrBIns(_value); +begin + {self.}XmlAttrBIns.Value := _value; +end; + +function BodyPr.ReadXmlAttrNumCol(); +begin + return {self.}XmlAttrNumCol.Value; +end; + +function BodyPr.WriteXmlAttrNumCol(_value); +begin + {self.}XmlAttrNumCol.Value := _value; +end; + +function BodyPr.ReadXmlAttrSpcCol(); +begin + return {self.}XmlAttrSpcCol.Value; +end; + +function BodyPr.WriteXmlAttrSpcCol(_value); +begin + {self.}XmlAttrSpcCol.Value := _value; +end; + +function BodyPr.ReadXmlAttrRtlCol(); +begin + return {self.}XmlAttrRtlCol.Value; +end; + +function BodyPr.WriteXmlAttrRtlCol(_value); +begin + {self.}XmlAttrRtlCol.Value := _value; +end; + +function BodyPr.ReadXmlAttrFromWordArt(); +begin + return {self.}XmlAttrFromWordArt.Value; +end; + +function BodyPr.WriteXmlAttrFromWordArt(_value); +begin + {self.}XmlAttrFromWordArt.Value := _value; +end; + function BodyPr.ReadXmlAttrAnchor(); begin return {self.}XmlAttrAnchor.Value; @@ -187,3 +410,33 @@ function BodyPr.WriteXmlAttrAnchorCtr(_value); begin {self.}XmlAttrAnchorCtr.Value := _value; end; + +function BodyPr.ReadXmlAttrForceAA(); +begin + return {self.}XmlAttrForceAA.Value; +end; + +function BodyPr.WriteXmlAttrForceAA(_value); +begin + {self.}XmlAttrForceAA.Value := _value; +end; + +function BodyPr.ReadXmlAttrCompatLnSpc(); +begin + return {self.}XmlAttrCompatLnSpc.Value; +end; + +function BodyPr.WriteXmlAttrCompatLnSpc(_value); +begin + {self.}XmlAttrCompatLnSpc.Value := _value; +end; + +function BodyPr.ReadXmlChildNoAutofit(); +begin + return ifnil({self.}XmlChildNoAutofit.Value) ? false : true; +end; + +function BodyPr.WriteXmlChildNoAutofit(_value); +begin + {self.}XmlChildNoAutofit.Value := _value; +end; diff --git a/autoclass/docx/CNvSpPr@DOCX.tsf b/autoclass/docx/CNvSpPr@DOCX.tsf new file mode 100644 index 0000000..38e2e00 --- /dev/null +++ b/autoclass/docx/CNvSpPr@DOCX.tsf @@ -0,0 +1,117 @@ +type CNvSpPr = 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 InitAttributes();override; + function InitChildren();override; + function InitNode(_node: XmlNode);override; + function Copy(_obj: CNvSpPr);override; + + property TxBox read ReadXmlAttrTxBox write WriteXmlAttrTxBox; + function ReadXmlAttrTxBox(); + function WriteXmlAttrTxBox(_value); + +public + // Attributes + XmlAttrTxBox: OpenXmlAttribute; + + // Children + SpLocks: SpLocks; + +end; + +function CNvSpPr.Create();overload; +begin + {self.}Create(nil, "wps", "cNvSpPr"); +end; + +function CNvSpPr.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function CNvSpPr.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; +begin + class(OpenXmlElement).Create(_parent, _prefix, _local_name); +end; + +function CNvSpPr.Init();override; +begin + {self.}XmlAttrTxBox := new OpenXmlAttribute(nil, "txBox", nil); + {self.}SpLocks := new SpLocks(self, "a", "spLocks"); +end; + +function CNvSpPr.InitAttributes();override; +begin + attributes_ := array( + {self.}XmlAttrTxBox, + ); +end; + +function CNvSpPr.InitChildren();override; +begin + child_elements_ := array( + 0: {self.}SpLocks, + ); + sorted_child_ := array( + "": -1, + {self.}SpLocks.ElementName: 0, + ); +end; + +function CNvSpPr.InitNode(_node: XmlNode);override; +begin + if ifObj({self.}XmlNode) then + for k,v in child_elements_ do v.InitNode(nil); + {self.}XmlNode := ifObj(_node) ? _node : nil; + node := ifObj(_node) ? _node.FirstChild() : nil; + flag := false; + if ifnil(child_elements_[0]) and length(child_elements_) > 0 then + begin + flag := true; + arr := child_elements_; + child_elements_ := array(); + end + pre := ifString({self.}Prefix) ? {self.}Prefix + ":" : ""; + while ifObj(node) do + begin + node_name := node.GetName(); + pos := sorted_child_[node_name]; + if ifnil(pos) or pos = -1 then + begin + obj := nil; + case node_name of + end; + if ifObj(obj) then obj.InitNode(node); + end + else if flag then + begin + obj := arr[pos]; + obj.InitNode(node); + child_elements_[length(child_elements_)] := obj; + end + else begin + child_elements_[pos].InitNode(node); + end + node := node.NextElement(); + end +end; + +function CNvSpPr.Copy(_obj: CNvSpPr);override; +begin + if not ifnil(_obj.XmlAttrTxBox.Value) then + {self.}XmlAttrTxBox.Value := _obj.XmlAttrTxBox.Value; + {self.}SpLocks.Copy(_obj.SpLocks); +end; + +function CNvSpPr.ReadXmlAttrTxBox(); +begin + return {self.}XmlAttrTxBox.Value; +end; + +function CNvSpPr.WriteXmlAttrTxBox(_value); +begin + {self.}XmlAttrTxBox.Value := _value; +end; diff --git a/autoclass/docx/ChartSpace@DOCX.tsf b/autoclass/docx/ChartSpace@DOCX.tsf index 92c6cf4..ad1ff02 100644 --- a/autoclass/docx/ChartSpace@DOCX.tsf +++ b/autoclass/docx/ChartSpace@DOCX.tsf @@ -61,7 +61,7 @@ begin {self.}XmlAttrXmlnsR := new OpenXmlAttribute("xmlns", "c", nil); {self.}Date1904 := new PureVal(self, {self.}Prefix, "date1904"); {self.}XmlChildLang := new PureVal(self, {self.}Prefix, "lang"); - {self.}AlternateContent := new AlternateContent(self, "mc", "alternateContent"); + {self.}AlternateContent := new AlternateContent(self, "mc", "AlternateContent"); {self.}Chart := new Chart(self, {self.}Prefix, "chart"); {self.}SpPr := new SpPr(self, {self.}Prefix, "spPr"); {self.}ExternalData := new ExternalData(self, {self.}Prefix, "externalData"); diff --git a/autoclass/docx/Choice@DOCX.tsf b/autoclass/docx/Choice@DOCX.tsf index d9dce1d..3256f4c 100644 --- a/autoclass/docx/Choice@DOCX.tsf +++ b/autoclass/docx/Choice@DOCX.tsf @@ -23,6 +23,7 @@ public // Children Style: PureVal; + Drawing: Drawing; end; @@ -46,6 +47,7 @@ begin {self.}XmlAttrRequires := new OpenXmlAttribute(nil, "Requires", nil); {self.}XmlAttrXmlnsC14 := new OpenXmlAttribute("xmlns", "c14", nil); {self.}Style := new PureVal(self, "c14", "style"); + {self.}Drawing := new Drawing(self, "w", "drawing"); end; function Choice.InitAttributes();override; @@ -60,10 +62,12 @@ function Choice.InitChildren();override; begin child_elements_ := array( 0: {self.}Style, + 1: {self.}Drawing, ); sorted_child_ := array( "": -1, {self.}Style.ElementName: 0, + {self.}Drawing.ElementName: 1, ); end; @@ -112,6 +116,7 @@ begin if not ifnil(_obj.XmlAttrXmlnsC14.Value) then {self.}XmlAttrXmlnsC14.Value := _obj.XmlAttrXmlnsC14.Value; {self.}Style.Copy(_obj.Style); + {self.}Drawing.Copy(_obj.Drawing); end; function Choice.ReadXmlAttrRequires(); diff --git a/autoclass/docx/Drawing@DOCX.tsf b/autoclass/docx/Drawing@DOCX.tsf index 5db9d93..b9deb06 100644 --- a/autoclass/docx/Drawing@DOCX.tsf +++ b/autoclass/docx/Drawing@DOCX.tsf @@ -14,6 +14,7 @@ public // Children _Inline: _Inline; + Anchor: Anchor; end; @@ -35,6 +36,7 @@ end; function Drawing.Init();override; begin {self.}_Inline := new _Inline(self, "wp", "inline"); + {self.}Anchor := new Anchor(self, "wp", "anchor"); end; function Drawing.InitAttributes();override; @@ -47,10 +49,12 @@ function Drawing.InitChildren();override; begin child_elements_ := array( 0: {self.}_Inline, + 1: {self.}Anchor, ); sorted_child_ := array( "": -1, {self.}_Inline.ElementName: 0, + {self.}Anchor.ElementName: 1, ); end; @@ -95,4 +99,5 @@ end; function Drawing.Copy(_obj: Drawing);override; begin {self.}_Inline.Copy(_obj._Inline); + {self.}Anchor.Copy(_obj.Anchor); end; diff --git a/autoclass/docx/Fallback@DOCX.tsf b/autoclass/docx/Fallback@DOCX.tsf index 95fbe5c..1b69e1e 100644 --- a/autoclass/docx/Fallback@DOCX.tsf +++ b/autoclass/docx/Fallback@DOCX.tsf @@ -14,6 +14,7 @@ public // Children Style: PureVal; + Pict: Pict; end; @@ -35,6 +36,7 @@ end; function Fallback.Init();override; begin {self.}Style := new PureVal(self, "c", "style"); + {self.}Pict := new Pict(self, "w", "pict"); end; function Fallback.InitAttributes();override; @@ -47,10 +49,12 @@ function Fallback.InitChildren();override; begin child_elements_ := array( 0: {self.}Style, + 1: {self.}Pict, ); sorted_child_ := array( "": -1, {self.}Style.ElementName: 0, + {self.}Pict.ElementName: 1, ); end; @@ -95,4 +99,5 @@ end; function Fallback.Copy(_obj: Fallback);override; begin {self.}Style.Copy(_obj.Style); + {self.}Pict.Copy(_obj.Pict); end; diff --git a/autoclass/docx/FldSimple@DOCX.tsf b/autoclass/docx/FldSimple@DOCX.tsf new file mode 100644 index 0000000..d979016 --- /dev/null +++ b/autoclass/docx/FldSimple@DOCX.tsf @@ -0,0 +1,154 @@ +type FldSimple = 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 InitAttributes();override; + function InitChildren();override; + function InitNode(_node: XmlNode);override; + function Copy(_obj: FldSimple);override; + function AddR(): R; + function AppendR(): R; + + property Rs read ReadRs; + function ReadRs(_index); + + property Instr read ReadXmlAttrInstr write WriteXmlAttrInstr; + function ReadXmlAttrInstr(); + function WriteXmlAttrInstr(_value); + +public + // Attributes + XmlAttrInstr: OpenXmlAttribute; + + // Children + +end; + +function FldSimple.Create();overload; +begin + {self.}Create(nil, "w", "fldSimple"); +end; + +function FldSimple.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function FldSimple.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; +begin + class(OpenXmlElement).Create(_parent, _prefix, _local_name); +end; + +function FldSimple.Init();override; +begin + {self.}XmlAttrInstr := new OpenXmlAttribute({self.}Prefix, "instr", nil); +end; + +function FldSimple.InitAttributes();override; +begin + attributes_ := array( + {self.}XmlAttrInstr, + ); +end; + +function FldSimple.InitChildren();override; +begin + child_elements_ := array( + ); + sorted_child_ := array( + "": -1, + ); +end; + +function FldSimple.InitNode(_node: XmlNode);override; +begin + if ifObj({self.}XmlNode) then + for k,v in child_elements_ do v.InitNode(nil); + {self.}XmlNode := ifObj(_node) ? _node : nil; + node := ifObj(_node) ? _node.FirstChild() : nil; + flag := false; + if ifnil(child_elements_[0]) and length(child_elements_) > 0 then + begin + flag := true; + arr := child_elements_; + child_elements_ := array(); + end + pre := ifString({self.}Prefix) ? {self.}Prefix + ":" : ""; + while ifObj(node) do + begin + node_name := node.GetName(); + pos := sorted_child_[node_name]; + if ifnil(pos) or pos = -1 then + begin + obj := nil; + case node_name of + pre + "r": obj := {self.}AppendR(); + end; + if ifObj(obj) then obj.InitNode(node); + end + else if flag then + begin + obj := arr[pos]; + obj.InitNode(node); + child_elements_[length(child_elements_)] := obj; + end + else begin + child_elements_[pos].InitNode(node); + end + node := node.NextElement(); + end +end; + +function FldSimple.Copy(_obj: FldSimple);override; +begin + if not ifnil(_obj.XmlAttrInstr.Value) then + {self.}XmlAttrInstr.Value := _obj.XmlAttrInstr.Value; +end; + +function FldSimple.AddR(): R; +begin + len := length(child_elements_); + if len = 0 then i := -1; + else begin + for i:=len-1 downto 0 do + if child_elements_[i].LocalName = "r" then break; + end + obj := new R(self, {self.}Prefix, "r"); + {self.}InsertChild(obj, i+1); + return obj; +end; + +function FldSimple.AppendR(): R; +begin + obj := new R(self, {self.}Prefix, "r"); + child_elements_[length(child_elements_)] := obj; + return obj; +end; + +function FldSimple.ReadRs(_index); +begin + ind := ifnil(_index) ? -2 : _index; + arr := array(); + for k,v in child_elements_ do + begin + if v.LocalName = "r" then + begin + arr[length(arr)] := v; + ind--; + end; + if ind = -1 then return v; + end; + return arr; +end; + +function FldSimple.ReadXmlAttrInstr(); +begin + return {self.}XmlAttrInstr.Value; +end; + +function FldSimple.WriteXmlAttrInstr(_value); +begin + {self.}XmlAttrInstr.Value := _value; +end; diff --git a/autoclass/docx/GraphicData@DOCX.tsf b/autoclass/docx/GraphicData@DOCX.tsf index 6d07f87..da968ce 100644 --- a/autoclass/docx/GraphicData@DOCX.tsf +++ b/autoclass/docx/GraphicData@DOCX.tsf @@ -20,6 +20,7 @@ public // Children Pic: Pic; Chart: Chart; + Wsp: Wsp; end; @@ -43,6 +44,7 @@ begin {self.}XmlAttrUri := new OpenXmlAttribute(nil, "uri", nil); {self.}Pic := new Pic(self, "pic", "pic"); {self.}Chart := new Chart(self, "c", "chart"); + {self.}Wsp := new Wsp(self, "wps", "wsp"); end; function GraphicData.InitAttributes();override; @@ -57,11 +59,13 @@ begin child_elements_ := array( 0: {self.}Pic, 1: {self.}Chart, + 2: {self.}Wsp, ); sorted_child_ := array( "": -1, {self.}Pic.ElementName: 0, {self.}Chart.ElementName: 1, + {self.}Wsp.ElementName: 2, ); end; @@ -109,6 +113,7 @@ begin {self.}XmlAttrUri.Value := _obj.XmlAttrUri.Value; {self.}Pic.Copy(_obj.Pic); {self.}Chart.Copy(_obj.Chart); + {self.}Wsp.Copy(_obj.Wsp); end; function GraphicData.ReadXmlAttrUri(); diff --git a/autoclass/docx/P@DOCX.tsf b/autoclass/docx/P@DOCX.tsf index 9b69994..f90c89e 100644 --- a/autoclass/docx/P@DOCX.tsf +++ b/autoclass/docx/P@DOCX.tsf @@ -14,12 +14,14 @@ public function AddBookmarkStart(): Bookmark; function AddBookmarkEnd(): Bookmark; function AddHyperLink(): HyperLink; + function AddFldSimple(): FldSimple; function AppendR(): R; function AppendCommentRangeStart(): CommentRange; function AppendCommentRangeEnd(): CommentRange; function AppendBookmarkStart(): Bookmark; function AppendBookmarkEnd(): Bookmark; function AppendHyperLink(): HyperLink; + function AppendFldSimple(): FldSimple; property Rs read ReadRs; property CommentRangeStarts read ReadCommentRangeStarts; @@ -27,12 +29,14 @@ public property BookmarkStarts read ReadBookmarkStarts; property BookmarkEnds read ReadBookmarkEnds; property Hyperlinks read ReadHyperlinks; + property FldSimples read ReadFldSimples; function ReadRs(_index); function ReadCommentRangeStarts(_index); function ReadCommentRangeEnds(_index); function ReadBookmarkStarts(_index); function ReadBookmarkEnds(_index); function ReadHyperlinks(_index); + function ReadFldSimples(_index); property W14ParaId read ReadXmlAttrW14ParaId write WriteXmlAttrW14ParaId; property W14TextId read ReadXmlAttrW14TextId write WriteXmlAttrW14TextId; @@ -144,6 +148,7 @@ begin pre + "bookmarkStart": obj := {self.}AppendBookmarkStart(); pre + "bookmarkEnd": obj := {self.}AppendBookmarkEnd(); pre + "hyperlink": obj := {self.}AppendHyperLink(); + pre + "fldSimple": obj := {self.}AppendFldSimple(); end; if ifObj(obj) then obj.InitNode(node); end @@ -255,6 +260,19 @@ begin return obj; end; +function P.AddFldSimple(): FldSimple; +begin + len := length(child_elements_); + if len = 0 then i := -1; + else begin + for i:=len-1 downto 0 do + if child_elements_[i].LocalName = "fldSimple" then break; + end + obj := new FldSimple(self, {self.}Prefix, "fldSimple"); + {self.}InsertChild(obj, i+1); + return obj; +end; + function P.AppendR(): R; begin obj := new R(self, {self.}Prefix, "r"); @@ -297,6 +315,13 @@ begin return obj; end; +function P.AppendFldSimple(): FldSimple; +begin + obj := new FldSimple(self, {self.}Prefix, "fldSimple"); + child_elements_[length(child_elements_)] := obj; + return obj; +end; + function P.ReadRs(_index); begin ind := ifnil(_index) ? -2 : _index; @@ -393,6 +418,22 @@ begin return arr; end; +function P.ReadFldSimples(_index); +begin + ind := ifnil(_index) ? -2 : _index; + arr := array(); + for k,v in child_elements_ do + begin + if v.LocalName = "fldSimple" then + begin + arr[length(arr)] := v; + ind--; + end; + if ind = -1 then return v; + end; + return arr; +end; + function P.ReadXmlAttrW14ParaId(); begin return {self.}XmlAttrW14ParaId.Value; diff --git a/autoclass/docx/Path@DOCX.tsf b/autoclass/docx/Path@DOCX.tsf new file mode 100644 index 0000000..ae4053f --- /dev/null +++ b/autoclass/docx/Path@DOCX.tsf @@ -0,0 +1,99 @@ +type Path = 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 InitAttributes();override; + function InitChildren();override; + function InitNode(_node: XmlNode);override; + function Copy(_obj: Path);override; + + property Gradientshapeok read ReadXmlAttrGradientshapeok write WriteXmlAttrGradientshapeok; + property Connecttype read ReadXmlAttrConnecttype write WriteXmlAttrConnecttype; + function ReadXmlAttrGradientshapeok(); + function WriteXmlAttrGradientshapeok(_value); + function ReadXmlAttrConnecttype(); + function WriteXmlAttrConnecttype(_value); + +public + // Attributes + XmlAttrGradientshapeok: OpenXmlAttribute; + XmlAttrConnecttype: OpenXmlAttribute; + + // Children + +end; + +function Path.Create();overload; +begin + {self.}Create(nil, "v", "path"); +end; + +function Path.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function Path.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; +begin + class(OpenXmlElement).Create(_parent, _prefix, _local_name); +end; + +function Path.Init();override; +begin + {self.}XmlAttrGradientshapeok := new OpenXmlAttribute(nil, "gradientshapeok", nil); + {self.}XmlAttrConnecttype := new OpenXmlAttribute("o", "connecttype", nil); +end; + +function Path.InitAttributes();override; +begin + attributes_ := array( + {self.}XmlAttrGradientshapeok, + {self.}XmlAttrConnecttype, + ); +end; + +function Path.InitChildren();override; +begin + child_elements_ := array( + ); + sorted_child_ := array( + "": -1, + ); +end; + +function Path.InitNode(_node: XmlNode);override; +begin + if ifObj({self.}XmlNode) then + for k,v in child_elements_ do v.InitNode(nil); + {self.}XmlNode := ifObj(_node) ? _node : nil; +end; + +function Path.Copy(_obj: Path);override; +begin + if not ifnil(_obj.XmlAttrGradientshapeok.Value) then + {self.}XmlAttrGradientshapeok.Value := _obj.XmlAttrGradientshapeok.Value; + if not ifnil(_obj.XmlAttrConnecttype.Value) then + {self.}XmlAttrConnecttype.Value := _obj.XmlAttrConnecttype.Value; +end; + +function Path.ReadXmlAttrGradientshapeok(); +begin + return {self.}XmlAttrGradientshapeok.Value; +end; + +function Path.WriteXmlAttrGradientshapeok(_value); +begin + {self.}XmlAttrGradientshapeok.Value := _value; +end; + +function Path.ReadXmlAttrConnecttype(); +begin + return {self.}XmlAttrConnecttype.Value; +end; + +function Path.WriteXmlAttrConnecttype(_value); +begin + {self.}XmlAttrConnecttype.Value := _value; +end; diff --git a/autoclass/docx/Pict@DOCX.tsf b/autoclass/docx/Pict@DOCX.tsf new file mode 100644 index 0000000..0b382bf --- /dev/null +++ b/autoclass/docx/Pict@DOCX.tsf @@ -0,0 +1,103 @@ +type Pict = 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 InitAttributes();override; + function InitChildren();override; + function InitNode(_node: XmlNode);override; + function Copy(_obj: Pict);override; + +public + // Attributes + + // Children + Shapetype: Shapetype; + Shape: Shape; + +end; + +function Pict.Create();overload; +begin + {self.}Create(nil, "w", "pict"); +end; + +function Pict.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function Pict.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; +begin + class(OpenXmlElement).Create(_parent, _prefix, _local_name); +end; + +function Pict.Init();override; +begin + {self.}Shapetype := new Shapetype(self, "v", "shapetype"); + {self.}Shape := new Shape(self, "v", "shape"); +end; + +function Pict.InitAttributes();override; +begin + attributes_ := array( + ); +end; + +function Pict.InitChildren();override; +begin + child_elements_ := array( + 0: {self.}Shapetype, + 1: {self.}Shape, + ); + sorted_child_ := array( + "": -1, + {self.}Shapetype.ElementName: 0, + {self.}Shape.ElementName: 1, + ); +end; + +function Pict.InitNode(_node: XmlNode);override; +begin + if ifObj({self.}XmlNode) then + for k,v in child_elements_ do v.InitNode(nil); + {self.}XmlNode := ifObj(_node) ? _node : nil; + node := ifObj(_node) ? _node.FirstChild() : nil; + flag := false; + if ifnil(child_elements_[0]) and length(child_elements_) > 0 then + begin + flag := true; + arr := child_elements_; + child_elements_ := array(); + end + pre := ifString({self.}Prefix) ? {self.}Prefix + ":" : ""; + while ifObj(node) do + begin + node_name := node.GetName(); + pos := sorted_child_[node_name]; + if ifnil(pos) or pos = -1 then + begin + obj := nil; + case node_name of + end; + if ifObj(obj) then obj.InitNode(node); + end + else if flag then + begin + obj := arr[pos]; + obj.InitNode(node); + child_elements_[length(child_elements_)] := obj; + end + else begin + child_elements_[pos].InitNode(node); + end + node := node.NextElement(); + end +end; + +function Pict.Copy(_obj: Pict);override; +begin + {self.}Shapetype.Copy(_obj.Shapetype); + {self.}Shape.Copy(_obj.Shape); +end; diff --git a/autoclass/docx/PositionH@DOCX.tsf b/autoclass/docx/PositionH@DOCX.tsf new file mode 100644 index 0000000..9999ba0 --- /dev/null +++ b/autoclass/docx/PositionH@DOCX.tsf @@ -0,0 +1,117 @@ +type PositionH = 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 InitAttributes();override; + function InitChildren();override; + function InitNode(_node: XmlNode);override; + function Copy(_obj: PositionH);override; + + property RelativeFrom read ReadXmlAttrRelativeFrom write WriteXmlAttrRelativeFrom; + function ReadXmlAttrRelativeFrom(); + function WriteXmlAttrRelativeFrom(_value); + +public + // Attributes + XmlAttrRelativeFrom: OpenXmlAttribute; + + // Children + PosOffset: OpenXmlPcdata; + +end; + +function PositionH.Create();overload; +begin + {self.}Create(nil, "wp", "positionH"); +end; + +function PositionH.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function PositionH.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; +begin + class(OpenXmlElement).Create(_parent, _prefix, _local_name); +end; + +function PositionH.Init();override; +begin + {self.}XmlAttrRelativeFrom := new OpenXmlAttribute(nil, "relativeFrom", nil); + {self.}PosOffset := new OpenXmlPcdata(self, {self.}Prefix, "posOffset"); +end; + +function PositionH.InitAttributes();override; +begin + attributes_ := array( + {self.}XmlAttrRelativeFrom, + ); +end; + +function PositionH.InitChildren();override; +begin + child_elements_ := array( + 0: {self.}PosOffset, + ); + sorted_child_ := array( + "": -1, + {self.}PosOffset.ElementName: 0, + ); +end; + +function PositionH.InitNode(_node: XmlNode);override; +begin + if ifObj({self.}XmlNode) then + for k,v in child_elements_ do v.InitNode(nil); + {self.}XmlNode := ifObj(_node) ? _node : nil; + node := ifObj(_node) ? _node.FirstChild() : nil; + flag := false; + if ifnil(child_elements_[0]) and length(child_elements_) > 0 then + begin + flag := true; + arr := child_elements_; + child_elements_ := array(); + end + pre := ifString({self.}Prefix) ? {self.}Prefix + ":" : ""; + while ifObj(node) do + begin + node_name := node.GetName(); + pos := sorted_child_[node_name]; + if ifnil(pos) or pos = -1 then + begin + obj := nil; + case node_name of + end; + if ifObj(obj) then obj.InitNode(node); + end + else if flag then + begin + obj := arr[pos]; + obj.InitNode(node); + child_elements_[length(child_elements_)] := obj; + end + else begin + child_elements_[pos].InitNode(node); + end + node := node.NextElement(); + end +end; + +function PositionH.Copy(_obj: PositionH);override; +begin + if not ifnil(_obj.XmlAttrRelativeFrom.Value) then + {self.}XmlAttrRelativeFrom.Value := _obj.XmlAttrRelativeFrom.Value; + {self.}PosOffset.Copy(_obj.PosOffset); +end; + +function PositionH.ReadXmlAttrRelativeFrom(); +begin + return {self.}XmlAttrRelativeFrom.Value; +end; + +function PositionH.WriteXmlAttrRelativeFrom(_value); +begin + {self.}XmlAttrRelativeFrom.Value := _value; +end; diff --git a/autoclass/docx/PositionV@DOCX.tsf b/autoclass/docx/PositionV@DOCX.tsf new file mode 100644 index 0000000..e649005 --- /dev/null +++ b/autoclass/docx/PositionV@DOCX.tsf @@ -0,0 +1,117 @@ +type PositionV = 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 InitAttributes();override; + function InitChildren();override; + function InitNode(_node: XmlNode);override; + function Copy(_obj: PositionV);override; + + property RelativeFrom read ReadXmlAttrRelativeFrom write WriteXmlAttrRelativeFrom; + function ReadXmlAttrRelativeFrom(); + function WriteXmlAttrRelativeFrom(_value); + +public + // Attributes + XmlAttrRelativeFrom: OpenXmlAttribute; + + // Children + PosOffset: OpenXmlPcdata; + +end; + +function PositionV.Create();overload; +begin + {self.}Create(nil, "wp", "positionV"); +end; + +function PositionV.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function PositionV.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; +begin + class(OpenXmlElement).Create(_parent, _prefix, _local_name); +end; + +function PositionV.Init();override; +begin + {self.}XmlAttrRelativeFrom := new OpenXmlAttribute(nil, "relativeFrom", nil); + {self.}PosOffset := new OpenXmlPcdata(self, {self.}Prefix, "posOffset"); +end; + +function PositionV.InitAttributes();override; +begin + attributes_ := array( + {self.}XmlAttrRelativeFrom, + ); +end; + +function PositionV.InitChildren();override; +begin + child_elements_ := array( + 0: {self.}PosOffset, + ); + sorted_child_ := array( + "": -1, + {self.}PosOffset.ElementName: 0, + ); +end; + +function PositionV.InitNode(_node: XmlNode);override; +begin + if ifObj({self.}XmlNode) then + for k,v in child_elements_ do v.InitNode(nil); + {self.}XmlNode := ifObj(_node) ? _node : nil; + node := ifObj(_node) ? _node.FirstChild() : nil; + flag := false; + if ifnil(child_elements_[0]) and length(child_elements_) > 0 then + begin + flag := true; + arr := child_elements_; + child_elements_ := array(); + end + pre := ifString({self.}Prefix) ? {self.}Prefix + ":" : ""; + while ifObj(node) do + begin + node_name := node.GetName(); + pos := sorted_child_[node_name]; + if ifnil(pos) or pos = -1 then + begin + obj := nil; + case node_name of + end; + if ifObj(obj) then obj.InitNode(node); + end + else if flag then + begin + obj := arr[pos]; + obj.InitNode(node); + child_elements_[length(child_elements_)] := obj; + end + else begin + child_elements_[pos].InitNode(node); + end + node := node.NextElement(); + end +end; + +function PositionV.Copy(_obj: PositionV);override; +begin + if not ifnil(_obj.XmlAttrRelativeFrom.Value) then + {self.}XmlAttrRelativeFrom.Value := _obj.XmlAttrRelativeFrom.Value; + {self.}PosOffset.Copy(_obj.PosOffset); +end; + +function PositionV.ReadXmlAttrRelativeFrom(); +begin + return {self.}XmlAttrRelativeFrom.Value; +end; + +function PositionV.WriteXmlAttrRelativeFrom(_value); +begin + {self.}XmlAttrRelativeFrom.Value := _value; +end; diff --git a/autoclass/docx/PrstTxWrap@DOCX.tsf b/autoclass/docx/PrstTxWrap@DOCX.tsf new file mode 100644 index 0000000..d913c4d --- /dev/null +++ b/autoclass/docx/PrstTxWrap@DOCX.tsf @@ -0,0 +1,131 @@ +type PrstTxWrap = 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 InitAttributes();override; + function InitChildren();override; + function InitNode(_node: XmlNode);override; + function Copy(_obj: PrstTxWrap);override; + + property Prst read ReadXmlAttrPrst write WriteXmlAttrPrst; + function ReadXmlAttrPrst(); + function WriteXmlAttrPrst(_value); + + property AvLst read ReadXmlChildAvLst write WriteXmlChildAvLst; + function ReadXmlChildAvLst(); + function WriteXmlChildAvLst(_value); + +public + // Attributes + XmlAttrPrst: OpenXmlAttribute; + + // Children + XmlChildAvLst: OpenXmlEmpty; + +end; + +function PrstTxWrap.Create();overload; +begin + {self.}Create(nil, "a", "prstTxWrap"); +end; + +function PrstTxWrap.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function PrstTxWrap.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; +begin + class(OpenXmlElement).Create(_parent, _prefix, _local_name); +end; + +function PrstTxWrap.Init();override; +begin + {self.}XmlAttrPrst := new OpenXmlAttribute(nil, "prst", nil); + {self.}XmlChildAvLst := new OpenXmlEmpty(self, "a", "avLst"); +end; + +function PrstTxWrap.InitAttributes();override; +begin + attributes_ := array( + {self.}XmlAttrPrst, + ); +end; + +function PrstTxWrap.InitChildren();override; +begin + child_elements_ := array( + 0: {self.}XmlChildAvLst, + ); + sorted_child_ := array( + "": -1, + {self.}XmlChildAvLst.ElementName: 0, + ); +end; + +function PrstTxWrap.InitNode(_node: XmlNode);override; +begin + if ifObj({self.}XmlNode) then + for k,v in child_elements_ do v.InitNode(nil); + {self.}XmlNode := ifObj(_node) ? _node : nil; + node := ifObj(_node) ? _node.FirstChild() : nil; + flag := false; + if ifnil(child_elements_[0]) and length(child_elements_) > 0 then + begin + flag := true; + arr := child_elements_; + child_elements_ := array(); + end + pre := ifString({self.}Prefix) ? {self.}Prefix + ":" : ""; + while ifObj(node) do + begin + node_name := node.GetName(); + pos := sorted_child_[node_name]; + if ifnil(pos) or pos = -1 then + begin + obj := nil; + case node_name of + end; + if ifObj(obj) then obj.InitNode(node); + end + else if flag then + begin + obj := arr[pos]; + obj.InitNode(node); + child_elements_[length(child_elements_)] := obj; + end + else begin + child_elements_[pos].InitNode(node); + end + node := node.NextElement(); + end +end; + +function PrstTxWrap.Copy(_obj: PrstTxWrap);override; +begin + if not ifnil(_obj.XmlAttrPrst.Value) then + {self.}XmlAttrPrst.Value := _obj.XmlAttrPrst.Value; + {self.}XmlChildAvLst.Copy(_obj.XmlChildAvLst); +end; + +function PrstTxWrap.ReadXmlAttrPrst(); +begin + return {self.}XmlAttrPrst.Value; +end; + +function PrstTxWrap.WriteXmlAttrPrst(_value); +begin + {self.}XmlAttrPrst.Value := _value; +end; + +function PrstTxWrap.ReadXmlChildAvLst(); +begin + return ifnil({self.}XmlChildAvLst.Value) ? false : true; +end; + +function PrstTxWrap.WriteXmlChildAvLst(_value); +begin + {self.}XmlChildAvLst.Value := _value; +end; diff --git a/autoclass/docx/R@DOCX.tsf b/autoclass/docx/R@DOCX.tsf index 9487f37..702534e 100644 --- a/autoclass/docx/R@DOCX.tsf +++ b/autoclass/docx/R@DOCX.tsf @@ -8,11 +8,6 @@ public function InitChildren();override; function InitNode(_node: XmlNode);override; function Copy(_obj: R);override; - function AddR(): R; - function AppendR(): R; - - property Rs read ReadRs; - function ReadRs(_index); property WRsidRPr read ReadXmlAttrWRsidRPr write WriteXmlAttrWRsidRPr; property Anchor read ReadXmlAttrAnchor write WriteXmlAttrAnchor; @@ -48,6 +43,7 @@ public XmlChildSeparator: OpenXmlEmpty; XmlChildContinuationSeparator: OpenXmlEmpty; XmlChildLastRenderedPageBreak: OpenXmlEmpty; + AlternateContent: AlternateContent; Drawing: Drawing; T: T; @@ -80,6 +76,7 @@ begin {self.}XmlChildSeparator := new OpenXmlEmpty(self, {self.}Prefix, "separator"); {self.}XmlChildContinuationSeparator := new OpenXmlEmpty(self, {self.}Prefix, "continuationSeparator"); {self.}XmlChildLastRenderedPageBreak := new OpenXmlEmpty(self, {self.}Prefix, "lastRenderedPageBreak"); + {self.}AlternateContent := new AlternateContent(self, "mc", "AlternateContent"); {self.}Drawing := new Drawing(self, {self.}Prefix, "drawing"); {self.}T := new T(self, {self.}Prefix, "t"); end; @@ -103,8 +100,9 @@ begin 4: {self.}XmlChildSeparator, 5: {self.}XmlChildContinuationSeparator, 6: {self.}XmlChildLastRenderedPageBreak, - 7: {self.}Drawing, - 8: {self.}T, + 7: {self.}AlternateContent, + 8: {self.}Drawing, + 9: {self.}T, ); sorted_child_ := array( "": -1, @@ -115,8 +113,9 @@ begin {self.}XmlChildSeparator.ElementName: 4, {self.}XmlChildContinuationSeparator.ElementName: 5, {self.}XmlChildLastRenderedPageBreak.ElementName: 6, - {self.}Drawing.ElementName: 7, - {self.}T.ElementName: 8, + {self.}AlternateContent.ElementName: 7, + {self.}Drawing.ElementName: 8, + {self.}T.ElementName: 9, ); end; @@ -142,7 +141,6 @@ begin begin obj := nil; case node_name of - pre + "r": obj := {self.}AppendR(); end; if ifObj(obj) then obj.InitNode(node); end @@ -174,46 +172,11 @@ begin {self.}XmlChildSeparator.Copy(_obj.XmlChildSeparator); {self.}XmlChildContinuationSeparator.Copy(_obj.XmlChildContinuationSeparator); {self.}XmlChildLastRenderedPageBreak.Copy(_obj.XmlChildLastRenderedPageBreak); + {self.}AlternateContent.Copy(_obj.AlternateContent); {self.}Drawing.Copy(_obj.Drawing); {self.}T.Copy(_obj.T); end; -function R.AddR(): R; -begin - len := length(child_elements_); - if len = 0 then i := -1; - else begin - for i:=len-1 downto 0 do - if child_elements_[i].LocalName = "r" then break; - end - obj := new R(self, {self.}Prefix, "r"); - {self.}InsertChild(obj, i+1); - return obj; -end; - -function R.AppendR(): R; -begin - obj := new R(self, {self.}Prefix, "r"); - child_elements_[length(child_elements_)] := obj; - return obj; -end; - -function R.ReadRs(_index); -begin - ind := ifnil(_index) ? -2 : _index; - arr := array(); - for k,v in child_elements_ do - begin - if v.LocalName = "r" then - begin - arr[length(arr)] := v; - ind--; - end; - if ind = -1 then return v; - end; - return arr; -end; - function R.ReadXmlAttrWRsidRPr(); begin return {self.}XmlAttrWRsidRPr.Value; diff --git a/autoclass/docx/Rich@DOCX.tsf b/autoclass/docx/Rich@DOCX.tsf index ec4bb53..11430e8 100644 --- a/autoclass/docx/Rich@DOCX.tsf +++ b/autoclass/docx/Rich@DOCX.tsf @@ -44,8 +44,8 @@ end; function Rich.Init();override; begin - {self.}BodyPr := new BodyPr(self, "a", "BodyPr"); - {self.}XmlChildLstStyle := new OpenXmlEmpty(self, "a", "LstStyle"); + {self.}BodyPr := new BodyPr(self, "a", "bodyPr"); + {self.}XmlChildLstStyle := new OpenXmlEmpty(self, "a", "lstStyle"); end; function Rich.InitAttributes();override; diff --git a/autoclass/docx/SectPr@DOCX.tsf b/autoclass/docx/SectPr@DOCX.tsf index c455af0..0c66333 100644 --- a/autoclass/docx/SectPr@DOCX.tsf +++ b/autoclass/docx/SectPr@DOCX.tsf @@ -25,6 +25,10 @@ public function ReadXmlAttrWRsidSect(); function WriteXmlAttrWRsidSect(_value); + property TitlePg read ReadXmlChildTitlePg write WriteXmlChildTitlePg; + function ReadXmlChildTitlePg(); + function WriteXmlChildTitlePg(_value); + public // Attributes XmlAttrWRsidR: OpenXmlAttribute; @@ -36,6 +40,7 @@ public PgMar: PgMar; PgNumType: PgNumType; Cols: Cols; + XmlChildTitlePg: OpenXmlEmpty; DocGrid: docGrid; end; @@ -64,6 +69,7 @@ begin {self.}PgMar := new PgMar(self, {self.}Prefix, "pgMar"); {self.}PgNumType := new PgNumType(self, {self.}Prefix, "pgNumType"); {self.}Cols := new Cols(self, {self.}Prefix, "cols"); + {self.}XmlChildTitlePg := new OpenXmlEmpty(self, {self.}Prefix, "titlePg"); {self.}DocGrid := new docGrid(self, {self.}Prefix, "docGrid"); end; @@ -83,7 +89,8 @@ begin 4: {self.}PgMar, 5: {self.}PgNumType, 6: {self.}Cols, - 7: {self.}DocGrid, + 7: {self.}XmlChildTitlePg, + 8: {self.}DocGrid, ); sorted_child_ := array( "": -1, @@ -92,7 +99,8 @@ begin {self.}PgMar.ElementName: 4, {self.}PgNumType.ElementName: 5, {self.}Cols.ElementName: 6, - {self.}DocGrid.ElementName: 7, + {self.}XmlChildTitlePg.ElementName: 7, + {self.}DocGrid.ElementName: 8, ); end; @@ -147,6 +155,7 @@ begin {self.}PgMar.Copy(_obj.PgMar); {self.}PgNumType.Copy(_obj.PgNumType); {self.}Cols.Copy(_obj.Cols); + {self.}XmlChildTitlePg.Copy(_obj.XmlChildTitlePg); {self.}DocGrid.Copy(_obj.DocGrid); end; @@ -241,3 +250,13 @@ function SectPr.WriteXmlAttrWRsidSect(_value); begin {self.}XmlAttrWRsidSect.Value := _value; end; + +function SectPr.ReadXmlChildTitlePg(); +begin + return ifnil({self.}XmlChildTitlePg.Value) ? false : true; +end; + +function SectPr.WriteXmlChildTitlePg(_value); +begin + {self.}XmlChildTitlePg.Value := _value; +end; diff --git a/autoclass/docx/Shape@DOCX.tsf b/autoclass/docx/Shape@DOCX.tsf new file mode 100644 index 0000000..c144bed --- /dev/null +++ b/autoclass/docx/Shape@DOCX.tsf @@ -0,0 +1,207 @@ +type Shape = 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 InitAttributes();override; + function InitChildren();override; + function InitNode(_node: XmlNode);override; + function Copy(_obj: Shape);override; + + property Id read ReadXmlAttrId write WriteXmlAttrId; + property Spid read ReadXmlAttrSpid write WriteXmlAttrSpid; + property Type read ReadXmlAttrType write WriteXmlAttrType; + property Gfxdata read ReadXmlAttrGfxdata write WriteXmlAttrGfxdata; + property Filled read ReadXmlAttrFilled write WriteXmlAttrFilled; + property Stroked read ReadXmlAttrStroked write WriteXmlAttrStroked; + function ReadXmlAttrId(); + function WriteXmlAttrId(_value); + function ReadXmlAttrSpid(); + function WriteXmlAttrSpid(_value); + function ReadXmlAttrType(); + function WriteXmlAttrType(_value); + function ReadXmlAttrGfxdata(); + function WriteXmlAttrGfxdata(_value); + function ReadXmlAttrFilled(); + function WriteXmlAttrFilled(_value); + function ReadXmlAttrStroked(); + function WriteXmlAttrStroked(_value); + +public + // Attributes + XmlAttrId: OpenXmlAttribute; + XmlAttrSpid: OpenXmlAttribute; + XmlAttrType: OpenXmlAttribute; + XmlAttrGfxdata: OpenXmlAttribute; + XmlAttrFilled: OpenXmlAttribute; + XmlAttrStroked: OpenXmlAttribute; + + // Children + Textbox: Textbox; + +end; + +function Shape.Create();overload; +begin + {self.}Create(nil, "v", "shape"); +end; + +function Shape.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function Shape.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; +begin + class(OpenXmlElement).Create(_parent, _prefix, _local_name); +end; + +function Shape.Init();override; +begin + {self.}XmlAttrId := new OpenXmlAttribute(nil, "id", nil); + {self.}XmlAttrSpid := new OpenXmlAttribute("o", "spid", nil); + {self.}XmlAttrType := new OpenXmlAttribute(nil, "type", nil); + {self.}XmlAttrGfxdata := new OpenXmlAttribute("o", "gfxdata", nil); + {self.}XmlAttrFilled := new OpenXmlAttribute(nil, "filled", nil); + {self.}XmlAttrStroked := new OpenXmlAttribute(nil, "stroked", nil); + {self.}Textbox := new Textbox(self, {self.}Prefix, "textbox"); +end; + +function Shape.InitAttributes();override; +begin + attributes_ := array( + {self.}XmlAttrId, + {self.}XmlAttrSpid, + {self.}XmlAttrType, + {self.}XmlAttrGfxdata, + {self.}XmlAttrFilled, + {self.}XmlAttrStroked, + ); +end; + +function Shape.InitChildren();override; +begin + child_elements_ := array( + 0: {self.}Textbox, + ); + sorted_child_ := array( + "": -1, + {self.}Textbox.ElementName: 0, + ); +end; + +function Shape.InitNode(_node: XmlNode);override; +begin + if ifObj({self.}XmlNode) then + for k,v in child_elements_ do v.InitNode(nil); + {self.}XmlNode := ifObj(_node) ? _node : nil; + node := ifObj(_node) ? _node.FirstChild() : nil; + flag := false; + if ifnil(child_elements_[0]) and length(child_elements_) > 0 then + begin + flag := true; + arr := child_elements_; + child_elements_ := array(); + end + pre := ifString({self.}Prefix) ? {self.}Prefix + ":" : ""; + while ifObj(node) do + begin + node_name := node.GetName(); + pos := sorted_child_[node_name]; + if ifnil(pos) or pos = -1 then + begin + obj := nil; + case node_name of + end; + if ifObj(obj) then obj.InitNode(node); + end + else if flag then + begin + obj := arr[pos]; + obj.InitNode(node); + child_elements_[length(child_elements_)] := obj; + end + else begin + child_elements_[pos].InitNode(node); + end + node := node.NextElement(); + end +end; + +function Shape.Copy(_obj: Shape);override; +begin + if not ifnil(_obj.XmlAttrId.Value) then + {self.}XmlAttrId.Value := _obj.XmlAttrId.Value; + if not ifnil(_obj.XmlAttrSpid.Value) then + {self.}XmlAttrSpid.Value := _obj.XmlAttrSpid.Value; + if not ifnil(_obj.XmlAttrType.Value) then + {self.}XmlAttrType.Value := _obj.XmlAttrType.Value; + if not ifnil(_obj.XmlAttrGfxdata.Value) then + {self.}XmlAttrGfxdata.Value := _obj.XmlAttrGfxdata.Value; + if not ifnil(_obj.XmlAttrFilled.Value) then + {self.}XmlAttrFilled.Value := _obj.XmlAttrFilled.Value; + if not ifnil(_obj.XmlAttrStroked.Value) then + {self.}XmlAttrStroked.Value := _obj.XmlAttrStroked.Value; + {self.}Textbox.Copy(_obj.Textbox); +end; + +function Shape.ReadXmlAttrId(); +begin + return {self.}XmlAttrId.Value; +end; + +function Shape.WriteXmlAttrId(_value); +begin + {self.}XmlAttrId.Value := _value; +end; + +function Shape.ReadXmlAttrSpid(); +begin + return {self.}XmlAttrSpid.Value; +end; + +function Shape.WriteXmlAttrSpid(_value); +begin + {self.}XmlAttrSpid.Value := _value; +end; + +function Shape.ReadXmlAttrType(); +begin + return {self.}XmlAttrType.Value; +end; + +function Shape.WriteXmlAttrType(_value); +begin + {self.}XmlAttrType.Value := _value; +end; + +function Shape.ReadXmlAttrGfxdata(); +begin + return {self.}XmlAttrGfxdata.Value; +end; + +function Shape.WriteXmlAttrGfxdata(_value); +begin + {self.}XmlAttrGfxdata.Value := _value; +end; + +function Shape.ReadXmlAttrFilled(); +begin + return {self.}XmlAttrFilled.Value; +end; + +function Shape.WriteXmlAttrFilled(_value); +begin + {self.}XmlAttrFilled.Value := _value; +end; + +function Shape.ReadXmlAttrStroked(); +begin + return {self.}XmlAttrStroked.Value; +end; + +function Shape.WriteXmlAttrStroked(_value); +begin + {self.}XmlAttrStroked.Value := _value; +end; diff --git a/autoclass/docx/Shapetype@DOCX.tsf b/autoclass/docx/Shapetype@DOCX.tsf new file mode 100644 index 0000000..8e5b7eb --- /dev/null +++ b/autoclass/docx/Shapetype@DOCX.tsf @@ -0,0 +1,194 @@ +type Shapetype = 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 InitAttributes();override; + function InitChildren();override; + function InitNode(_node: XmlNode);override; + function Copy(_obj: Shapetype);override; + + property AnchorId read ReadXmlAttrAnchorId write WriteXmlAttrAnchorId; + property Id read ReadXmlAttrId write WriteXmlAttrId; + property Coordsize read ReadXmlAttrCoordsize write WriteXmlAttrCoordsize; + property Spt read ReadXmlAttrSpt write WriteXmlAttrSpt; + property Path read ReadXmlAttrPath write WriteXmlAttrPath; + function ReadXmlAttrAnchorId(); + function WriteXmlAttrAnchorId(_value); + function ReadXmlAttrId(); + function WriteXmlAttrId(_value); + function ReadXmlAttrCoordsize(); + function WriteXmlAttrCoordsize(_value); + function ReadXmlAttrSpt(); + function WriteXmlAttrSpt(_value); + function ReadXmlAttrPath(); + function WriteXmlAttrPath(_value); + +public + // Attributes + XmlAttrAnchorId: OpenXmlAttribute; + XmlAttrId: OpenXmlAttribute; + XmlAttrCoordsize: OpenXmlAttribute; + XmlAttrSpt: OpenXmlAttribute; + XmlAttrPath: OpenXmlAttribute; + + // Children + Stroke: Stroke; + Path: Path; + +end; + +function Shapetype.Create();overload; +begin + {self.}Create(nil, "v", "shapetype"); +end; + +function Shapetype.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function Shapetype.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; +begin + class(OpenXmlElement).Create(_parent, _prefix, _local_name); +end; + +function Shapetype.Init();override; +begin + {self.}XmlAttrAnchorId := new OpenXmlAttribute("w14", "anchorId", nil); + {self.}XmlAttrId := new OpenXmlAttribute(nil, "id", nil); + {self.}XmlAttrCoordsize := new OpenXmlAttribute(nil, "coordsize", nil); + {self.}XmlAttrSpt := new OpenXmlAttribute("o", "spt", nil); + {self.}XmlAttrPath := new OpenXmlAttribute(nil, "path", nil); + {self.}Stroke := new Stroke(self, {self.}Prefix, "stroke"); + {self.}Path := new Path(self, {self.}Prefix, "path"); +end; + +function Shapetype.InitAttributes();override; +begin + attributes_ := array( + {self.}XmlAttrAnchorId, + {self.}XmlAttrId, + {self.}XmlAttrCoordsize, + {self.}XmlAttrSpt, + {self.}XmlAttrPath, + ); +end; + +function Shapetype.InitChildren();override; +begin + child_elements_ := array( + 0: {self.}Stroke, + 1: {self.}Path, + ); + sorted_child_ := array( + "": -1, + {self.}Stroke.ElementName: 0, + {self.}Path.ElementName: 1, + ); +end; + +function Shapetype.InitNode(_node: XmlNode);override; +begin + if ifObj({self.}XmlNode) then + for k,v in child_elements_ do v.InitNode(nil); + {self.}XmlNode := ifObj(_node) ? _node : nil; + node := ifObj(_node) ? _node.FirstChild() : nil; + flag := false; + if ifnil(child_elements_[0]) and length(child_elements_) > 0 then + begin + flag := true; + arr := child_elements_; + child_elements_ := array(); + end + pre := ifString({self.}Prefix) ? {self.}Prefix + ":" : ""; + while ifObj(node) do + begin + node_name := node.GetName(); + pos := sorted_child_[node_name]; + if ifnil(pos) or pos = -1 then + begin + obj := nil; + case node_name of + end; + if ifObj(obj) then obj.InitNode(node); + end + else if flag then + begin + obj := arr[pos]; + obj.InitNode(node); + child_elements_[length(child_elements_)] := obj; + end + else begin + child_elements_[pos].InitNode(node); + end + node := node.NextElement(); + end +end; + +function Shapetype.Copy(_obj: Shapetype);override; +begin + if not ifnil(_obj.XmlAttrAnchorId.Value) then + {self.}XmlAttrAnchorId.Value := _obj.XmlAttrAnchorId.Value; + if not ifnil(_obj.XmlAttrId.Value) then + {self.}XmlAttrId.Value := _obj.XmlAttrId.Value; + if not ifnil(_obj.XmlAttrCoordsize.Value) then + {self.}XmlAttrCoordsize.Value := _obj.XmlAttrCoordsize.Value; + if not ifnil(_obj.XmlAttrSpt.Value) then + {self.}XmlAttrSpt.Value := _obj.XmlAttrSpt.Value; + if not ifnil(_obj.XmlAttrPath.Value) then + {self.}XmlAttrPath.Value := _obj.XmlAttrPath.Value; + {self.}Stroke.Copy(_obj.Stroke); + {self.}Path.Copy(_obj.Path); +end; + +function Shapetype.ReadXmlAttrAnchorId(); +begin + return {self.}XmlAttrAnchorId.Value; +end; + +function Shapetype.WriteXmlAttrAnchorId(_value); +begin + {self.}XmlAttrAnchorId.Value := _value; +end; + +function Shapetype.ReadXmlAttrId(); +begin + return {self.}XmlAttrId.Value; +end; + +function Shapetype.WriteXmlAttrId(_value); +begin + {self.}XmlAttrId.Value := _value; +end; + +function Shapetype.ReadXmlAttrCoordsize(); +begin + return {self.}XmlAttrCoordsize.Value; +end; + +function Shapetype.WriteXmlAttrCoordsize(_value); +begin + {self.}XmlAttrCoordsize.Value := _value; +end; + +function Shapetype.ReadXmlAttrSpt(); +begin + return {self.}XmlAttrSpt.Value; +end; + +function Shapetype.WriteXmlAttrSpt(_value); +begin + {self.}XmlAttrSpt.Value := _value; +end; + +function Shapetype.ReadXmlAttrPath(); +begin + return {self.}XmlAttrPath.Value; +end; + +function Shapetype.WriteXmlAttrPath(_value); +begin + {self.}XmlAttrPath.Value := _value; +end; diff --git a/autoclass/docx/SizeRelH@DOCX.tsf b/autoclass/docx/SizeRelH@DOCX.tsf new file mode 100644 index 0000000..bb9c3a4 --- /dev/null +++ b/autoclass/docx/SizeRelH@DOCX.tsf @@ -0,0 +1,117 @@ +type SizeRelH = 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 InitAttributes();override; + function InitChildren();override; + function InitNode(_node: XmlNode);override; + function Copy(_obj: SizeRelH);override; + + property RelativeFrom read ReadXmlAttrRelativeFrom write WriteXmlAttrRelativeFrom; + function ReadXmlAttrRelativeFrom(); + function WriteXmlAttrRelativeFrom(_value); + +public + // Attributes + XmlAttrRelativeFrom: OpenXmlAttribute; + + // Children + PctWidth: OpenXmlPcdata; + +end; + +function SizeRelH.Create();overload; +begin + {self.}Create(nil, "wp14", "sizeRelH"); +end; + +function SizeRelH.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function SizeRelH.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; +begin + class(OpenXmlElement).Create(_parent, _prefix, _local_name); +end; + +function SizeRelH.Init();override; +begin + {self.}XmlAttrRelativeFrom := new OpenXmlAttribute(nil, "relativeFrom", nil); + {self.}PctWidth := new OpenXmlPcdata(self, {self.}Prefix, "pctWidth"); +end; + +function SizeRelH.InitAttributes();override; +begin + attributes_ := array( + {self.}XmlAttrRelativeFrom, + ); +end; + +function SizeRelH.InitChildren();override; +begin + child_elements_ := array( + 0: {self.}PctWidth, + ); + sorted_child_ := array( + "": -1, + {self.}PctWidth.ElementName: 0, + ); +end; + +function SizeRelH.InitNode(_node: XmlNode);override; +begin + if ifObj({self.}XmlNode) then + for k,v in child_elements_ do v.InitNode(nil); + {self.}XmlNode := ifObj(_node) ? _node : nil; + node := ifObj(_node) ? _node.FirstChild() : nil; + flag := false; + if ifnil(child_elements_[0]) and length(child_elements_) > 0 then + begin + flag := true; + arr := child_elements_; + child_elements_ := array(); + end + pre := ifString({self.}Prefix) ? {self.}Prefix + ":" : ""; + while ifObj(node) do + begin + node_name := node.GetName(); + pos := sorted_child_[node_name]; + if ifnil(pos) or pos = -1 then + begin + obj := nil; + case node_name of + end; + if ifObj(obj) then obj.InitNode(node); + end + else if flag then + begin + obj := arr[pos]; + obj.InitNode(node); + child_elements_[length(child_elements_)] := obj; + end + else begin + child_elements_[pos].InitNode(node); + end + node := node.NextElement(); + end +end; + +function SizeRelH.Copy(_obj: SizeRelH);override; +begin + if not ifnil(_obj.XmlAttrRelativeFrom.Value) then + {self.}XmlAttrRelativeFrom.Value := _obj.XmlAttrRelativeFrom.Value; + {self.}PctWidth.Copy(_obj.PctWidth); +end; + +function SizeRelH.ReadXmlAttrRelativeFrom(); +begin + return {self.}XmlAttrRelativeFrom.Value; +end; + +function SizeRelH.WriteXmlAttrRelativeFrom(_value); +begin + {self.}XmlAttrRelativeFrom.Value := _value; +end; diff --git a/autoclass/docx/SizeRelV@DOCX.tsf b/autoclass/docx/SizeRelV@DOCX.tsf new file mode 100644 index 0000000..143a632 --- /dev/null +++ b/autoclass/docx/SizeRelV@DOCX.tsf @@ -0,0 +1,117 @@ +type SizeRelV = 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 InitAttributes();override; + function InitChildren();override; + function InitNode(_node: XmlNode);override; + function Copy(_obj: SizeRelV);override; + + property RelativeFrom read ReadXmlAttrRelativeFrom write WriteXmlAttrRelativeFrom; + function ReadXmlAttrRelativeFrom(); + function WriteXmlAttrRelativeFrom(_value); + +public + // Attributes + XmlAttrRelativeFrom: OpenXmlAttribute; + + // Children + PctHeight: OpenXmlPcdata; + +end; + +function SizeRelV.Create();overload; +begin + {self.}Create(nil, "wp14", "sizeRelV"); +end; + +function SizeRelV.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function SizeRelV.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; +begin + class(OpenXmlElement).Create(_parent, _prefix, _local_name); +end; + +function SizeRelV.Init();override; +begin + {self.}XmlAttrRelativeFrom := new OpenXmlAttribute(nil, "relativeFrom", nil); + {self.}PctHeight := new OpenXmlPcdata(self, {self.}Prefix, "pctHeight"); +end; + +function SizeRelV.InitAttributes();override; +begin + attributes_ := array( + {self.}XmlAttrRelativeFrom, + ); +end; + +function SizeRelV.InitChildren();override; +begin + child_elements_ := array( + 0: {self.}PctHeight, + ); + sorted_child_ := array( + "": -1, + {self.}PctHeight.ElementName: 0, + ); +end; + +function SizeRelV.InitNode(_node: XmlNode);override; +begin + if ifObj({self.}XmlNode) then + for k,v in child_elements_ do v.InitNode(nil); + {self.}XmlNode := ifObj(_node) ? _node : nil; + node := ifObj(_node) ? _node.FirstChild() : nil; + flag := false; + if ifnil(child_elements_[0]) and length(child_elements_) > 0 then + begin + flag := true; + arr := child_elements_; + child_elements_ := array(); + end + pre := ifString({self.}Prefix) ? {self.}Prefix + ":" : ""; + while ifObj(node) do + begin + node_name := node.GetName(); + pos := sorted_child_[node_name]; + if ifnil(pos) or pos = -1 then + begin + obj := nil; + case node_name of + end; + if ifObj(obj) then obj.InitNode(node); + end + else if flag then + begin + obj := arr[pos]; + obj.InitNode(node); + child_elements_[length(child_elements_)] := obj; + end + else begin + child_elements_[pos].InitNode(node); + end + node := node.NextElement(); + end +end; + +function SizeRelV.Copy(_obj: SizeRelV);override; +begin + if not ifnil(_obj.XmlAttrRelativeFrom.Value) then + {self.}XmlAttrRelativeFrom.Value := _obj.XmlAttrRelativeFrom.Value; + {self.}PctHeight.Copy(_obj.PctHeight); +end; + +function SizeRelV.ReadXmlAttrRelativeFrom(); +begin + return {self.}XmlAttrRelativeFrom.Value; +end; + +function SizeRelV.WriteXmlAttrRelativeFrom(_value); +begin + {self.}XmlAttrRelativeFrom.Value := _value; +end; diff --git a/autoclass/docx/SpLocks@DOCX.tsf b/autoclass/docx/SpLocks@DOCX.tsf new file mode 100644 index 0000000..bf4954b --- /dev/null +++ b/autoclass/docx/SpLocks@DOCX.tsf @@ -0,0 +1,81 @@ +type SpLocks = 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 InitAttributes();override; + function InitChildren();override; + function InitNode(_node: XmlNode);override; + function Copy(_obj: SpLocks);override; + + property NoChangeArrowheads read ReadXmlAttrNoChangeArrowheads write WriteXmlAttrNoChangeArrowheads; + function ReadXmlAttrNoChangeArrowheads(); + function WriteXmlAttrNoChangeArrowheads(_value); + +public + // Attributes + XmlAttrNoChangeArrowheads: OpenXmlAttribute; + + // Children + +end; + +function SpLocks.Create();overload; +begin + {self.}Create(nil, "a", "spLocks"); +end; + +function SpLocks.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function SpLocks.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; +begin + class(OpenXmlElement).Create(_parent, _prefix, _local_name); +end; + +function SpLocks.Init();override; +begin + {self.}XmlAttrNoChangeArrowheads := new OpenXmlAttribute(nil, "noChangeArrowheads", nil); +end; + +function SpLocks.InitAttributes();override; +begin + attributes_ := array( + {self.}XmlAttrNoChangeArrowheads, + ); +end; + +function SpLocks.InitChildren();override; +begin + child_elements_ := array( + ); + sorted_child_ := array( + "": -1, + ); +end; + +function SpLocks.InitNode(_node: XmlNode);override; +begin + if ifObj({self.}XmlNode) then + for k,v in child_elements_ do v.InitNode(nil); + {self.}XmlNode := ifObj(_node) ? _node : nil; +end; + +function SpLocks.Copy(_obj: SpLocks);override; +begin + if not ifnil(_obj.XmlAttrNoChangeArrowheads.Value) then + {self.}XmlAttrNoChangeArrowheads.Value := _obj.XmlAttrNoChangeArrowheads.Value; +end; + +function SpLocks.ReadXmlAttrNoChangeArrowheads(); +begin + return {self.}XmlAttrNoChangeArrowheads.Value; +end; + +function SpLocks.WriteXmlAttrNoChangeArrowheads(_value); +begin + {self.}XmlAttrNoChangeArrowheads.Value := _value; +end; diff --git a/autoclass/docx/SpPr@DOCX.tsf b/autoclass/docx/SpPr@DOCX.tsf index bba4a5a..3d48e59 100644 --- a/autoclass/docx/SpPr@DOCX.tsf +++ b/autoclass/docx/SpPr@DOCX.tsf @@ -9,12 +9,17 @@ public function InitNode(_node: XmlNode);override; function Copy(_obj: SpPr);override; + property BwMode read ReadXmlAttrBwMode write WriteXmlAttrBwMode; + function ReadXmlAttrBwMode(); + function WriteXmlAttrBwMode(_value); + property NoFill read ReadXmlChildNoFill write WriteXmlChildNoFill; function ReadXmlChildNoFill(); function WriteXmlChildNoFill(_value); public // Attributes + XmlAttrBwMode: OpenXmlAttribute; // Children Xfrm: Xfrm; @@ -43,6 +48,7 @@ end; function SpPr.Init();override; begin + {self.}XmlAttrBwMode := new OpenXmlAttribute(nil, "bwMode", nil); {self.}Xfrm := new Xfrm(self, "a", "xfrm"); {self.}PrstGeom := new PrstGeom(self, "a", "prstGeom"); {self.}XmlChildNoFill := new OpenXmlEmpty(self, "a", "noFill"); @@ -54,6 +60,7 @@ end; function SpPr.InitAttributes();override; begin attributes_ := array( + {self.}XmlAttrBwMode, ); end; @@ -118,6 +125,8 @@ end; function SpPr.Copy(_obj: SpPr);override; begin + if not ifnil(_obj.XmlAttrBwMode.Value) then + {self.}XmlAttrBwMode.Value := _obj.XmlAttrBwMode.Value; {self.}Xfrm.Copy(_obj.Xfrm); {self.}PrstGeom.Copy(_obj.PrstGeom); {self.}XmlChildNoFill.Copy(_obj.XmlChildNoFill); @@ -126,6 +135,16 @@ begin {self.}EffectLst.Copy(_obj.EffectLst); end; +function SpPr.ReadXmlAttrBwMode(); +begin + return {self.}XmlAttrBwMode.Value; +end; + +function SpPr.WriteXmlAttrBwMode(_value); +begin + {self.}XmlAttrBwMode.Value := _value; +end; + function SpPr.ReadXmlChildNoFill(); begin return ifnil({self.}XmlChildNoFill.Value) ? false : true; diff --git a/autoclass/docx/Stroke@DOCX.tsf b/autoclass/docx/Stroke@DOCX.tsf new file mode 100644 index 0000000..9b0d57a --- /dev/null +++ b/autoclass/docx/Stroke@DOCX.tsf @@ -0,0 +1,81 @@ +type Stroke = 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 InitAttributes();override; + function InitChildren();override; + function InitNode(_node: XmlNode);override; + function Copy(_obj: Stroke);override; + + property Joinstyle read ReadXmlAttrJoinstyle write WriteXmlAttrJoinstyle; + function ReadXmlAttrJoinstyle(); + function WriteXmlAttrJoinstyle(_value); + +public + // Attributes + XmlAttrJoinstyle: OpenXmlAttribute; + + // Children + +end; + +function Stroke.Create();overload; +begin + {self.}Create(nil, "v", "stroke"); +end; + +function Stroke.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function Stroke.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; +begin + class(OpenXmlElement).Create(_parent, _prefix, _local_name); +end; + +function Stroke.Init();override; +begin + {self.}XmlAttrJoinstyle := new OpenXmlAttribute(nil, "joinstyle", nil); +end; + +function Stroke.InitAttributes();override; +begin + attributes_ := array( + {self.}XmlAttrJoinstyle, + ); +end; + +function Stroke.InitChildren();override; +begin + child_elements_ := array( + ); + sorted_child_ := array( + "": -1, + ); +end; + +function Stroke.InitNode(_node: XmlNode);override; +begin + if ifObj({self.}XmlNode) then + for k,v in child_elements_ do v.InitNode(nil); + {self.}XmlNode := ifObj(_node) ? _node : nil; +end; + +function Stroke.Copy(_obj: Stroke);override; +begin + if not ifnil(_obj.XmlAttrJoinstyle.Value) then + {self.}XmlAttrJoinstyle.Value := _obj.XmlAttrJoinstyle.Value; +end; + +function Stroke.ReadXmlAttrJoinstyle(); +begin + return {self.}XmlAttrJoinstyle.Value; +end; + +function Stroke.WriteXmlAttrJoinstyle(_value); +begin + {self.}XmlAttrJoinstyle.Value := _value; +end; diff --git a/autoclass/docx/Textbox@DOCX.tsf b/autoclass/docx/Textbox@DOCX.tsf new file mode 100644 index 0000000..c2b0fb0 --- /dev/null +++ b/autoclass/docx/Textbox@DOCX.tsf @@ -0,0 +1,98 @@ +type Textbox = 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 InitAttributes();override; + function InitChildren();override; + function InitNode(_node: XmlNode);override; + function Copy(_obj: Textbox);override; + +public + // Attributes + + // Children + TxbxContent: TxbxContent; + +end; + +function Textbox.Create();overload; +begin + {self.}Create(nil, "v", "textbox"); +end; + +function Textbox.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function Textbox.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; +begin + class(OpenXmlElement).Create(_parent, _prefix, _local_name); +end; + +function Textbox.Init();override; +begin + {self.}TxbxContent := new TxbxContent(self, "w", "txbxContent"); +end; + +function Textbox.InitAttributes();override; +begin + attributes_ := array( + ); +end; + +function Textbox.InitChildren();override; +begin + child_elements_ := array( + 0: {self.}TxbxContent, + ); + sorted_child_ := array( + "": -1, + {self.}TxbxContent.ElementName: 0, + ); +end; + +function Textbox.InitNode(_node: XmlNode);override; +begin + if ifObj({self.}XmlNode) then + for k,v in child_elements_ do v.InitNode(nil); + {self.}XmlNode := ifObj(_node) ? _node : nil; + node := ifObj(_node) ? _node.FirstChild() : nil; + flag := false; + if ifnil(child_elements_[0]) and length(child_elements_) > 0 then + begin + flag := true; + arr := child_elements_; + child_elements_ := array(); + end + pre := ifString({self.}Prefix) ? {self.}Prefix + ":" : ""; + while ifObj(node) do + begin + node_name := node.GetName(); + pos := sorted_child_[node_name]; + if ifnil(pos) or pos = -1 then + begin + obj := nil; + case node_name of + end; + if ifObj(obj) then obj.InitNode(node); + end + else if flag then + begin + obj := arr[pos]; + obj.InitNode(node); + child_elements_[length(child_elements_)] := obj; + end + else begin + child_elements_[pos].InitNode(node); + end + node := node.NextElement(); + end +end; + +function Textbox.Copy(_obj: Textbox);override; +begin + {self.}TxbxContent.Copy(_obj.TxbxContent); +end; diff --git a/autoclass/docx/TxPr@DOCX.tsf b/autoclass/docx/TxPr@DOCX.tsf index ff4bce7..0239b1d 100644 --- a/autoclass/docx/TxPr@DOCX.tsf +++ b/autoclass/docx/TxPr@DOCX.tsf @@ -44,8 +44,8 @@ end; function TxPr.Init();override; begin - {self.}BodyPr := new BodyPr(self, "a", "BodyPr"); - {self.}XmlChildLstStyle := new OpenXmlEmpty(self, "a", "LstStyle"); + {self.}BodyPr := new BodyPr(self, "a", "bodyPr"); + {self.}XmlChildLstStyle := new OpenXmlEmpty(self, "a", "lstStyle"); end; function TxPr.InitAttributes();override; diff --git a/autoclass/docx/Txbx@DOCX.tsf b/autoclass/docx/Txbx@DOCX.tsf new file mode 100644 index 0000000..c9a4d9d --- /dev/null +++ b/autoclass/docx/Txbx@DOCX.tsf @@ -0,0 +1,98 @@ +type Txbx = 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 InitAttributes();override; + function InitChildren();override; + function InitNode(_node: XmlNode);override; + function Copy(_obj: Txbx);override; + +public + // Attributes + + // Children + TxbxContent: TxbxContent; + +end; + +function Txbx.Create();overload; +begin + {self.}Create(nil, "wps", "txbx"); +end; + +function Txbx.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function Txbx.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; +begin + class(OpenXmlElement).Create(_parent, _prefix, _local_name); +end; + +function Txbx.Init();override; +begin + {self.}TxbxContent := new TxbxContent(self, "w", "txbxContent"); +end; + +function Txbx.InitAttributes();override; +begin + attributes_ := array( + ); +end; + +function Txbx.InitChildren();override; +begin + child_elements_ := array( + 0: {self.}TxbxContent, + ); + sorted_child_ := array( + "": -1, + {self.}TxbxContent.ElementName: 0, + ); +end; + +function Txbx.InitNode(_node: XmlNode);override; +begin + if ifObj({self.}XmlNode) then + for k,v in child_elements_ do v.InitNode(nil); + {self.}XmlNode := ifObj(_node) ? _node : nil; + node := ifObj(_node) ? _node.FirstChild() : nil; + flag := false; + if ifnil(child_elements_[0]) and length(child_elements_) > 0 then + begin + flag := true; + arr := child_elements_; + child_elements_ := array(); + end + pre := ifString({self.}Prefix) ? {self.}Prefix + ":" : ""; + while ifObj(node) do + begin + node_name := node.GetName(); + pos := sorted_child_[node_name]; + if ifnil(pos) or pos = -1 then + begin + obj := nil; + case node_name of + end; + if ifObj(obj) then obj.InitNode(node); + end + else if flag then + begin + obj := arr[pos]; + obj.InitNode(node); + child_elements_[length(child_elements_)] := obj; + end + else begin + child_elements_[pos].InitNode(node); + end + node := node.NextElement(); + end +end; + +function Txbx.Copy(_obj: Txbx);override; +begin + {self.}TxbxContent.Copy(_obj.TxbxContent); +end; diff --git a/autoclass/docx/TxbxContent@DOCX.tsf b/autoclass/docx/TxbxContent@DOCX.tsf new file mode 100644 index 0000000..a5045e7 --- /dev/null +++ b/autoclass/docx/TxbxContent@DOCX.tsf @@ -0,0 +1,137 @@ +type TxbxContent = 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 InitAttributes();override; + function InitChildren();override; + function InitNode(_node: XmlNode);override; + function Copy(_obj: TxbxContent);override; + function AddP(): P; + function AppendP(): P; + + property Ps read ReadPs; + function ReadPs(_index); + +public + // Attributes + + // Children + +end; + +function TxbxContent.Create();overload; +begin + {self.}Create(nil, "w", "textbox"); +end; + +function TxbxContent.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function TxbxContent.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; +begin + class(OpenXmlElement).Create(_parent, _prefix, _local_name); +end; + +function TxbxContent.Init();override; +begin + +end; + +function TxbxContent.InitAttributes();override; +begin + attributes_ := array( + ); +end; + +function TxbxContent.InitChildren();override; +begin + child_elements_ := array( + ); + sorted_child_ := array( + "": -1, + ); +end; + +function TxbxContent.InitNode(_node: XmlNode);override; +begin + if ifObj({self.}XmlNode) then + for k,v in child_elements_ do v.InitNode(nil); + {self.}XmlNode := ifObj(_node) ? _node : nil; + node := ifObj(_node) ? _node.FirstChild() : nil; + flag := false; + if ifnil(child_elements_[0]) and length(child_elements_) > 0 then + begin + flag := true; + arr := child_elements_; + child_elements_ := array(); + end + pre := ifString({self.}Prefix) ? {self.}Prefix + ":" : ""; + while ifObj(node) do + begin + node_name := node.GetName(); + pos := sorted_child_[node_name]; + if ifnil(pos) or pos = -1 then + begin + obj := nil; + case node_name of + pre + "p": obj := {self.}AppendP(); + end; + if ifObj(obj) then obj.InitNode(node); + end + else if flag then + begin + obj := arr[pos]; + obj.InitNode(node); + child_elements_[length(child_elements_)] := obj; + end + else begin + child_elements_[pos].InitNode(node); + end + node := node.NextElement(); + end +end; + +function TxbxContent.Copy(_obj: TxbxContent);override; +begin + +end; + +function TxbxContent.AddP(): P; +begin + len := length(child_elements_); + if len = 0 then i := -1; + else begin + for i:=len-1 downto 0 do + if child_elements_[i].LocalName = "p" then break; + end + obj := new P(self, {self.}Prefix, "p"); + {self.}InsertChild(obj, i+1); + return obj; +end; + +function TxbxContent.AppendP(): P; +begin + obj := new P(self, {self.}Prefix, "p"); + child_elements_[length(child_elements_)] := obj; + return obj; +end; + +function TxbxContent.ReadPs(_index); +begin + ind := ifnil(_index) ? -2 : _index; + arr := array(); + for k,v in child_elements_ do + begin + if v.LocalName = "p" then + begin + arr[length(arr)] := v; + ind--; + end; + if ind = -1 then return v; + end; + return arr; +end; diff --git a/autoclass/docx/WpsStyle@DOCX.tsf b/autoclass/docx/WpsStyle@DOCX.tsf new file mode 100644 index 0000000..289d71b --- /dev/null +++ b/autoclass/docx/WpsStyle@DOCX.tsf @@ -0,0 +1,113 @@ +type WpsStyle = 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 InitAttributes();override; + function InitChildren();override; + function InitNode(_node: XmlNode);override; + function Copy(_obj: WpsStyle);override; + +public + // Attributes + + // Children + LnRef: XRef; + FillRef: XRef; + EffectRef: XRef; + FontRef: XRef; + +end; + +function WpsStyle.Create();overload; +begin + {self.}Create(nil, "wps", "style"); +end; + +function WpsStyle.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function WpsStyle.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; +begin + class(OpenXmlElement).Create(_parent, _prefix, _local_name); +end; + +function WpsStyle.Init();override; +begin + {self.}LnRef := new XRef(self, "a", "lnRef"); + {self.}FillRef := new XRef(self, "a", "fillRef"); + {self.}EffectRef := new XRef(self, "a", "effectRef"); + {self.}FontRef := new XRef(self, "a", "fontRef"); +end; + +function WpsStyle.InitAttributes();override; +begin + attributes_ := array( + ); +end; + +function WpsStyle.InitChildren();override; +begin + child_elements_ := array( + 0: {self.}LnRef, + 1: {self.}FillRef, + 2: {self.}EffectRef, + 3: {self.}FontRef, + ); + sorted_child_ := array( + "": -1, + {self.}LnRef.ElementName: 0, + {self.}FillRef.ElementName: 1, + {self.}EffectRef.ElementName: 2, + {self.}FontRef.ElementName: 3, + ); +end; + +function WpsStyle.InitNode(_node: XmlNode);override; +begin + if ifObj({self.}XmlNode) then + for k,v in child_elements_ do v.InitNode(nil); + {self.}XmlNode := ifObj(_node) ? _node : nil; + node := ifObj(_node) ? _node.FirstChild() : nil; + flag := false; + if ifnil(child_elements_[0]) and length(child_elements_) > 0 then + begin + flag := true; + arr := child_elements_; + child_elements_ := array(); + end + pre := ifString({self.}Prefix) ? {self.}Prefix + ":" : ""; + while ifObj(node) do + begin + node_name := node.GetName(); + pos := sorted_child_[node_name]; + if ifnil(pos) or pos = -1 then + begin + obj := nil; + case node_name of + end; + if ifObj(obj) then obj.InitNode(node); + end + else if flag then + begin + obj := arr[pos]; + obj.InitNode(node); + child_elements_[length(child_elements_)] := obj; + end + else begin + child_elements_[pos].InitNode(node); + end + node := node.NextElement(); + end +end; + +function WpsStyle.Copy(_obj: WpsStyle);override; +begin + {self.}LnRef.Copy(_obj.LnRef); + {self.}FillRef.Copy(_obj.FillRef); + {self.}EffectRef.Copy(_obj.EffectRef); + {self.}FontRef.Copy(_obj.FontRef); +end; diff --git a/autoclass/docx/Wsp@DOCX.tsf b/autoclass/docx/Wsp@DOCX.tsf new file mode 100644 index 0000000..8f28f70 --- /dev/null +++ b/autoclass/docx/Wsp@DOCX.tsf @@ -0,0 +1,118 @@ +type Wsp = 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 InitAttributes();override; + function InitChildren();override; + function InitNode(_node: XmlNode);override; + function Copy(_obj: Wsp);override; + +public + // Attributes + + // Children + CNvSpPr: CNvSpPr; + SpPr: SpPr; + Txbx: Txbx; + Style: WpsStyle; + BodyPr: BodyPr; + +end; + +function Wsp.Create();overload; +begin + {self.}Create(nil, "wps", "wsp"); +end; + +function Wsp.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function Wsp.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; +begin + class(OpenXmlElement).Create(_parent, _prefix, _local_name); +end; + +function Wsp.Init();override; +begin + {self.}CNvSpPr := new CNvSpPr(self, {self.}Prefix, "cNvSpPr"); + {self.}SpPr := new SpPr(self, {self.}Prefix, "spPr"); + {self.}Txbx := new Txbx(self, {self.}Prefix, "txbx"); + {self.}Style := new WpsStyle(self, {self.}Prefix, "style"); + {self.}BodyPr := new BodyPr(self, {self.}Prefix, "bodyPr"); +end; + +function Wsp.InitAttributes();override; +begin + attributes_ := array( + ); +end; + +function Wsp.InitChildren();override; +begin + child_elements_ := array( + 0: {self.}CNvSpPr, + 1: {self.}SpPr, + 2: {self.}Txbx, + 3: {self.}Style, + 4: {self.}BodyPr, + ); + sorted_child_ := array( + "": -1, + {self.}CNvSpPr.ElementName: 0, + {self.}SpPr.ElementName: 1, + {self.}Txbx.ElementName: 2, + {self.}Style.ElementName: 3, + {self.}BodyPr.ElementName: 4, + ); +end; + +function Wsp.InitNode(_node: XmlNode);override; +begin + if ifObj({self.}XmlNode) then + for k,v in child_elements_ do v.InitNode(nil); + {self.}XmlNode := ifObj(_node) ? _node : nil; + node := ifObj(_node) ? _node.FirstChild() : nil; + flag := false; + if ifnil(child_elements_[0]) and length(child_elements_) > 0 then + begin + flag := true; + arr := child_elements_; + child_elements_ := array(); + end + pre := ifString({self.}Prefix) ? {self.}Prefix + ":" : ""; + while ifObj(node) do + begin + node_name := node.GetName(); + pos := sorted_child_[node_name]; + if ifnil(pos) or pos = -1 then + begin + obj := nil; + case node_name of + end; + if ifObj(obj) then obj.InitNode(node); + end + else if flag then + begin + obj := arr[pos]; + obj.InitNode(node); + child_elements_[length(child_elements_)] := obj; + end + else begin + child_elements_[pos].InitNode(node); + end + node := node.NextElement(); + end +end; + +function Wsp.Copy(_obj: Wsp);override; +begin + {self.}CNvSpPr.Copy(_obj.CNvSpPr); + {self.}SpPr.Copy(_obj.SpPr); + {self.}Txbx.Copy(_obj.Txbx); + {self.}Style.Copy(_obj.Style); + {self.}BodyPr.Copy(_obj.BodyPr); +end; diff --git a/autoclass/docx/XRef@DOCX.tsf b/autoclass/docx/XRef@DOCX.tsf new file mode 100644 index 0000000..df82a46 --- /dev/null +++ b/autoclass/docx/XRef@DOCX.tsf @@ -0,0 +1,117 @@ +type XRef = 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 InitAttributes();override; + function InitChildren();override; + function InitNode(_node: XmlNode);override; + function Copy(_obj: XRef);override; + + property Idx read ReadXmlAttrIdx write WriteXmlAttrIdx; + function ReadXmlAttrIdx(); + function WriteXmlAttrIdx(_value); + +public + // Attributes + XmlAttrIdx: OpenXmlAttribute; + + // Children + SchemeClr: SchemeClr; + +end; + +function XRef.Create();overload; +begin + {self.}Create(nil, "a", "lnRef"); +end; + +function XRef.Create(_node: XmlNode);overload; +begin + class(OpenXmlElement).Create(_node: XmlNode); +end; + +function XRef.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; +begin + class(OpenXmlElement).Create(_parent, _prefix, _local_name); +end; + +function XRef.Init();override; +begin + {self.}XmlAttrIdx := new OpenXmlAttribute(nil, "idx", nil); + {self.}SchemeClr := new SchemeClr(self, "a", "schemeClr"); +end; + +function XRef.InitAttributes();override; +begin + attributes_ := array( + {self.}XmlAttrIdx, + ); +end; + +function XRef.InitChildren();override; +begin + child_elements_ := array( + 0: {self.}SchemeClr, + ); + sorted_child_ := array( + "": -1, + {self.}SchemeClr.ElementName: 0, + ); +end; + +function XRef.InitNode(_node: XmlNode);override; +begin + if ifObj({self.}XmlNode) then + for k,v in child_elements_ do v.InitNode(nil); + {self.}XmlNode := ifObj(_node) ? _node : nil; + node := ifObj(_node) ? _node.FirstChild() : nil; + flag := false; + if ifnil(child_elements_[0]) and length(child_elements_) > 0 then + begin + flag := true; + arr := child_elements_; + child_elements_ := array(); + end + pre := ifString({self.}Prefix) ? {self.}Prefix + ":" : ""; + while ifObj(node) do + begin + node_name := node.GetName(); + pos := sorted_child_[node_name]; + if ifnil(pos) or pos = -1 then + begin + obj := nil; + case node_name of + end; + if ifObj(obj) then obj.InitNode(node); + end + else if flag then + begin + obj := arr[pos]; + obj.InitNode(node); + child_elements_[length(child_elements_)] := obj; + end + else begin + child_elements_[pos].InitNode(node); + end + node := node.NextElement(); + end +end; + +function XRef.Copy(_obj: XRef);override; +begin + if not ifnil(_obj.XmlAttrIdx.Value) then + {self.}XmlAttrIdx.Value := _obj.XmlAttrIdx.Value; + {self.}SchemeClr.Copy(_obj.SchemeClr); +end; + +function XRef.ReadXmlAttrIdx(); +begin + return {self.}XmlAttrIdx.Value; +end; + +function XRef.WriteXmlAttrIdx(_value); +begin + {self.}XmlAttrIdx.Value := _value; +end; diff --git a/docx/Components@DOCX.tsf b/docx/Components@DOCX.tsf index ebc9eea..0f101ce 100644 --- a/docx/Components@DOCX.tsf +++ b/docx/Components@DOCX.tsf @@ -22,6 +22,8 @@ public property Footers read ReadFooters; property Headers read ReadHeaders; property Numbering read ReadNumbering; + property FooterRels read ReadFooterRels; + property HeaderRels read ReadHeaderReals; function ReadRels(); function ReadApp(); function ReadCore(); @@ -41,6 +43,8 @@ public function ReadFooters(_index: integer); function ReadHeaders(_index: integer); function ReadNumbering(); + function ReadFooterRels(_index: integer); + function ReadHeaderReals(_index: integer); protected function NewObject(_name: string): tslobj;override; @@ -67,6 +71,8 @@ private footer_array_: array of Ftr; header_array_: array of Hdr; numbering_: Numbering; + header_rels_array_: array of Relationships; + footer_rels_array_: array of Relationships; end; @@ -98,6 +104,8 @@ begin "footer": array("word/footer%d.xml", "w:ftr"), "header": array("word/header%d.xml", "w:hdr"), "numbering": array("word/numbering.xml", "w:numbering"), + "header_rels": array("word/_rels/header%d.xml.rels", "Relationships"), + "footer_rels": array("word/_rels/footer%d.xml.rels", "Relationships"), ); rels_ := nil; app_ := nil; @@ -117,12 +125,14 @@ begin footer_array_ := array(); header_array_ := array(); numbering_ := nil; + header_rels_array_ := array(); + footer_rels_array_ := array(); end; function Components.NewObject(_name: string): tslobj;override; begin case _name of - "rels", "document_rels", "chart_rels": + "rels", "document_rels", "chart_rels", "footer_rels", "header_rels": return new Relationships(); "app": return new Properties(); @@ -253,3 +263,13 @@ function Components.ReadNumbering(); begin return {self.}GetProp(numbering_, "numbering"); end; + +function Components.ReadHeaderReals(_index: integer); +begin + return {self.}GetPropArr(header_rels_array_, "header_rels", _index); +end; + +function Components.ReadFooterRels(_index: integer); +begin + return {self.}GetPropArr(footer_rels_array_, "footer_rels", _index); +end; diff --git a/openxml/OpenXmlEmpty.tsf b/openxml/OpenXmlEmpty.tsf index d1d0a92..6066e99 100644 --- a/openxml/OpenXmlEmpty.tsf +++ b/openxml/OpenXmlEmpty.tsf @@ -80,6 +80,7 @@ begin end else begin {self.}Value := nil; + {self.}XmlAttrVal.Value := nil; end end;