Skip to content

Build the alternate content sample instead of shipping a user's document - #36

Merged
cmgeuze merged 1 commit into
mainfrom
test/synthetic-alternatecontent-sample
Aug 3, 2026
Merged

Build the alternate content sample instead of shipping a user's document#36
cmgeuze merged 1 commit into
mainfrom
test/synthetic-alternatecontent-sample

Conversation

@cmgeuze

@cmgeuze cmgeuze commented Aug 3, 2026

Copy link
Copy Markdown
Member

Follow-up to #35.

The reproduction attached to issue #34 was a real document from a third party. It carried its author's name in docProps/core.xml, four pages of a Spanish car manual's table of contents, and an embedded icon. None of that is ours to redistribute, and none of it is needed to state the construct the reader has to get right.

The fixture now assembles the document itself: runs wrapping mc:AlternateContent whose mc:Choice and mc:Fallback each nest a w:p in a text box, followed by a plain sibling run. One test uses thirteen such runs in a single paragraph, matching the shape of the reported document.

Verified against the reader as it was before #35: the built document fails on the same four counts the attached one did, including the sibling run going missing and the shape text arriving twice.

The zip scaffolding that the docx and pptx fixtures each carried moves to TTestPackage in Office4D.Tests.PackageBuilder, so a fixture states only the body or slide XML it is about.

Note that removing the file here does not remove it from history; it stays reachable in the commits merged by #35. Say the word if it should be purged properly, that needs a history rewrite and a force push.

Debug and Release builds: 0 warnings, 0 errors. Suite: 330 tests, all green, no memory leaks.

The reproduction attached to issue #34 was a real document from a third party,
carrying its author name in docProps and content that is not ours to
redistribute. The fixture now assembles a document stating the same construct:
runs wrapping mc:AlternateContent whose branches each nest a w:p in a text box,
followed by a plain run. Verified against the pre-fix reader, where it fails on
the same four counts the attached document did.

The zip scaffolding the docx and pptx fixtures each carried moves to
TTestPackage.
@cmgeuze
cmgeuze merged commit 0096608 into main Aug 3, 2026
@cmgeuze
cmgeuze deleted the test/synthetic-alternatecontent-sample branch August 3, 2026 15:34
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