update DOCX

This commit is contained in:
csh 2024-11-01 16:35:37 +08:00
parent 27013cd4b0
commit 797101d1f3
7 changed files with 117 additions and 15 deletions

View File

@ -0,0 +1,36 @@
type TabsAdapter = class
public
function Create(_obj: Tabs);
function Init();
function GetTabByVal(_key: string);
function SetTabByVal(_key: string; _value: tslobj);
private
object_: Tabs;
tab_hash_: tableArray;
end;
function TabsAdapter.Create(_obj: Tabs);
begin
object_ := _obj;
tab_hash_ := array();
{self.}Init();
end;
function TabsAdapter.Init();
begin
elements := object_.Tabs();
for k,v in elements do
tab_hash_[v.Val] := v;
end;
function TabsAdapter.GetTabByVal(_key: string);
begin
return tab_hash_[_key];
end;
function TabsAdapter.SetTabByVal(_key: string; _value: tslobj);
begin
tab_hash_[_key] := _value;
end;

View File

@ -40,6 +40,8 @@ begin
{self.}BehindDoc := object_.XmlAttrBehindDoc.Value; {self.}BehindDoc := object_.XmlAttrBehindDoc.Value;
if not ifnil(object_.XmlAttrLocked) then if not ifnil(object_.XmlAttrLocked) then
{self.}Locked := object_.XmlAttrLocked.Value; {self.}Locked := object_.XmlAttrLocked.Value;
if not ifnil(object_.XmlAttrHidden) then
{self.}Hidden := object_.XmlAttrHidden.Value;
if not ifnil(object_.XmlAttrLayoutInCell) then if not ifnil(object_.XmlAttrLayoutInCell) then
{self.}LayoutInCell := object_.XmlAttrLayoutInCell.Value; {self.}LayoutInCell := object_.XmlAttrLayoutInCell.Value;
if not ifnil(object_.XmlAttrAllowOverlap) then if not ifnil(object_.XmlAttrAllowOverlap) then

View File

@ -26,6 +26,8 @@ begin
tslassigning := 1; tslassigning := 1;
if not ifnil(object_.XmlAttrFldCharType) then if not ifnil(object_.XmlAttrFldCharType) then
{self.}FldCharType := object_.XmlAttrFldCharType.Value; {self.}FldCharType := object_.XmlAttrFldCharType.Value;
if not ifnil(object_.XmlAttrFldLock) then
{self.}FldLock := object_.XmlAttrFldLock.Value;
if not ifnil(object_.XmlAttrDirty) then if not ifnil(object_.XmlAttrDirty) then
{self.}Dirty := object_.XmlAttrDirty.Value; {self.}Dirty := object_.XmlAttrDirty.Value;
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;

View File

@ -26,6 +26,8 @@ begin
tslassigning := 1; tslassigning := 1;
if not ifnil(object_.XmlChildNoProof) then if not ifnil(object_.XmlChildNoProof) then
{self.}XmlChildNoProof := new PureValUnitDecorator(object_.XmlChildNoProof); {self.}XmlChildNoProof := new PureValUnitDecorator(object_.XmlChildNoProof);
if not ifnil(object_.XmlChildPosition) then
{self.}XmlChildPosition := new PureValUnitDecorator(object_.XmlChildPosition);
if not ifnil(object_.XmlChildWebHidden) then if not ifnil(object_.XmlChildWebHidden) then
{self.}XmlChildWebHidden := new PureWValUnitDecorator(object_.XmlChildWebHidden); {self.}XmlChildWebHidden := new PureWValUnitDecorator(object_.XmlChildWebHidden);
if not ifnil(object_.XmlChildRStyle) then if not ifnil(object_.XmlChildRStyle) then

View File

