Skip to content

Fix embedded OLE object IDs in subdocuments - #182

Merged
cvas22 merged 3 commits into
mainfrom
port/upstream-659
Nov 22, 2026
Merged

cvas22 merged 3 commits into
mainfrom
port/upstream-659

Conversation

@cvas22

@cvas22 cvas22 commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Port of elapouya/python-docx-template#659 by @aka-debug-jie, which has been waiting upstream. Both commits keep the original author, including the follow-up that addressed the upstream review.

When several subdocs carry embedded Excel objects, only the first one could be opened in Word, because the merged document ended up with duplicate VML shape IDs, OLE ObjectIDs and anchor IDs. The fix renumbers those so they're unique in the destination.

Besides the path and import rename (plus one small commit renaming leftover docxtpl names), I left out the upstream runtests.py change since our CI already runs every script in tests/. The binary fixtures are byte-identical to upstream.

Fixes #148

How I tested it

tests/embedded_ole_subdoc.py and tests/issue_621_public_reproduction.py fail on main and pass here. All unit tests and feature scripts pass locally, and it merges cleanly with #181.

@cvas22 cvas22 added port Port of an upstream python-docx-template change bug Something isn't working labels Nov 22, 2026
@github-actions github-actions Bot added code Changes to the docform package tests Changes to tests labels Nov 22, 2026
@cvas22
cvas22 merged commit aa14358 into main Nov 22, 2026
11 checks passed
@cvas22
cvas22 deleted the port/upstream-659 branch November 22, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working code Changes to the docform package port Port of an upstream python-docx-template change tests Changes to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only first embedded Excel object is openable in generated Word document

2 participants