Repository navigation
Give header, footer and footnote images unique drawing ids - #214
Merged
Merged
Conversation
fix_docpr_ids only ran on the body, so images in headers and footers kept their template ids. Two headers with a logo each, an image loop in a header, or a header id that the body renumbering later reuses all left duplicate wp:docPr ids, which desktop Word can react to by hiding images. Keep counting from the body through each header, footer and footnote part so every drawing in the document gets its own id. Also add a test for tables without a w:tblGrid, which used to crash fix_tables and render fine since #206. Fixes #213
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.
What this changes
Only the body got its drawing ids renumbered, so header and footer images kept whatever id they came with. Two headers with a logo each, an image loop in a header, or a header image whose id the body renumbering later hands out all produced duplicate
wp:docPrids. Now the counter keeps going through each header, footer and footnote part after the body, so every drawing in the file has its own id.I also added a test for tables without a
w:tblGrid. That used to crashfix_tablesand has rendered fine since #206, but nothing covered it.Fixes #213
How I tested it
The new tests fail on main and pass here. I ran all the sample scripts in
tests/and opened the header, footer and footnote outputs plus the repro cases in Word 16, which opened all of them without a repair prompt and with every image showing.tests/unitCHANGES.rstupdated if users will notice the change