@ -17,6 +17,7 @@ public
property RelativeHeight read ReadXmlAttrRelativeHeight write WriteXmlAttrRelativeHeight; property RelativeHeight read ReadXmlAttrRelativeHeight write WriteXmlAttrRelativeHeight;
property BehindDoc read ReadXmlAttrBehindDoc write WriteXmlAttrBehindDoc; property BehindDoc read ReadXmlAttrBehindDoc write WriteXmlAttrBehindDoc;
property Locked read ReadXmlAttrLocked write WriteXmlAttrLocked; property Locked read ReadXmlAttrLocked write WriteXmlAttrLocked;
property Hidden read ReadXmlAttrHidden write WriteXmlAttrHidden;
property LayoutInCell read ReadXmlAttrLayoutInCell write WriteXmlAttrLayoutInCell; property LayoutInCell read ReadXmlAttrLayoutInCell write WriteXmlAttrLayoutInCell;
property AllowOverlap read ReadXmlAttrAllowOverlap write WriteXmlAttrAllowOverlap; property AllowOverlap read ReadXmlAttrAllowOverlap write WriteXmlAttrAllowOverlap;
property AnchorId read ReadXmlAttrAnchorId write WriteXmlAttrAnchorId; property AnchorId read ReadXmlAttrAnchorId write WriteXmlAttrAnchorId;
@ -37,6 +38,8 @@ public
function WriteXmlAttrBehindDoc(_value); function WriteXmlAttrBehindDoc(_value);
function ReadXmlAttrLocked(); function ReadXmlAttrLocked();
function WriteXmlAttrLocked(_value); function WriteXmlAttrLocked(_value);
function ReadXmlAttrHidden();
function WriteXmlAttrHidden(_value);
function ReadXmlAttrLayoutInCell(); function ReadXmlAttrLayoutInCell();
function WriteXmlAttrLayoutInCell(_value); function WriteXmlAttrLayoutInCell(_value);
function ReadXmlAttrAllowOverlap(); function ReadXmlAttrAllowOverlap();
@ -83,6 +86,7 @@ public
XmlAttrRelativeHeight: OpenXmlAttribute; XmlAttrRelativeHeight: OpenXmlAttribute;
XmlAttrBehindDoc: OpenXmlAttribute; XmlAttrBehindDoc: OpenXmlAttribute;
XmlAttrLocked: OpenXmlAttribute; XmlAttrLocked: OpenXmlAttribute;
XmlAttrHidden: OpenXmlAttribute;
XmlAttrLayoutInCell: OpenXmlAttribute; XmlAttrLayoutInCell: OpenXmlAttribute;
XmlAttrAllowOverlap: OpenXmlAttribute; XmlAttrAllowOverlap: OpenXmlAttribute;
XmlAttrAnchorId: OpenXmlAttribute; XmlAttrAnchorId: OpenXmlAttribute;
@ -132,6 +136,7 @@ begin
"relativeHeight": makeweakref(thisFunction(WriteXmlAttrRelativeHeight)), "relativeHeight": makeweakref(thisFunction(WriteXmlAttrRelativeHeight)),
"behindDoc": makeweakref(thisFunction(WriteXmlAttrBehindDoc)), "behindDoc": makeweakref(thisFunction(WriteXmlAttrBehindDoc)),
"locked": makeweakref(thisFunction(WriteXmlAttrLocked)), "locked": makeweakref(thisFunction(WriteXmlAttrLocked)),
"hidden": makeweakref(thisFunction(WriteXmlAttrHidden)),
"layoutInCell": makeweakref(thisFunction(WriteXmlAttrLayoutInCell)), "layoutInCell": makeweakref(thisFunction(WriteXmlAttrLayoutInCell)),
"allowOverlap": makeweakref(thisFunction(WriteXmlAttrAllowOverlap)), "allowOverlap": makeweakref(thisFunction(WriteXmlAttrAllowOverlap)),
"wp14:anchorId": makeweakref(thisFunction(WriteXmlAttrAnchorId)), "wp14:anchorId": makeweakref(thisFunction(WriteXmlAttrAnchorId)),
@ -174,6 +179,8 @@ begin
{self.}BehindDoc := _obj.BehindDoc; {self.}BehindDoc := _obj.BehindDoc;
if not ifnil(_obj.Locked) then if not ifnil(_obj.Locked) then
{self.}Locked := _obj.Locked; {self.}Locked := _obj.Locked;
if not ifnil(_obj.Hidden) then
{self.}Hidden := _obj.Hidden;
if not ifnil(_obj.LayoutInCell) then if not ifnil(_obj.LayoutInCell) then
{self.}LayoutInCell := _obj.LayoutInCell; {self.}LayoutInCell := _obj.LayoutInCell;
if not ifnil(_obj.AllowOverlap) then if not ifnil(_obj.AllowOverlap) then
@ -327,6 +334,21 @@ begin
{self.}XmlAttrLocked.Value := _value; {self.}XmlAttrLocked.Value := _value;
end; end;
function Anchor.ReadXmlAttrHidden();
begin
return {self.}XmlAttrHidden.Value;
end;
function Anchor.WriteXmlAttrHidden(_value);
begin
if ifnil({self.}XmlAttrHidden) then
begin
{self.}XmlAttrHidden := new OpenXmlAttribute("", "hidden", nil);
attributes_[length(attributes_)] := {self.}XmlAttrHidden;
end
{self.}XmlAttrHidden.Value := _value;
end;
function Anchor.ReadXmlAttrLayoutInCell(); function Anchor.ReadXmlAttrLayoutInCell();
begin begin
return {self.}XmlAttrLayoutInCell.Value; return {self.}XmlAttrLayoutInCell.Value;

View File

