Skip to content

Fix embedded OLE object IDs in subdocuments - #659

Open
aka-debug-jie wants to merge 1 commit into
elapouya:masterfrom
aka-debug-jie:fix/issue-621-embedded-ole-ids-v5
Open

Fix embedded OLE object IDs in subdocuments#659
aka-debug-jie wants to merge 1 commit into
elapouya:masterfrom
aka-debug-jie:fix/issue-621-embedded-ole-ids-v5

Conversation

@aka-debug-jie

Copy link
Copy Markdown

Why

When several subdocuments contain embedded Excel objects, the generated DOCX
reuses their VML shape, OLE object, and paragraph anchor identifiers. The
embedded packages and icons remain present, but Word only exposes the first
Worksheet Object action.

Root cause

SubdocComposer copied each subdocument's related parts without normalizing
the identifiers that must be unique in the destination document.

Change

  • reserve identifiers already used by the destination and incoming subdocument
  • renumber matching VML shape/@id and OLE ShapeID values together
  • renumber OLE ObjectID and case-normalized w14:anchorId values
  • preserve existing relationships, embedded payloads, APIs, and dependencies

Validation

  • reproduced seven duplicate OLE shape IDs with the public issue attachment on
    the unfixed baseline
  • replayed its seven exact XLSX payloads and verified their SHA-256 values,
    sheet names, relationships, ZIP integrity, and OOXML main parts after the fix
  • passed the collision regression, related subdocument and embedding scripts,
    the complete 40-script suite, flake8, wheel/sdist builds, and archive audits

Scope and risks

This change is limited to body-level OLE objects using the sibling VML layout
present in the reported attachment. It does not generalize non-OLE VML ID
deduplication or OLE objects in headers, footers, or footnotes.

Closes #621

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.

Only first embedded Excel object is openable in generated Word document

1 participant