Fix embedded OLE object IDs in subdocuments - #659
Conversation
yangfan-yf-yf
left a comment
There was a problem hiding this comment.
I reproduced #621 from the public attachment, and the identifier fix itself looks correct. On 9bbfc87b, the seven objects receive distinct paired v:shape/@id and OLE ShapeID values, distinct ObjectID values, and case-normalized unique w14:anchorId values. All seven relationships resolve to unique internal embeddings, and each XLSX passes ZIP, XML, and relationship checks. Existing body collisions, repeated renders, and the documented non-OLE and header/footer boundaries did not reveal another issue.
One fixture prevents me from approving the current head. tests/templates/issue_621_excel_0.xlsx is not the corresponding payload from the public attachment:
- attachment
output/0.tmp_excel_0.xlsx, also stored as the first embedding indemo_doc_with_excel.docx: 4,867 bytes, SHA-25617ce75452390fd3057db51670b37df9c9027654a9589282d0834070ab6496cf9 - committed fixture: 4,887 bytes, SHA-256
3b7d1befbe9fe6d4dfa8bee06b3dc424774b37079a884e89427c78577516805f
The workbook content is equivalent, but docProps/app.xml and docProps/core.xml differ, showing that this fixture was regenerated. The other six XLSX files and both DOCX templates are byte-identical to the attachment. This makes the “seven exact XLSX payloads” claim and the first expected hash inaccurate.
Please replace issue_621_excel_0.xlsx with the attachment’s exact payload and update its expected size and SHA-256. I did not find another blocker in the implementation.
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
SubdocComposercopied each subdocument's related parts without normalizingthe identifiers that must be unique in the destination document.
Change
shape/@idand OLEShapeIDvalues togetherObjectIDand case-normalizedw14:anchorIdvaluesValidation
the unfixed baseline
sheet names, relationships, ZIP integrity, and OOXML main parts after the fix
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