Fixes and improvements

This commit is contained in:
csh 2025-02-14 15:26:26 +08:00
parent 41bbf69f79
commit 958b62f72c
10 changed files with 1259 additions and 291 deletions

View File

@ -153,10 +153,12 @@ public
// normal property
property PPr read ReadXmlChildPPr;
property OMathPara read ReadXmlChildOMathPara;
property OMath read ReadXmlChildOMath;
property Ins read ReadXmlChildIns;
property Del read ReadXmlChildDel;
function ReadXmlChildPPr(): PPr;
function ReadXmlChildOMathPara(): OMathPara;
function ReadXmlChildOMath(): OMath;
function ReadXmlChildIns(): Ins;
function ReadXmlChildDel(): Del;
@ -206,6 +208,7 @@ public
// Children
XmlChildPPr: PPr;
XmlChildOMathPara: OMathPara;
XmlChildOMath: OMath;
XmlChildIns: Ins;
XmlChildDel: Del;
end;
@ -219,7 +222,13 @@ public
function Copy(_obj: FldSimple);override;
public
// attributes property
property Dirty read ReadXmlAttrDirty write WriteXmlAttrDirty;
property FldLock read ReadXmlAttrFldLock write WriteXmlAttrFldLock;
property Instr read ReadXmlAttrInstr write WriteXmlAttrInstr;
function ReadXmlAttrDirty();
function WriteXmlAttrDirty(_value);
function ReadXmlAttrFldLock();
function WriteXmlAttrFldLock(_value);
function ReadXmlAttrInstr();
function WriteXmlAttrInstr(_value);
@ -231,6 +240,8 @@ public
public
// Attributes
XmlAttrDirty: OpenXmlAttribute;
XmlAttrFldLock: OpenXmlAttribute;
XmlAttrInstr: OpenXmlAttribute;
// Children
@ -1153,15 +1164,17 @@ public
function Copy(_obj: RFonts);override;
public
// attributes property
property Hint read ReadXmlAttrHint write WriteXmlAttrHint;
property Ascii read ReadXmlAttrAscii write WriteXmlAttrAscii;
property AsciiTheme read ReadXmlAttrAsciiTheme write WriteXmlAttrAsciiTheme;
property EastAsia read ReadXmlAttrEastAsia write WriteXmlAttrEastAsia;
property EastAsiaTheme read ReadXmlAttrEastAsiaTheme write WriteXmlAttrEastAsiaTheme;
property HAnsi read ReadXmlAttrHAnsi write WriteXmlAttrHAnsi;
property HAnsiTheme read ReadXmlAttrHAnsiTheme write WriteXmlAttrHAnsiTheme;
property Hint read ReadXmlAttrHint write WriteXmlAttrHint;
property Cs read ReadXmlAttrCs write WriteXmlAttrCs;
property CsTheme read ReadXmlAttrCsTheme write WriteXmlAttrCsTheme;
function ReadXmlAttrHint();
function WriteXmlAttrHint(_value);
function ReadXmlAttrAscii();
function WriteXmlAttrAscii(_value);
function ReadXmlAttrAsciiTheme();
@ -1174,8 +1187,6 @@ public
function WriteXmlAttrHAnsi(_value);
function ReadXmlAttrHAnsiTheme();
function WriteXmlAttrHAnsiTheme(_value);
function ReadXmlAttrHint();
function WriteXmlAttrHint(_value);
function ReadXmlAttrCs();
function WriteXmlAttrCs(_value);
function ReadXmlAttrCsTheme();
@ -1183,13 +1194,13 @@ public
public
// Attributes
XmlAttrHint: OpenXmlAttribute;
XmlAttrAscii: OpenXmlAttribute;
XmlAttrAsciiTheme: OpenXmlAttribute;
XmlAttrEastAsia: OpenXmlAttribute;
XmlAttrEastAsiaTheme: OpenXmlAttribute;
XmlAttrHAnsi: OpenXmlAttribute;
XmlAttrHAnsiTheme: OpenXmlAttribute;
XmlAttrHint: OpenXmlAttribute;
XmlAttrCs: OpenXmlAttribute;
XmlAttrCsTheme: OpenXmlAttribute;
@ -1233,6 +1244,25 @@ public
end;
type PureVal = class(OpenXmlElement)
public
function Create();overload;
function Create(_node: XmlNode);overload;
function Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
function Init();override;
function Copy(_obj: PureVal);override;
public
// attributes property
property Val read ReadXmlAttrVal write WriteXmlAttrVal;
function ReadXmlAttrVal();
function WriteXmlAttrVal(_value);
public
// Attributes
XmlAttrVal: OpenXmlAttribute;
end;
type PureWVal = class(OpenXmlElement)
public
function Create();overload;
@ -4536,16 +4566,17 @@ begin
sorted_child_ := array(
pre + "pPr": array(0, makeweakref(thisFunction(ReadXmlChildPPr))),
"m:oMathPara": array(1, makeweakref(thisFunction(ReadXmlChildOMathPara))),
pre + "ins": array(2, makeweakref(thisFunction(ReadXmlChildIns))),
pre + "del": array(3, makeweakref(thisFunction(ReadXmlChildDel))),
pre + "sdt": array(4, makeweakref(thisFunction(AppendSdt))),
pre + "r": array(5, makeweakref(thisFunction(AppendR))),
pre + "commentRangeStart": array(6, makeweakref(thisFunction(AppendCommentRangeStart))),
pre + "commentRangeEnd": array(7, makeweakref(thisFunction(AppendCommentRangeEnd))),
pre + "bookmarkStart": array(8, makeweakref(thisFunction(AppendBookmarkStart))),
pre + "bookmarkEnd": array(9, makeweakref(thisFunction(AppendBookmarkEnd))),
pre + "hyperlink": array(10, makeweakref(thisFunction(AppendHyperLink))),
pre + "fldSimple": array(11, makeweakref(thisFunction(AppendFldSimple))),
"m:oMath": array(2, makeweakref(thisFunction(ReadXmlChildOMath))),
pre + "ins": array(3, makeweakref(thisFunction(ReadXmlChildIns))),
pre + "del": array(4, makeweakref(thisFunction(ReadXmlChildDel))),
pre + "sdt": array(5, makeweakref(thisFunction(AppendSdt))),
pre + "r": array(6, makeweakref(thisFunction(AppendR))),
pre + "commentRangeStart": array(7, makeweakref(thisFunction(AppendCommentRangeStart))),
pre + "commentRangeEnd": array(8, makeweakref(thisFunction(AppendCommentRangeEnd))),
pre + "bookmarkStart": array(9, makeweakref(thisFunction(AppendBookmarkStart))),
pre + "bookmarkEnd": array(10, makeweakref(thisFunction(AppendBookmarkEnd))),
pre + "hyperlink": array(11, makeweakref(thisFunction(AppendHyperLink))),
pre + "fldSimple": array(12, makeweakref(thisFunction(AppendFldSimple))),
);
container_ := new TSOfficeContainer(sorted_child_);
end;
@ -4571,6 +4602,8 @@ begin
{self.}PPr.Copy(_obj.XmlChildPPr);
if not ifnil(_obj.XmlChildOMathPara) then
{self.}OMathPara.Copy(_obj.XmlChildOMathPara);
if not ifnil(_obj.XmlChildOMath) then
{self.}OMath.Copy(_obj.XmlChildOMath);
if not ifnil(_obj.XmlChildIns) then
{self.}Ins.Copy(_obj.XmlChildIns);
if not ifnil(_obj.XmlChildDel) then
@ -4688,6 +4721,16 @@ begin
return {self.}XmlChildOMathPara;
end;
function P.ReadXmlChildOMath(): OMath;
begin
if tslassigning and ifnil({self.}XmlChildOMath) then
begin
{self.}XmlChildOMath := new SharedML.OMath(self, "m", "oMath");
container_.Set({self.}XmlChildOMath);
end
return {self.}XmlChildOMath;
end;
function P.ReadXmlChildIns(): Ins;
begin
if tslassigning and ifnil({self.}XmlChildIns) then
@ -4897,6 +4940,8 @@ begin
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
attributes_ := array();
attributes_pf_ := array(
pre + "dirty": makeweakref(thisFunction(WriteXmlAttrDirty)),
pre + "fldLock": makeweakref(thisFunction(WriteXmlAttrFldLock)),
pre + "instr": makeweakref(thisFunction(WriteXmlAttrInstr)),
);
sorted_child_ := array(
@ -4910,11 +4955,45 @@ begin
tslassigning_backup := tslassigning;
tslassigning := 1;
class(OpenXmlElement).Copy(_obj);
if not ifnil(_obj.Dirty) then
{self.}Dirty := _obj.Dirty;
if not ifnil(_obj.FldLock) then
{self.}FldLock := _obj.FldLock;
if not ifnil(_obj.Instr) then
{self.}Instr := _obj.Instr;
tslassigning := tslassigning_backup;
end;
function FldSimple.ReadXmlAttrDirty();
begin
return {self.}XmlAttrDirty.Value;
end;
function FldSimple.WriteXmlAttrDirty(_value);
begin
if ifnil({self.}XmlAttrDirty) then
begin
{self.}XmlAttrDirty := new OpenXmlAttribute({self.}Prefix, "dirty", nil);
attributes_[length(attributes_)] := {self.}XmlAttrDirty;
end
{self.}XmlAttrDirty.Value := _value;
end;
function FldSimple.ReadXmlAttrFldLock();
begin
return {self.}XmlAttrFldLock.Value;
end;
function FldSimple.WriteXmlAttrFldLock(_value);
begin
if ifnil({self.}XmlAttrFldLock) then
begin
{self.}XmlAttrFldLock := new OpenXmlAttribute({self.}Prefix, "fldLock", nil);
attributes_[length(attributes_)] := {self.}XmlAttrFldLock;
end
{self.}XmlAttrFldLock.Value := _value;
end;
function FldSimple.ReadXmlAttrInstr();
begin
return {self.}XmlAttrInstr.Value;
@ -7746,8 +7825,8 @@ begin
attributes_ := array();
attributes_pf_ := array(
pre + "val": makeweakref(thisFunction(WriteXmlAttrVal)),
pre + "Color": makeweakref(thisFunction(WriteXmlAttrColor)),
pre + "Fill": makeweakref(thisFunction(WriteXmlAttrFill)),
pre + "color": makeweakref(thisFunction(WriteXmlAttrColor)),
pre + "fill": makeweakref(thisFunction(WriteXmlAttrFill)),
pre + "themeColor": makeweakref(thisFunction(WriteXmlAttrThemeColor)),
pre + "themeFill": makeweakref(thisFunction(WriteXmlAttrThemeFill)),
pre + "themeFillTint": makeweakref(thisFunction(WriteXmlAttrThemeFillTint)),
@ -7810,7 +7889,7 @@ function Shd.WriteXmlAttrColor(_value);
begin
if ifnil({self.}XmlAttrColor) then
begin
{self.}XmlAttrColor := new OpenXmlAttribute({self.}Prefix, "Color", nil);
{self.}XmlAttrColor := new OpenXmlAttribute({self.}Prefix, "color", nil);
attributes_[length(attributes_)] := {self.}XmlAttrColor;
end
{self.}XmlAttrColor.Value := _value;
@ -7825,7 +7904,7 @@ function Shd.WriteXmlAttrFill(_value);
begin
if ifnil({self.}XmlAttrFill) then
begin
{self.}XmlAttrFill := new OpenXmlAttribute({self.}Prefix, "Fill", nil);
{self.}XmlAttrFill := new OpenXmlAttribute({self.}Prefix, "fill", nil);
attributes_[length(attributes_)] := {self.}XmlAttrFill;
end
{self.}XmlAttrFill.Value := _value;
@ -8585,13 +8664,13 @@ begin
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
attributes_ := array();
attributes_pf_ := array(
pre + "hint": makeweakref(thisFunction(WriteXmlAttrHint)),
pre + "ascii": makeweakref(thisFunction(WriteXmlAttrAscii)),
pre + "asciiTheme": makeweakref(thisFunction(WriteXmlAttrAsciiTheme)),
pre + "eastAsia": makeweakref(thisFunction(WriteXmlAttrEastAsia)),
pre + "eastAsiaTheme": makeweakref(thisFunction(WriteXmlAttrEastAsiaTheme)),
pre + "hAnsi": makeweakref(thisFunction(WriteXmlAttrHAnsi)),
pre + "hAnsiTheme": makeweakref(thisFunction(WriteXmlAttrHAnsiTheme)),
pre + "hint": makeweakref(thisFunction(WriteXmlAttrHint)),
pre + "cs": makeweakref(thisFunction(WriteXmlAttrCs)),
pre + "cstheme": makeweakref(thisFunction(WriteXmlAttrCsTheme)),
);
@ -8605,6 +8684,8 @@ begin
tslassigning_backup := tslassigning;
tslassigning := 1;
class(OpenXmlElement).Copy(_obj);
if not ifnil(_obj.Hint) then
{self.}Hint := _obj.Hint;
if not ifnil(_obj.Ascii) then
{self.}Ascii := _obj.Ascii;
if not ifnil(_obj.AsciiTheme) then
@ -8617,8 +8698,6 @@ begin
{self.}HAnsi := _obj.HAnsi;
if not ifnil(_obj.HAnsiTheme) then
{self.}HAnsiTheme := _obj.HAnsiTheme;
if not ifnil(_obj.Hint) then
{self.}Hint := _obj.Hint;
if not ifnil(_obj.Cs) then
{self.}Cs := _obj.Cs;
if not ifnil(_obj.CsTheme) then
@ -8626,6 +8705,21 @@ begin
tslassigning := tslassigning_backup;
end;
function RFonts.ReadXmlAttrHint();
begin
return {self.}XmlAttrHint.Value;
end;
function RFonts.WriteXmlAttrHint(_value);
begin
if ifnil({self.}XmlAttrHint) then
begin
{self.}XmlAttrHint := new OpenXmlAttribute({self.}Prefix, "hint", nil);
attributes_[length(attributes_)] := {self.}XmlAttrHint;
end
{self.}XmlAttrHint.Value := _value;
end;
function RFonts.ReadXmlAttrAscii();
begin
return {self.}XmlAttrAscii.Value;
@ -8716,21 +8810,6 @@ begin
{self.}XmlAttrHAnsiTheme.Value := _value;
end;
function RFonts.ReadXmlAttrHint();
begin
return {self.}XmlAttrHint.Value;
end;
function RFonts.WriteXmlAttrHint(_value);
begin
if ifnil({self.}XmlAttrHint) then
begin
{self.}XmlAttrHint := new OpenXmlAttribute({self.}Prefix, "hint", nil);
attributes_[length(attributes_)] := {self.}XmlAttrHint;
end
{self.}XmlAttrHint.Value := _value;
end;
function RFonts.ReadXmlAttrCs();
begin
return {self.}XmlAttrCs.Value;
@ -8867,6 +8946,59 @@ begin
{self.}XmlAttrVal.Value := _value;
end;
function PureVal.Create();overload;
begin
{self.}Create(nil, "", "");
end;
function PureVal.Create(_node: XmlNode);overload;
begin
class(OpenXmlElement).Create(_node: XmlNode);
end;
function PureVal.Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
begin
setsysparam(pn_calcctrlword(), getsysparam(pn_calcctrlword()) .| 0x200);
class(OpenXmlElement).Create(_parent, _prefix, _local_name);
end;
function PureVal.Init();override;
begin
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
attributes_ := array();
attributes_pf_ := array(
"val": makeweakref(thisFunction(WriteXmlAttrVal)),
);
sorted_child_ := array(
);
container_ := new TSOfficeContainer(sorted_child_);
end;
function PureVal.Copy(_obj: PureVal);override;
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
class(OpenXmlElement).Copy(_obj);
if not ifnil(_obj.Val) then
{self.}Val := _obj.Val;
tslassigning := tslassigning_backup;
end;
function PureVal.ReadXmlAttrVal();
begin
return {self.}XmlAttrVal.Value;
end;
function PureVal.WriteXmlAttrVal(_value);
begin
if ifnil({self.}XmlAttrVal) then
begin
{self.}XmlAttrVal := new OpenXmlAttribute("", "val", nil);
attributes_[length(attributes_)] := {self.}XmlAttrVal;
end
{self.}XmlAttrVal.Value := _value;
end;
function PureWVal.Create();overload;
begin
{self.}Create(nil, "", "");

View File

@ -245,6 +245,15 @@ private
object_: Sz;
end;
type PureValUnitDecorator = class(PureVal)
public
function Create(_obj: PureVal);
function GetObject();
function Convert();
private
object_: PureVal;
end;
type PureWValUnitDecorator = class(PureWVal)
public
function Create(_obj: PureWVal);
@ -1177,6 +1186,8 @@ begin
{self.}XmlChildPPr := new PPrUnitDecorator(object_.XmlChildPPr);
if not ifnil(object_.XmlChildOMathPara) then
{self.}XmlChildOMathPara := new OMathParaUnitDecorator(object_.XmlChildOMathPara);
if not ifnil(object_.XmlChildOMath) then
{self.}XmlChildOMath := new OMathUnitDecorator(object_.XmlChildOMath);
if not ifnil(object_.XmlChildIns) then
{self.}XmlChildIns := new InsUnitDecorator(object_.XmlChildIns);
if not ifnil(object_.XmlChildDel) then
@ -1224,6 +1235,10 @@ function FldSimpleUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
if not ifnil(object_.XmlAttrDirty) then
{self.}Dirty := object_.XmlAttrDirty.Value;
if not ifnil(object_.XmlAttrFldLock) then
{self.}FldLock := object_.XmlAttrFldLock.Value;
if not ifnil(object_.XmlAttrInstr) then
{self.}Instr := object_.XmlAttrInstr.Value;
elems := object_.Rs();
@ -1949,6 +1964,8 @@ function RFontsUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
if not ifnil(object_.XmlAttrHint) then
{self.}Hint := object_.XmlAttrHint.Value;
if not ifnil(object_.XmlAttrAscii) then
{self.}Ascii := object_.XmlAttrAscii.Value;
if not ifnil(object_.XmlAttrAsciiTheme) then
@ -1961,8 +1978,6 @@ begin
{self.}HAnsi := object_.XmlAttrHAnsi.Value;
if not ifnil(object_.XmlAttrHAnsiTheme) then
{self.}HAnsiTheme := object_.XmlAttrHAnsiTheme.Value;
if not ifnil(object_.XmlAttrHint) then
{self.}Hint := object_.XmlAttrHint.Value;
if not ifnil(object_.XmlAttrCs) then
{self.}Cs := object_.XmlAttrCs.Value;
if not ifnil(object_.XmlAttrCsTheme) then
@ -2012,6 +2027,27 @@ begin
tslassigning := tslassigning_backup;
end;
function PureValUnitDecorator.Create(_obj: PureVal);
begin
class(PureVal).Create();
object_ := _obj;
{self.}Convert();
end;
function PureValUnitDecorator.GetObject();
begin
return object_;
end;
function PureValUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
if not ifnil(object_.XmlAttrVal) then
{self.}Val := object_.XmlAttrVal.Value;
tslassigning := tslassigning_backup;
end;
function PureWValUnitDecorator.Create(_obj: PureWVal);
begin
class(PureWVal).Create();

View File

@ -1,6 +1,6 @@
unit DrawingML;
interface
uses DrawingML;
uses DocxML;
type Theme = class(OpenXmlElement)
public
@ -2397,6 +2397,16 @@ public
function Init();override;
function Copy(_obj: Xfrm);override;
public
// attributes property
property FlipH read ReadXmlAttrFlipH write WriteXmlAttrFlipH;
property FlipV read ReadXmlAttrFlipV write WriteXmlAttrFlipV;
property Rot read ReadXmlAttrRot write WriteXmlAttrRot;
function ReadXmlAttrFlipH();
function WriteXmlAttrFlipH(_value);
function ReadXmlAttrFlipV();
function WriteXmlAttrFlipV(_value);
function ReadXmlAttrRot();
function WriteXmlAttrRot(_value);
// normal property
property Off read ReadXmlChildOff;
@ -2405,6 +2415,11 @@ public
function ReadXmlChildExt(): CXY;
public
// Attributes
XmlAttrFlipH: OpenXmlAttribute;
XmlAttrFlipV: OpenXmlAttribute;
XmlAttrRot: OpenXmlAttribute;
// Children
XmlChildOff: XY;
XmlChildExt: CXY;
@ -8654,7 +8669,7 @@ function DocPr.ReadXmlChildExtLst(): ExtLst;
begin
if tslassigning and ifnil({self.}XmlChildExtLst) then
begin
{self.}XmlChildExtLst := new DrawingML.ExtLst(self, {self.}Prefix, "extLst");
{self.}XmlChildExtLst := new ExtLst(self, {self.}Prefix, "extLst");
container_.Set({self.}XmlChildExtLst);
end
return {self.}XmlChildExtLst;
@ -9196,7 +9211,7 @@ function Txbx.ReadXmlChildTxbxContent(): TxbxContent;
begin
if tslassigning and ifnil({self.}XmlChildTxbxContent) then
begin
{self.}XmlChildTxbxContent := new TxbxContent(self, "w", "txbxContent");
{self.}XmlChildTxbxContent := new DocxML.TxbxContent(self, "w", "txbxContent");
container_.Set({self.}XmlChildTxbxContent);
end
return {self.}XmlChildTxbxContent;
@ -10320,6 +10335,9 @@ begin
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
attributes_ := array();
attributes_pf_ := array(
"filpH": makeweakref(thisFunction(WriteXmlAttrFlipH)),
"filpV": makeweakref(thisFunction(WriteXmlAttrFlipV)),
"rot": makeweakref(thisFunction(WriteXmlAttrRot)),
);
sorted_child_ := array(
pre + "off": array(0, makeweakref(thisFunction(ReadXmlChildOff))),
@ -10333,6 +10351,12 @@ begin
tslassigning_backup := tslassigning;
tslassigning := 1;
class(OpenXmlElement).Copy(_obj);
if not ifnil(_obj.FlipH) then
{self.}FlipH := _obj.FlipH;
if not ifnil(_obj.FlipV) then
{self.}FlipV := _obj.FlipV;
if not ifnil(_obj.Rot) then
{self.}Rot := _obj.Rot;
if not ifnil(_obj.XmlChildOff) then
{self.}Off.Copy(_obj.XmlChildOff);
if not ifnil(_obj.XmlChildExt) then
@ -10340,6 +10364,51 @@ begin
tslassigning := tslassigning_backup;
end;
function Xfrm.ReadXmlAttrFlipH();
begin
return {self.}XmlAttrFlipH.Value;
end;
function Xfrm.WriteXmlAttrFlipH(_value);
begin
if ifnil({self.}XmlAttrFlipH) then
begin
{self.}XmlAttrFlipH := new OpenXmlAttribute("", "filpH", nil);
attributes_[length(attributes_)] := {self.}XmlAttrFlipH;
end
{self.}XmlAttrFlipH.Value := _value;
end;
function Xfrm.ReadXmlAttrFlipV();
begin
return {self.}XmlAttrFlipV.Value;
end;
function Xfrm.WriteXmlAttrFlipV(_value);
begin
if ifnil({self.}XmlAttrFlipV) then
begin
{self.}XmlAttrFlipV := new OpenXmlAttribute("", "filpV", nil);
attributes_[length(attributes_)] := {self.}XmlAttrFlipV;
end
{self.}XmlAttrFlipV.Value := _value;
end;
function Xfrm.ReadXmlAttrRot();
begin
return {self.}XmlAttrRot.Value;
end;
function Xfrm.WriteXmlAttrRot(_value);
begin
if ifnil({self.}XmlAttrRot) then
begin
{self.}XmlAttrRot := new OpenXmlAttribute("", "rot", nil);
attributes_[length(attributes_)] := {self.}XmlAttrRot;
end
{self.}XmlAttrRot.Value := _value;
end;
function Xfrm.ReadXmlChildOff(): XY;
begin
if tslassigning and ifnil({self.}XmlChildOff) then

View File

@ -3059,6 +3059,12 @@ function XfrmUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
if not ifnil(object_.XmlAttrFlipH) then
{self.}FlipH := object_.XmlAttrFlipH.Value;
if not ifnil(object_.XmlAttrFlipV) then
{self.}FlipV := object_.XmlAttrFlipV.Value;
if not ifnil(object_.XmlAttrRot) then
{self.}Rot := object_.XmlAttrRot.Value;
if not ifnil(object_.XmlChildOff) then
{self.}XmlChildOff := new XYUnitDecorator(object_.XmlChildOff);
if not ifnil(object_.XmlChildExt) then

File diff suppressed because it is too large Load Diff

View File

@ -110,6 +110,33 @@ private
object_: E;
end;
type SSupUnitDecorator = class(SSup)
public
function Create(_obj: SSup);
function GetObject();
function Convert();
private
object_: SSup;
end;
type SSupPrUnitDecorator = class(SSupPr)
public
function Create(_obj: SSupPr);
function GetObject();
function Convert();
private
object_: SSupPr;
end;
type SupUnitDecorator = class(Sup)
public
function Create(_obj: Sup);
function GetObject();
function Convert();
private
object_: Sup;
end;
type FUnitDecorator = class(F)
public
function Create(_obj: F);
@ -137,6 +164,33 @@ private
object_: Num;
end;
type RadUnitDecorator = class(Rad)
public
function Create(_obj: Rad);
function GetObject();
function Convert();
private
object_: Rad;
end;
type RadPrUnitDecorator = class(RadPr)
public
function Create(_obj: RadPr);
function GetObject();
function Convert();
private
object_: RadPr;
end;
type DegUnitDecorator = class(Deg)
public
function Create(_obj: Deg);
function GetObject();
function Convert();
private
object_: Deg;
end;
type DenUnitDecorator = class(Den)
public
function Create(_obj: Den);
@ -191,15 +245,6 @@ private
object_: NaryPr;
end;
type SupUnitDecorator = class(Sup)
public
function Create(_obj: Sup);
function GetObject();
function Convert();
private
object_: Sup;
end;
type FuncUnitDecorator = class(Func)
public
function Create(_obj: Func);
@ -429,6 +474,10 @@ begin
elems := object_.Ds();
for _,elem in elems do
{self.}AppendChild(new DUnitDecorator(elem));
if not ifnil(object_.XmlChildF) then
{self.}XmlChildF := new FUnitDecorator(object_.XmlChildF);
if not ifnil(object_.XmlChildRad) then
{self.}XmlChildRad := new RadUnitDecorator(object_.XmlChildRad);
if not ifnil(object_.XmlChildSSub) then
{self.}XmlChildSSub := new SSubUnitDecorator(object_.XmlChildSSub);
if not ifnil(object_.XmlChildNary) then
@ -544,6 +593,16 @@ function DPrUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
if not ifnil(object_.XmlChildBegChr) then
{self.}XmlChildBegChr := new PureMValUnitDecorator(object_.XmlChildBegChr);
if not ifnil(object_.XmlChildEndChr) then
{self.}XmlChildEndChr := new PureMValUnitDecorator(object_.XmlChildEndChr);
if not ifnil(object_.XmlChildSepChr) then
{self.}XmlChildSepChr := new PureMValUnitDecorator(object_.XmlChildSepChr);
if not ifnil(object_.XmlChildShp) then
{self.}XmlChildShp := new PureMValUnitDecorator(object_.XmlChildShp);
if not ifnil(object_.XmlChildGrow) then
{self.}XmlChildGrow := new PureMValUnitDecorator(object_.XmlChildGrow);
if not ifnil(object_.XmlChildCtrlPr) then
{self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr);
if not ifnil(object_.XmlChildRPr) then
@ -596,14 +655,87 @@ begin
elems := object_.Ds();
for _,elem in elems do
{self.}AppendChild(new DUnitDecorator(elem));
if not ifnil(object_.XmlChildF) then
{self.}XmlChildF := new FUnitDecorator(object_.XmlChildF);
elems := object_.SSups();
for _,elem in elems do
{self.}AppendChild(new SSupUnitDecorator(elem));
elems := object_.SSubs();
for _,elem in elems do
{self.}AppendChild(new SSubUnitDecorator(elem));
elems := object_.Funcs();
for _,elem in elems do
{self.}AppendChild(new FuncUnitDecorator(elem));
if not ifnil(object_.XmlChildF) then
{self.}XmlChildF := new FUnitDecorator(object_.XmlChildF);
if not ifnil(object_.XmlChildCtrlPr) then
{self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr);
tslassigning := tslassigning_backup;
end;
function SSupUnitDecorator.Create(_obj: SSup);
begin
class(SSup).Create();
object_ := _obj;
{self.}Convert();
end;
function SSupUnitDecorator.GetObject();
begin
return object_;
end;
function SSupUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
if not ifnil(object_.XmlChildSSupPr) then
{self.}XmlChildSSupPr := new SSupPrUnitDecorator(object_.XmlChildSSupPr);
if not ifnil(object_.XmlChildE) then
{self.}XmlChildE := new EUnitDecorator(object_.XmlChildE);
if not ifnil(object_.XmlChildSup) then
{self.}XmlChildSup := new SupUnitDecorator(object_.XmlChildSup);
tslassigning := tslassigning_backup;
end;
function SSupPrUnitDecorator.Create(_obj: SSupPr);
begin
class(SSupPr).Create();
object_ := _obj;
{self.}Convert();
end;
function SSupPrUnitDecorator.GetObject();
begin
return object_;
end;
function SSupPrUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
if not ifnil(object_.XmlChildCtrlPr) then
{self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr);
tslassigning := tslassigning_backup;
end;
function SupUnitDecorator.Create(_obj: Sup);
begin
class(Sup).Create();
object_ := _obj;
{self.}Convert();
end;
function SupUnitDecorator.GetObject();
begin
return object_;
end;
function SupUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
elems := object_.Rs();
for _,elem in elems do
{self.}AppendChild(new RUnitDecorator(elem));
if not ifnil(object_.XmlChildCtrlPr) then
{self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr);
tslassigning := tslassigning_backup;
@ -676,6 +808,79 @@ begin
elems := object_.Rs();
for _,elem in elems do
{self.}AppendChild(new RUnitDecorator(elem));
if not ifnil(object_.XmlChildRad) then
{self.}XmlChildRad := new RadUnitDecorator(object_.XmlChildRad);
if not ifnil(object_.XmlChildCtrlPr) then
{self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr);
tslassigning := tslassigning_backup;
end;
function RadUnitDecorator.Create(_obj: Rad);
begin
class(Rad).Create();
object_ := _obj;
{self.}Convert();
end;
function RadUnitDecorator.GetObject();
begin
return object_;
end;
function RadUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
if not ifnil(object_.XmlChildRadPr) then
{self.}XmlChildRadPr := new RadPrUnitDecorator(object_.XmlChildRadPr);
if not ifnil(object_.XmlChildDeg) then
{self.}XmlChildDeg := new DegUnitDecorator(object_.XmlChildDeg);
if not ifnil(object_.XmlChildE) then
{self.}XmlChildE := new EUnitDecorator(object_.XmlChildE);
tslassigning := tslassigning_backup;
end;
function RadPrUnitDecorator.Create(_obj: RadPr);
begin
class(RadPr).Create();
object_ := _obj;
{self.}Convert();
end;
function RadPrUnitDecorator.GetObject();
begin
return object_;
end;
function RadPrUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
if not ifnil(object_.XmlChildDegHide) then
{self.}XmlChildDegHide := new PureMValUnitDecorator(object_.XmlChildDegHide);
if not ifnil(object_.XmlChildCtrlPr) then
{self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr);
tslassigning := tslassigning_backup;
end;
function DegUnitDecorator.Create(_obj: Deg);
begin
class(Deg).Create();
object_ := _obj;
{self.}Convert();
end;
function DegUnitDecorator.GetObject();
begin
return object_;
end;
function DegUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
if not ifnil(object_.XmlChildCtrlPr) then
{self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr);
tslassigning := tslassigning_backup;
end;
@ -816,33 +1021,19 @@ begin
tslassigning := 1;
if not ifnil(object_.XmlChildChr) then
{self.}XmlChildChr := new PureMValUnitDecorator(object_.XmlChildChr);
if not ifnil(object_.XmlChildGrow) then
{self.}XmlChildGrow := new PureMValUnitDecorator(object_.XmlChildGrow);
if not ifnil(object_.XmlChildSubHide) then
{self.}XmlChildSubHide := new PureMValUnitDecorator(object_.XmlChildSubHide);
if not ifnil(object_.XmlChildSupHide) then
{self.}XmlChildSupHide := new PureMValUnitDecorator(object_.XmlChildSupHide);
if not ifnil(object_.XmlChildLimLoc) then
{self.}XmlChildLimLoc := new PureMValUnitDecorator(object_.XmlChildLimLoc);
if not ifnil(object_.XmlChildCtrlPr) then
{self.}XmlChildCtrlPr := new CtrlPrUnitDecorator(object_.XmlChildCtrlPr);
tslassigning := tslassigning_backup;
end;
function SupUnitDecorator.Create(_obj: Sup);
begin
class(Sup).Create();
object_ := _obj;
{self.}Convert();
end;
function SupUnitDecorator.GetObject();
begin
return object_;
end;
function SupUnitDecorator.Convert();
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
elems := object_.Rs();
for _,elem in elems do
{self.}AppendChild(new RUnitDecorator(elem));
tslassigning := tslassigning_backup;
end;
function FuncUnitDecorator.Create(_obj: Func);
begin
class(Func).Create();

View File

@ -227,7 +227,6 @@ end;
function DocxComponents.ReadThemes(_index);
begin
uses DrawingXml;
return {self.}GetPropArr(theme_array_, "theme", _index);
end;

View File

@ -11,8 +11,6 @@ public
ElementName: string;
Value: any;
protected
namespace_uri_: string;
end;
function OpenXmlAttribute.Create(_prefix: string; _local_name: string);overload;

View File

@ -1,64 +0,0 @@
type XlsxSheetData = class
public
function Create(sheet_data: SheetData);
function Operator[](index: integer): XlsxSheetDataRow;
function Cell(r: integer; c: integer): C;
function Rows(index: integer): XlsxSheetDataRow;
function Serialize();
private
rows_: array of XlsxSheetDataRow;
sheet_data_: SheetData;
end;
function XlsxSheetData.Create(sheet_data: SheetData);
begin
rows_ := array();
sheet_data_ := sheet_data;
rows := sheet_data.Rows();
for i:=0 to length(rows)-1 do
begin
r := strToInt(rows[i].R);
rows_[r] := new XlsxSheetDataRow(rows[i]);
end
// println("rows = {}", rows_);
end;
function Operator XlsxSheetData.[](index: integer): XlsxSheetDataRow;
begin
if ifnil(rows_[index]) and tslassigning then
begin
row := new Row(sheet_data_, "", "row");
rows_[index] := new XlsxSheetDataRow(row);
pos := -1;
for k,_ in rows_ do // TODO此处弊端是要遍历所有k可考虑维护一个新array用二分
if pos < k and k < index then pos := k;
pos = -1 ? sheet_data_.AppendChild(row) : sheet_data_.InsertAfter(row, rows_[pos].Data());
end
return rows_[index];
end;
function XlsxSheetData.Rows(index: integer): XlsxSheetDataRow;
begin
return self[index];
end;
function XlsxSheetData.Cell(r: integer; c: integer): C;
begin
bk := tslassigning;
tslassigning := 1;
c := self[r][c];
tslassigning := bk;
return c;
end;
function XlsxSheetData.Serialize();
begin
for k,row in rows_ do
begin
r := row.Data();
r.R := k;
row.Serialize();
end
// sheet_data_.Serialize();
end;

View File

@ -1,63 +0,0 @@
type XlsxSheetDataRow = class
public
function Create(row: Row);
function Operator[](index: integer): XlsxSheetDataCol;
function Cols(index: integer): XlsxSheetDataCol;
function Data(): Row;
function Serialize();
public
row_: Row;
cols_: array of XlsxSheetDataCol;
end;
function XlsxSheetDataRow.Create(row: Row);
begin
row_ := row;
cols_ := array();
cs := row.Cs();
for i:=0 to length(cs)-1 do
begin
r := cs[i].R;
cell_name := SplitCellName(r);
index := ColumnNameToNumber(cell_name[1])[1];
cols_[index] := cs[i];
end
// println("cols_ = {}", cols_);
end;
function Operator XlsxSheetDataRow.[](index: integer): XlsxSheetDataCol;
begin
if ifnil(cols_[index]) and tslassigning then
begin
col := new C(row_, "", "c");
cols_[index] := col;
pos := -1;
for k,_ in cols_ do
if pos < k and k < index then pos := k;
pos = -1 ? row_.AppendChild(col) : row_.InsertAfter(col, cols_[pos]);
end
return cols_[index];
end;
function XlsxSheetDataRow.Cols(index: integer): XlsxSheetDataCol;
begin
return self[index];
end;
function XlsxSheetDataRow.Data(): Row;
begin
return row_;
end;
function XlsxSheetDataRow.Serialize();
begin
for k,c in cols_ do
begin
c.R := CoordinatesToCellName(k, row_.R)[1];
c.Serialize();
// println("c.R = {}, row.R = {}", c.R, row_.R);
end
row_.Serialize();
end;