Skip to content

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

Open
LeandroMarceddu wants to merge 1 commit into
MathNya:masterfrom
LeandroMarceddu:fix/drawing-rid-sync
Open

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

Conversation

@LeandroMarceddu

Copy link
Copy Markdown

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.
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.

1 participant