aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2024-12-22 13:18:27 -0800
committerJohn MacFarlane <[email protected]>2024-12-22 13:18:27 -0800
commitb6aff2145231a7284b47b030c08a6410fb114ec1 (patch)
tree7121ea41c9f833b975d9558a2312a8ab6cbb0a14
parentab29a767ff292d41bc6f76da4e02b81b9f298a03 (diff)
Docx writer: restart footnotes by section by default.
This can be overridden by a final sectPr element in the body of the reference.docx. It will only change things for `--top-level-division=chapter`, since only top-level chapters are put in separate sections. For that use it will mean that footnote numbers start over with each chapter, which is usually what is wanted. Closes #2773.
-rw-r--r--data/docx/word/document.xml12
-rw-r--r--data/templates/default.openxml6
-rw-r--r--test/docx/golden/block_quotes.docxbin10657 -> 10691 bytes
-rw-r--r--test/docx/golden/codeblock.docxbin10474 -> 10508 bytes
-rw-r--r--test/docx/golden/comments.docxbin10805 -> 10838 bytes
-rw-r--r--test/docx/golden/custom_style_no_reference.docxbin10577 -> 10611 bytes
-rw-r--r--test/docx/golden/custom_style_preserve.docxbin11204 -> 11235 bytes
-rw-r--r--test/docx/golden/custom_style_reference.docxbin12436 -> 12470 bytes
-rw-r--r--test/docx/golden/definition_list.docxbin10474 -> 10506 bytes
-rw-r--r--test/docx/golden/document-properties-short-desc.docxbin10481 -> 10509 bytes
-rw-r--r--test/docx/golden/document-properties.docxbin10967 -> 10996 bytes
-rw-r--r--test/docx/golden/headers.docxbin10614 -> 10651 bytes
-rw-r--r--test/docx/golden/image.docxbin27354 -> 27389 bytes
-rw-r--r--test/docx/golden/inline_code.docxbin10413 -> 10449 bytes
-rw-r--r--test/docx/golden/inline_formatting.docxbin10592 -> 10626 bytes
-rw-r--r--test/docx/golden/inline_images.docxbin27350 -> 27383 bytes
-rw-r--r--test/docx/golden/link_in_notes.docxbin10635 -> 10665 bytes
-rw-r--r--test/docx/golden/links.docxbin10804 -> 10840 bytes
-rw-r--r--test/docx/golden/lists.docxbin11003 -> 11035 bytes
-rw-r--r--test/docx/golden/lists_9994.docxbin10758 -> 10787 bytes
-rw-r--r--test/docx/golden/lists_continuing.docxbin10667 -> 10702 bytes
-rw-r--r--test/docx/golden/lists_div_bullets.docxbin10651 -> 10685 bytes
-rw-r--r--test/docx/golden/lists_multiple_initial.docxbin10885 -> 10917 bytes
-rw-r--r--test/docx/golden/lists_restarting.docxbin10665 -> 10699 bytes
-rw-r--r--test/docx/golden/nested_anchors_in_header.docxbin10806 -> 10843 bytes
-rw-r--r--test/docx/golden/notes.docxbin10583 -> 10614 bytes
-rw-r--r--test/docx/golden/raw-blocks.docxbin10512 -> 10542 bytes
-rw-r--r--test/docx/golden/raw-bookmarks.docxbin10646 -> 10681 bytes
-rw-r--r--test/docx/golden/table_one_row.docxbin10487 -> 10520 bytes
-rw-r--r--test/docx/golden/table_with_list_cell.docxbin10939 -> 10972 bytes
-rw-r--r--test/docx/golden/tables-default-widths.docxbin10850 -> 10883 bytes
-rw-r--r--test/docx/golden/tables.docxbin10863 -> 10897 bytes
-rw-r--r--test/docx/golden/tables_separated_with_rawblock.docxbin10485 -> 10517 bytes
-rw-r--r--test/docx/golden/task_list.docxbin10750 -> 10782 bytes
-rw-r--r--test/docx/golden/track_changes_deletion.docxbin10457 -> 10489 bytes
-rw-r--r--test/docx/golden/track_changes_insertion.docxbin10439 -> 10472 bytes
-rw-r--r--test/docx/golden/track_changes_move.docxbin10470 -> 10504 bytes
-rw-r--r--test/docx/golden/track_changes_scrubbed_metadata.docxbin10584 -> 10617 bytes
-rw-r--r--test/docx/golden/unicode.docxbin10431 -> 10466 bytes
-rw-r--r--test/docx/golden/verbatim_subsuper.docxbin10444 -> 10478 bytes
40 files changed, 13 insertions, 5 deletions
diff --git a/data/docx/word/document.xml b/data/docx/word/document.xml
index 475ae1894..aca3487d2 100644
--- a/data/docx/word/document.xml
+++ b/data/docx/word/document.xml
@@ -189,7 +189,7 @@ Body Text. Body Text Char.
</w:r>
<w:r>
<w:t xml:space="preserve">
-
+
</w:t>
</w:r>
<w:r>
@@ -207,7 +207,7 @@ Verbatim Char
</w:r>
<w:r>
<w:t xml:space="preserve">
-
+
</w:t>
</w:r>
<w:hyperlink r:id="rId30">
@@ -227,7 +227,7 @@ Hyperlink
</w:r>
<w:r>
<w:t xml:space="preserve">
-
+
</w:t>
</w:r>
<w:r>
@@ -391,6 +391,10 @@ Definition
</w:t>
</w:r>
</w:p>
- <w:sectPr />
+ <w:sectPr>
+ <w:footnotePr>
+ <w:numRestart w:val="eachSect" />
+ </w:footnotePr>
+ </w:sectPr>
</w:body>
</w:document>
diff --git a/data/templates/default.openxml b/data/templates/default.openxml
index 000609df7..b86efffa2 100644
--- a/data/templates/default.openxml
+++ b/data/templates/default.openxml
@@ -64,7 +64,11 @@ $-- sectpr will be set to the last sectpr in a reference.docx, if present
$if(sectpr)$
$sectpr$
$else$
- <w:sectPr />
+ <w:sectPr>
+ <w:footnotePr>
+ <w:numRestart w:val="eachSect" />
+ </w:footnotePr>
+ </w:sectPr>
$endif$
</w:body>
</w:document>
diff --git a/test/docx/golden/block_quotes.docx b/test/docx/golden/block_quotes.docx
index abd6fbdf1..d948c834d 100644
--- a/test/docx/golden/block_quotes.docx
+++ b/test/docx/golden/block_quotes.docx
Binary files differ
diff --git a/test/docx/golden/codeblock.docx b/test/docx/golden/codeblock.docx
index 302f661ad..a18b27af6 100644
--- a/test/docx/golden/codeblock.docx
+++ b/test/docx/golden/codeblock.docx
Binary files differ
diff --git a/test/docx/golden/comments.docx b/test/docx/golden/comments.docx
index 50601caf6..8049a19f3 100644
--- a/test/docx/golden/comments.docx
+++ b/test/docx/golden/comments.docx
Binary files differ
diff --git a/test/docx/golden/custom_style_no_reference.docx b/test/docx/golden/custom_style_no_reference.docx
index ea4b7608c..6c488a2f5 100644
--- a/test/docx/golden/custom_style_no_reference.docx
+++ b/test/docx/golden/custom_style_no_reference.docx
Binary files differ
diff --git a/test/docx/golden/custom_style_preserve.docx b/test/docx/golden/custom_style_preserve.docx
index c0939143c..dc77bd69a 100644
--- a/test/docx/golden/custom_style_preserve.docx
+++ b/test/docx/golden/custom_style_preserve.docx
Binary files differ
diff --git a/test/docx/golden/custom_style_reference.docx b/test/docx/golden/custom_style_reference.docx
index 16c94d068..149b3db55 100644
--- a/test/docx/golden/custom_style_reference.docx
+++ b/test/docx/golden/custom_style_reference.docx
Binary files differ
diff --git a/test/docx/golden/definition_list.docx b/test/docx/golden/definition_list.docx
index d4adb9e1b..365f3dd1b 100644
--- a/test/docx/golden/definition_list.docx
+++ b/test/docx/golden/definition_list.docx
Binary files differ
diff --git a/test/docx/golden/document-properties-short-desc.docx b/test/docx/golden/document-properties-short-desc.docx
index 1f74335fa..62092834b 100644
--- a/test/docx/golden/document-properties-short-desc.docx
+++ b/test/docx/golden/document-properties-short-desc.docx
Binary files differ
diff --git a/test/docx/golden/document-properties.docx b/test/docx/golden/document-properties.docx
index b2685f7c7..2b8c5d79c 100644
--- a/test/docx/golden/document-properties.docx
+++ b/test/docx/golden/document-properties.docx
Binary files differ
diff --git a/test/docx/golden/headers.docx b/test/docx/golden/headers.docx
index 678e2a1ca..b772cac90 100644
--- a/test/docx/golden/headers.docx
+++ b/test/docx/golden/headers.docx
Binary files differ
diff --git a/test/docx/golden/image.docx b/test/docx/golden/image.docx
index 90be4af5d..fc349dc48 100644
--- a/test/docx/golden/image.docx
+++ b/test/docx/golden/image.docx
Binary files differ
diff --git a/test/docx/golden/inline_code.docx b/test/docx/golden/inline_code.docx
index 1bcf6866c..6589c1fae 100644
--- a/test/docx/golden/inline_code.docx
+++ b/test/docx/golden/inline_code.docx
Binary files differ
diff --git a/test/docx/golden/inline_formatting.docx b/test/docx/golden/inline_formatting.docx
index bcdaa624e..b427dd7b6 100644
--- a/test/docx/golden/inline_formatting.docx
+++ b/test/docx/golden/inline_formatting.docx
Binary files differ
diff --git a/test/docx/golden/inline_images.docx b/test/docx/golden/inline_images.docx
index cff435829..06710261b 100644
--- a/test/docx/golden/inline_images.docx
+++ b/test/docx/golden/inline_images.docx
Binary files differ
diff --git a/test/docx/golden/link_in_notes.docx b/test/docx/golden/link_in_notes.docx
index b860f0945..91d8e8c05 100644
--- a/test/docx/golden/link_in_notes.docx
+++ b/test/docx/golden/link_in_notes.docx
Binary files differ
diff --git a/test/docx/golden/links.docx b/test/docx/golden/links.docx
index 29b8eb794..9c969c449 100644
--- a/test/docx/golden/links.docx
+++ b/test/docx/golden/links.docx
Binary files differ
diff --git a/test/docx/golden/lists.docx b/test/docx/golden/lists.docx
index 777430926..f20b040a8 100644
--- a/test/docx/golden/lists.docx
+++ b/test/docx/golden/lists.docx
Binary files differ
diff --git a/test/docx/golden/lists_9994.docx b/test/docx/golden/lists_9994.docx
index a8cb21372..4aedf4077 100644
--- a/test/docx/golden/lists_9994.docx
+++ b/test/docx/golden/lists_9994.docx
Binary files differ
diff --git a/test/docx/golden/lists_continuing.docx b/test/docx/golden/lists_continuing.docx
index a24e04fe2..0430c2fd9 100644
--- a/test/docx/golden/lists_continuing.docx
+++ b/test/docx/golden/lists_continuing.docx
Binary files differ
diff --git a/test/docx/golden/lists_div_bullets.docx b/test/docx/golden/lists_div_bullets.docx
index 6eafe8cf4..9f26682f1 100644
--- a/test/docx/golden/lists_div_bullets.docx
+++ b/test/docx/golden/lists_div_bullets.docx
Binary files differ
diff --git a/test/docx/golden/lists_multiple_initial.docx b/test/docx/golden/lists_multiple_initial.docx
index ec7555793..69b265436 100644
--- a/test/docx/golden/lists_multiple_initial.docx
+++ b/test/docx/golden/lists_multiple_initial.docx
Binary files differ
diff --git a/test/docx/golden/lists_restarting.docx b/test/docx/golden/lists_restarting.docx
index 4b72c3668..937898c3f 100644
--- a/test/docx/golden/lists_restarting.docx
+++ b/test/docx/golden/lists_restarting.docx
Binary files differ
diff --git a/test/docx/golden/nested_anchors_in_header.docx b/test/docx/golden/nested_anchors_in_header.docx
index 77dcc9f14..e014d263a 100644
--- a/test/docx/golden/nested_anchors_in_header.docx
+++ b/test/docx/golden/nested_anchors_in_header.docx
Binary files differ
diff --git a/test/docx/golden/notes.docx b/test/docx/golden/notes.docx
index 045f6e81d..b8466226e 100644
--- a/test/docx/golden/notes.docx
+++ b/test/docx/golden/notes.docx
Binary files differ
diff --git a/test/docx/golden/raw-blocks.docx b/test/docx/golden/raw-blocks.docx
index 7f834d67a..c1cd25a0f 100644
--- a/test/docx/golden/raw-blocks.docx
+++ b/test/docx/golden/raw-blocks.docx
Binary files differ
diff --git a/test/docx/golden/raw-bookmarks.docx b/test/docx/golden/raw-bookmarks.docx
index 5250f9eaf..39177e14e 100644
--- a/test/docx/golden/raw-bookmarks.docx
+++ b/test/docx/golden/raw-bookmarks.docx
Binary files differ
diff --git a/test/docx/golden/table_one_row.docx b/test/docx/golden/table_one_row.docx
index 420adde76..e5c197b63 100644
--- a/test/docx/golden/table_one_row.docx
+++ b/test/docx/golden/table_one_row.docx
Binary files differ
diff --git a/test/docx/golden/table_with_list_cell.docx b/test/docx/golden/table_with_list_cell.docx
index 94d5a1ad8..ed5fc1c7d 100644
--- a/test/docx/golden/table_with_list_cell.docx
+++ b/test/docx/golden/table_with_list_cell.docx
Binary files differ
diff --git a/test/docx/golden/tables-default-widths.docx b/test/docx/golden/tables-default-widths.docx
index 3cf32fbfd..c21ccdf1e 100644
--- a/test/docx/golden/tables-default-widths.docx
+++ b/test/docx/golden/tables-default-widths.docx
Binary files differ
diff --git a/test/docx/golden/tables.docx b/test/docx/golden/tables.docx
index dc7bfe26e..c211984c4 100644
--- a/test/docx/golden/tables.docx
+++ b/test/docx/golden/tables.docx
Binary files differ
diff --git a/test/docx/golden/tables_separated_with_rawblock.docx b/test/docx/golden/tables_separated_with_rawblock.docx
index a9e86de00..3206647a7 100644
--- a/test/docx/golden/tables_separated_with_rawblock.docx
+++ b/test/docx/golden/tables_separated_with_rawblock.docx
Binary files differ
diff --git a/test/docx/golden/task_list.docx b/test/docx/golden/task_list.docx
index af86040bb..93df73c0b 100644
--- a/test/docx/golden/task_list.docx
+++ b/test/docx/golden/task_list.docx
Binary files differ
diff --git a/test/docx/golden/track_changes_deletion.docx b/test/docx/golden/track_changes_deletion.docx
index a1767a5ad..271163e16 100644
--- a/test/docx/golden/track_changes_deletion.docx
+++ b/test/docx/golden/track_changes_deletion.docx
Binary files differ
diff --git a/test/docx/golden/track_changes_insertion.docx b/test/docx/golden/track_changes_insertion.docx
index d47b0421f..16b03ea92 100644
--- a/test/docx/golden/track_changes_insertion.docx
+++ b/test/docx/golden/track_changes_insertion.docx
Binary files differ
diff --git a/test/docx/golden/track_changes_move.docx b/test/docx/golden/track_changes_move.docx
index 6c45c17bc..0ebc449f7 100644
--- a/test/docx/golden/track_changes_move.docx
+++ b/test/docx/golden/track_changes_move.docx
Binary files differ
diff --git a/test/docx/golden/track_changes_scrubbed_metadata.docx b/test/docx/golden/track_changes_scrubbed_metadata.docx
index ff164e527..05d77e294 100644
--- a/test/docx/golden/track_changes_scrubbed_metadata.docx
+++ b/test/docx/golden/track_changes_scrubbed_metadata.docx
Binary files differ
diff --git a/test/docx/golden/unicode.docx b/test/docx/golden/unicode.docx
index 360956a27..1794d4d6a 100644
--- a/test/docx/golden/unicode.docx
+++ b/test/docx/golden/unicode.docx
Binary files differ
diff --git a/test/docx/golden/verbatim_subsuper.docx b/test/docx/golden/verbatim_subsuper.docx
index 92b6cdb2e..35fdad092 100644
--- a/test/docx/golden/verbatim_subsuper.docx
+++ b/test/docx/golden/verbatim_subsuper.docx
Binary files differ