update autounit

This commit is contained in:
csh 2025-03-05 11:33:33 +08:00
parent a816a6f835
commit 87c3aa75f7
2 changed files with 45 additions and 14 deletions

View File

@ -1387,6 +1387,12 @@ public
function ReadXmlChildObject(): Object; function ReadXmlChildObject(): Object;
function ReadXmlChildFootnoteReference(): FootnoteReference; function ReadXmlChildFootnoteReference(): FootnoteReference;
// multi property
property Rs read ReadRs;
function ReadRs(_index);
function AddR(): R;
function AppendR(): R;
public public
// Attributes // Attributes
XmlAttrWRsidRPr: OpenXmlAttribute; XmlAttrWRsidRPr: OpenXmlAttribute;
@ -9258,20 +9264,21 @@ begin
"w:history": makeweakref(thisFunction(WriteXmlAttrHistory)), "w:history": makeweakref(thisFunction(WriteXmlAttrHistory)),
); );
sorted_child_ := array( sorted_child_ := array(
pre + "rPr": array(0, makeweakref(thisFunction(ReadXmlChildRPr))), pre + "r": array(0, makeweakref(thisFunction(AppendR))),
pre + "br": array(1, makeweakref(thisFunction(ReadXmlChildBr))), pre + "rPr": array(1, makeweakref(thisFunction(ReadXmlChildRPr))),
pre + "fldChar": array(2, makeweakref(thisFunction(ReadXmlChildFldChar))), pre + "br": array(2, makeweakref(thisFunction(ReadXmlChildBr))),
pre + "instrText": array(3, makeweakref(thisFunction(ReadXmlChildInstrText))), pre + "fldChar": array(3, makeweakref(thisFunction(ReadXmlChildFldChar))),
pre + "separator": array(4, makeweakref(thisFunction(ReadXmlChildSeparator))), pre + "instrText": array(4, makeweakref(thisFunction(ReadXmlChildInstrText))),
pre + "continuationSeparator": array(5, makeweakref(thisFunction(ReadXmlChildContinuationSeparator))), pre + "separator": array(5, makeweakref(thisFunction(ReadXmlChildSeparator))),
pre + "lastRenderedPageBreak": array(6, makeweakref(thisFunction(ReadXmlChildLastRenderedPageBreak))), pre + "continuationSeparator": array(6, makeweakref(thisFunction(ReadXmlChildContinuationSeparator))),
"mc:AlternateContent": array(7, makeweakref(thisFunction(ReadXmlChildAlternateContent))), pre + "lastRenderedPageBreak": array(7, makeweakref(thisFunction(ReadXmlChildLastRenderedPageBreak))),
pre + "drawing": array(8, makeweakref(thisFunction(ReadXmlChildDrawing))), "mc:AlternateContent": array(8, makeweakref(thisFunction(ReadXmlChildAlternateContent))),
pre + "pict": array(9, makeweakref(thisFunction(ReadXmlChildPict))), pre + "drawing": array(9, makeweakref(thisFunction(ReadXmlChildDrawing))),
pre + "t": array(10, makeweakref(thisFunction(ReadXmlChildT))), pre + "pict": array(10, makeweakref(thisFunction(ReadXmlChildPict))),
pre + "object": array(11, makeweakref(thisFunction(ReadXmlChildObject))), pre + "t": array(11, makeweakref(thisFunction(ReadXmlChildT))),
pre + "footnoteReference": array(12, makeweakref(thisFunction(ReadXmlChildFootnoteReference))), pre + "object": array(12, makeweakref(thisFunction(ReadXmlChildObject))),
pre + "footnoteRef": array(13, makeweakref(thisFunction(ReadXmlChildFootnoteRef))), pre + "footnoteReference": array(13, makeweakref(thisFunction(ReadXmlChildFootnoteReference))),
pre + "footnoteRef": array(14, makeweakref(thisFunction(ReadXmlChildFootnoteRef))),
); );
container_ := new TSOfficeContainer(sorted_child_); container_ := new TSOfficeContainer(sorted_child_);
end; end;
@ -9559,6 +9566,27 @@ begin
return {self.}XmlChildFootnoteReference; return {self.}XmlChildFootnoteReference;
end; end;
function R.ReadRs(_index);
begin
ind := ifnil(_index) ? -2 : _index;
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
return container_.Get(pre + "r", ind);
end;
function R.AddR(): R;
begin
obj := new R(self, {self.}Prefix, "r");
container_.Insert(obj);
return obj;
end;
function R.AppendR(): R;
begin
obj := new R(self, {self.}Prefix, "r");
container_.Append(obj);
return obj;
end;
function Object.Create();overload; function Object.Create();overload;
begin begin
{self.}Create(nil, "w", "object"); {self.}Create(nil, "w", "object");

View File

@ -2139,6 +2139,9 @@ begin
{self.}Anchor := object_.XmlAttrAnchor.Value; {self.}Anchor := object_.XmlAttrAnchor.Value;
if not ifnil(object_.XmlAttrHistory) then if not ifnil(object_.XmlAttrHistory) then
{self.}History := object_.XmlAttrHistory.Value; {self.}History := object_.XmlAttrHistory.Value;
elems := object_.Rs();
for _,elem in elems do
{self.}AppendChild(new RUnitDecorator(elem));
if not ifnil(object_.XmlChildRPr) then if not ifnil(object_.XmlChildRPr) then
{self.}XmlChildRPr := new RPrUnitDecorator(object_.XmlChildRPr); {self.}XmlChildRPr := new RPrUnitDecorator(object_.XmlChildRPr);
if not ifnil(object_.XmlChildBr) then if not ifnil(object_.XmlChildBr) then