@ -10,15 +10,19 @@ public
// attributes property // attributes property
property FldCharType read ReadXmlAttrFldCharType write WriteXmlAttrFldCharType; property FldCharType read ReadXmlAttrFldCharType write WriteXmlAttrFldCharType;
property FldLock read ReadXmlAttrFldLock write WriteXmlAttrFldLock;
property Dirty read ReadXmlAttrDirty write WriteXmlAttrDirty; property Dirty read ReadXmlAttrDirty write WriteXmlAttrDirty;
function ReadXmlAttrFldCharType(); function ReadXmlAttrFldCharType();
function WriteXmlAttrFldCharType(_value); function WriteXmlAttrFldCharType(_value);
function ReadXmlAttrFldLock();
function WriteXmlAttrFldLock(_value);
function ReadXmlAttrDirty(); function ReadXmlAttrDirty();
function WriteXmlAttrDirty(_value); function WriteXmlAttrDirty(_value);
public public
// Attributes // Attributes
XmlAttrFldCharType: OpenXmlAttribute; XmlAttrFldCharType: OpenXmlAttribute;
XmlAttrFldLock: OpenXmlAttribute;
XmlAttrDirty: OpenXmlAttribute; XmlAttrDirty: OpenXmlAttribute;
@ -46,6 +50,7 @@ begin
attributes_ := array(); attributes_ := array();
attributes_pf_ := array( attributes_pf_ := array(
pre + "fldCharType": makeweakref(thisFunction(WriteXmlAttrFldCharType)), pre + "fldCharType": makeweakref(thisFunction(WriteXmlAttrFldCharType)),
pre + "fldLock": makeweakref(thisFunction(WriteXmlAttrFldLock)),
pre + "dirty": makeweakref(thisFunction(WriteXmlAttrDirty)), pre + "dirty": makeweakref(thisFunction(WriteXmlAttrDirty)),
); );
sorted_child_ := array( sorted_child_ := array(
@ -60,6 +65,8 @@ begin
class(OpenXmlElement).Copy(_obj); class(OpenXmlElement).Copy(_obj);
if not ifnil(_obj.FldCharType) then if not ifnil(_obj.FldCharType) then
{self.}FldCharType := _obj.FldCharType; {self.}FldCharType := _obj.FldCharType;
if not ifnil(_obj.FldLock) then
{self.}FldLock := _obj.FldLock;
if not ifnil(_obj.Dirty) then if not ifnil(_obj.Dirty) then
{self.}Dirty := _obj.Dirty; {self.}Dirty := _obj.Dirty;
tslassigning := tslassigning_backup; tslassigning := tslassigning_backup;
@ -80,6 +87,21 @@ begin
{self.}XmlAttrFldCharType.Value := _value; {self.}XmlAttrFldCharType.Value := _value;
end; end;
function FldChar.ReadXmlAttrFldLock();
begin
return {self.}XmlAttrFldLock.Value;
end;
function FldChar.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 FldChar.ReadXmlAttrDirty(); function FldChar.ReadXmlAttrDirty();
begin begin
return {self.}XmlAttrDirty.Value; return {self.}XmlAttrDirty.Value;

View File

@ -30,6 +30,7 @@ public
// normal property // normal property
property NoProof read ReadXmlChildNoProof; property NoProof read ReadXmlChildNoProof;
property Position read ReadXmlChildPosition;
property WebHidden read ReadXmlChildWebHidden; property WebHidden read ReadXmlChildWebHidden;
property RStyle read ReadXmlChildRStyle; property RStyle read ReadXmlChildRStyle;
property RFonts read ReadXmlChildRFonts; property RFonts read ReadXmlChildRFonts;
@ -40,6 +41,7 @@ public
property Lang read ReadXmlChildLang; property Lang read ReadXmlChildLang;
property W14Ligatures read ReadXmlChildW14Ligatures; property W14Ligatures read ReadXmlChildW14Ligatures;
function ReadXmlChildNoProof(); function ReadXmlChildNoProof();
function ReadXmlChildPosition();
function ReadXmlChildWebHidden(); function ReadXmlChildWebHidden();
function ReadXmlChildRStyle(); function ReadXmlChildRStyle();
function ReadXmlChildRFonts(); function ReadXmlChildRFonts();
@ -53,6 +55,7 @@ public
public public
// Children // Children
XmlChildNoProof: PureVal; XmlChildNoProof: PureVal;
XmlChildPosition: PureVal;
XmlChildWebHidden: PureWVal; XmlChildWebHidden: PureWVal;
XmlChildRStyle: PureWVal; XmlChildRStyle: PureWVal;
XmlChildRFonts: RFonts; XmlChildRFonts: RFonts;
@ -95,21 +98,22 @@ begin
); );
sorted_child_ := array( sorted_child_ := array(
pre + "noProof": array(0, makeweakref(thisFunction(ReadXmlChildNoProof))), pre + "noProof": array(0, makeweakref(thisFunction(ReadXmlChildNoProof))),
pre + "wedHidden": array(1, makeweakref(thisFunction(ReadXmlChildWebHidden))), pre + "position": array(1, makeweakref(thisFunction(ReadXmlChildPosition))),
pre + "rStyle": array(2, makeweakref(thisFunction(ReadXmlChildRStyle))), pre + "wedHidden": array(2, makeweakref(thisFunction(ReadXmlChildWebHidden))),
pre + "rFonts": array(3, makeweakref(thisFunction(ReadXmlChildRFonts))), pre + "rStyle": array(3, makeweakref(thisFunction(ReadXmlChildRStyle))),
pre + "kern": array(4, makeweakref(thisFunction(ReadXmlChildKern))), pre + "rFonts": array(4, makeweakref(thisFunction(ReadXmlChildRFonts))),
pre + "i": array(5, makeweakref(thisFunction(ReadXmlChildI))), pre + "kern": array(5, makeweakref(thisFunction(ReadXmlChildKern))),
pre + "iCs": array(6, makeweakref(thisFunction(ReadXmlChildICs))), pre + "i": array(6, makeweakref(thisFunction(ReadXmlChildI))),
pre + "b": array(7, makeweakref(thisFunction(ReadXmlChildB))), pre + "iCs": array(7, makeweakref(thisFunction(ReadXmlChildICs))),
pre + "bCs": array(8, makeweakref(thisFunction(ReadXmlChildBCs))), pre + "b": array(8, makeweakref(thisFunction(ReadXmlChildB))),
pre + "strike": array(9, makeweakref(thisFunction(ReadXmlChildStrike))), pre + "bCs": array(9, makeweakref(thisFunction(ReadXmlChildBCs))),
pre + "color": array(10, makeweakref(thisFunction(ReadXmlChildColor))), pre + "strike": array(10, makeweakref(thisFunction(ReadXmlChildStrike))),
pre + "sz": array(11, makeweakref(thisFunction(ReadXmlChildSz))), pre + "color": array(11, makeweakref(thisFunction(ReadXmlChildColor))),
pre + "szCs": array(12, makeweakref(thisFunction(ReadXmlChildSzCs))), pre + "sz": array(12, makeweakref(thisFunction(ReadXmlChildSz))),
pre + "u": array(13, makeweakref(thisFunction(ReadXmlChildU))), pre + "szCs": array(13, makeweakref(thisFunction(ReadXmlChildSzCs))),
pre + "lang": array(14, makeweakref(thisFunction(ReadXmlChildLang))), pre + "u": array(14, makeweakref(thisFunction(ReadXmlChildU))),
"w14:ligatures": array(15, makeweakref(thisFunction(ReadXmlChildW14Ligatures))), pre + "lang": array(15, makeweakref(thisFunction(ReadXmlChildLang))),
"w14:ligatures": array(16, makeweakref(thisFunction(ReadXmlChildW14Ligatures))),
); );
container_ := new TSOfficeContainer(sorted_child_); container_ := new TSOfficeContainer(sorted_child_);
end; end;
@ -121,6 +125,8 @@ begin
class(OpenXmlElement).Copy(_obj); class(OpenXmlElement).Copy(_obj);
if not ifnil(_obj.XmlChildNoProof) then if not ifnil(_obj.XmlChildNoProof) then
{self.}NoProof.Copy(_obj.XmlChildNoProof); {self.}NoProof.Copy(_obj.XmlChildNoProof);
if not ifnil(_obj.XmlChildPosition) then
{self.}Position.Copy(_obj.XmlChildPosition);
if not ifnil(_obj.XmlChildWebHidden) then if not ifnil(_obj.XmlChildWebHidden) then
{self.}WebHidden.Copy(_obj.XmlChildWebHidden); {self.}WebHidden.Copy(_obj.XmlChildWebHidden);
if not ifnil(_obj.XmlChildRStyle) then if not ifnil(_obj.XmlChildRStyle) then
@ -290,6 +296,16 @@ begin
return {self.}XmlChildNoProof; return {self.}XmlChildNoProof;
end; end;
function RPr.ReadXmlChildPosition();
begin
if tslassigning and ifnil({self.}XmlChildPosition) then
begin
{self.}XmlChildPosition := new PureVal(self, {self.}Prefix, "position");
container_.Set({self.}XmlChildPosition);
end
return {self.}XmlChildPosition;
end;
function RPr.ReadXmlChildWebHidden(); function RPr.ReadXmlChildWebHidden();
begin begin
if tslassigning and ifnil({self.}XmlChildWebHidden) then if tslassigning and ifnil({self.}XmlChildWebHidden) then