Repository navigation
fix(docx): name every page a page-margin note is about - #954
Merged
Merged
Conversation
- A note about several pages named the first of them only, and the later ones, which Word sets with the margins in force too, went unnamed: ObsidianInvoice with its line items run onto three pages named page 2, not page 3. The note on a block several pages start inside, on a run of pages whose side margins differ, and on a section of several whose page count a Word section would split now names each page, as "pages 2 and 3", "pages 2, 3 and 5", "pages 2 to 4". - A page-margin note about a page names it, page N or section N, page N, as the report's contract says: the notes on a section written where a page starts, on a page after one whose content reaches its foot, on a page no block starts and on a page's side margins carried their section's path, none in a document of one section. - The contract's page zones, as written: a note about one, or about a node of one, has no path or names its section in a document of several.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A DOCX export names in its report (
page margin) each page whose top and bottom margins it does not write as a Word section. Two of those notes were untrue for a real template.ObsidianInvoicewith its line items run onto three pages starts pages 2 and 3 inside the panel holding them; its note named page 2, and page 3's margins were lost without a word. The same held for a run of pages whose side margins differ, and for a section of a document of several whose page count a Word section would split.DocxExportReport) says a note about no one node names what it is about,page Norsection N, page N. The notes on a section written where a page starts, on a page after one whose content reaches its foot, on a page no block starts and on a page's side margins carried their section's path instead, which a document of one section has none of.MerchantInvoice,PaymentsInvoiceandWorkspaceInvoicegive such a note wherever a page with their later bottom margin starts between blocks.What changed
DocxPageMarginSections.planreport.set) to name each of them, compared against the same margins in force: "the top and bottom margins of pages 2 and 3 differ from page 1's, which Word sets them with: each starts inside this block, where the export starts no Word section". A block named for a page before a written section is still named again after it.pagePath(section, page):page N, orsection N, page Nin a document of several sections. The note on the section whose page count would split stays on the section, and a block's note on the block.nameTheSidesnames each page of a run whose side margins differ: "the side margins of pages 2 and 3 differ from the document's and are not written".pages,notSetWith).DocxExportReportJavadoc, recipe, CHANGELOG): a note about a page zone, or about a node of one, has no path or, in a document of several sections, names its section, as the notes written for zones do.pageGeometrynames the case where no block of the body starts a page.Verification
DocxPageMarginSectionsTest(4 new, 4 changed):section 2, page 2in a document of several;Fail-closed: 10 sabotages, each run alone, all caught. They break:
The "no block of the body starts page N" note has no test: no document shape found reaches it.
ObsidianInvoicewith its line items run onto three pages, through the export: its one note names pages 2 and 3. Merchant, Payments and Workspace are unchanged.Corpus: 62 of 62 DOCX are byte for byte the same, and the 1384 notes are unchanged: none of its documents has margins that change from page to page.
Gate:
./mvnw -B -ntp clean verify -pl <core, render-pdf, render-docx, render-pptx, templates, testing, qa, coverage> -am→ BUILD SUCCESS: core 823, render-pdf 339, render-docx 2141, testing 5, render-pptx 142, templates 127, qa 1830../mvnw -f examples/pom.xml test→ BUILD SUCCESS, 93 tests.Lane: shared-engine (render-docx). The report's record is unchanged; its notes' text and paths change only for documents with margins that change from page to page.