完善对页眉页脚的支持

This commit is contained in:
csh
2024-08-27 15:59:44 +08:00
parent 4c6f4d6e09
commit ca18537538
3 changed files with 21 additions and 9 deletions
+15 -3
View File
@@ -85,13 +85,15 @@ begin
begin
empty_flag := false;
{self.}SetRPr(element.RPr, ppr_unit_decorator_);
if element.FldChar.FldCharType = "separate" then
if element.FldChar.FldCharType = "begin" then
continue;
else if element.FldChar.FldCharType = "separate" then
fld := true;
else if element.FldChar.FldCharType = "end" then
fld := false;
else if element.InstrText.Text = "PAGE \\* Arabic \\* MERGEFORMAT" then
else if ifString(element.InstrText.Text) and trim(element.InstrText.Text) = "PAGE \\* Arabic \\* MERGEFORMAT" then
page_number := true;
else if element.InstrText.Text = " NUMPAGES " then
else if ifString(element.InstrText.Text) and trim(element.InstrText.Text) = "NUMPAGES" then
numpages := true;
else if fld and page_number then
begin
@@ -112,6 +114,16 @@ begin
else if ifObj(element.AlternateContent.XmlNode) then {self.}RAlternateContentToRange(element);
else if not fld then {self.}RToTextRange(element, bookmark_name);
end
else if element.LocalName = "fldSimple" then
begin
if ifString(element.Instr) and trim(element.Instr) = "NUMPAGES \\* Arabic \\* MERGEFORMAT" then
begin
rpr := new RPrUnitDecorator(element.Rs(0).RPr);
numpages_index := length(range_array_);
placeholder_array_ := array(numpages_index, rpr);
numpages := false;
end
end
else if element.LocalName = "hyperlink" then
begin
empty_flag := false;