Skip to content

fix: keep worksheet drawing r:id in sync with its rels - #358

Merged
MathNya merged 1 commit into
MathNya:masterfrom
LeandroMarceddu:fix/drawing-rid-sync
Sep 3, 2026
Merged

fix: keep worksheet drawing r:id in sync with its rels#358
MathNya merged 1 commit into
MathNya:masterfrom
LeandroMarceddu:fix/drawing-rid-sync

Conversation

@LeandroMarceddu

Copy link
Copy Markdown
Contributor

write_print_settings bumped the relationship id whenever PageSetup had any page-setup attribute (paperSize/orientation), but the rels writer only emits a printerSettings relationship when PageSetup::object_data is present. For a sheet with a page setup but no printer-settings binary this wrote while the rels only defined the drawing at rId1, a dangling reference that made Excel strip the drawing. Read the mutable counter back from PageSetup::write_to so the id only advances when a printerSettings relationship is actually written.

write_print_settings bumped the relationship id whenever PageSetup had
any page-setup attribute (paperSize/orientation), but the rels writer only
emits a printerSettings relationship when PageSetup::object_data is
present. For a sheet with a page setup but no printer-settings binary this
wrote <drawing r:id="rId2"> while the rels only defined the drawing at
rId1, a dangling reference that made Excel strip the drawing. Read the
mutable counter back from PageSetup::write_to so the id only advances when
a printerSettings relationship is actually written.
@MathNya

MathNya commented Sep 3, 2026

Copy link
Copy Markdown
Owner

@LeandroMarceddu
Thank you for the PR.
Since there were no issues, I’ll go ahead and merge it.

@MathNya
MathNya merged commit 059e747 into MathNya:master Sep 3, 2026
0 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants