Skip to content

fix(word): reject tracked changes inside simple fields - #549

Closed
rmorgans wants to merge 1 commit into
sergey-tihon:masterfrom
rmorgans:fix/reject-in-fldsimple
Closed

rmorgans wants to merge 1 commit into
sergey-tihon:masterfrom
rmorgans:fix/reject-in-fldsimple

Conversation

@rmorgans

@rmorgans rmorgans commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Same bug as the hyperlink case, inside w:fldSimple: RejectRevisions keeps the inserted result text and drops the deleted text. Accept is correct.

Reproduction. Alpha [del: beta][ins: delta] gamma inside <w:fldSimple w:instr=" AUTHOR ">. Reject gives Alpha delta gamma; Word gives Alpha beta gamma.

Cause. ReverseRevisionsTransform only inverts revisions whose nearest ancestor (skipping sdt, sdtContent, smartTag) is w:p.

Fix. Skip w:fldSimple as well.

Test. RP054_RevisionsInsideSimpleField (accept and reject).


Found while using RevisionProcessor to check that Reject All of a tracked-change redline gives back the original document. Expected results are Microsoft Word for Mac 16.113's own Accept All / Reject All on the same markup. The regression test fails on current master and passes with the fix; ./build.sh passes.

This is one of six small, independent RevisionProcessor fixes (#548, #549, #550, #551, #552, #553). Each adds its test after RP001 in RevisionProcessorTests.cs, so whichever merges second will need a trivial rebase there; I'll rebase the rest as they land.

Prepared with an AI coding agent (Claude); I reviewed the change and ran the tests.

RevisionProcessor.RejectRevisions inverts w:del/w:ins only when their
nearest ancestor (skipping sdt and smartTag) is a w:p. Inside a
w:fldSimple the revisions were left as they were, so the accept pass
that follows dropped the deleted text and kept the inserted text: the
opposite of Word's Reject All. Treat w:fldSimple as a transparent run
container like w:sdt and w:smartTag.
@rmorgans

Copy link
Copy Markdown
Contributor Author

Folded into #554. All three fixes added a name to the same ancestor predicate in ReverseRevisionsTransform, so they could only merge one at a time with a rebase after each. #554 now covers w:hyperlink, w:fldSimple, w:dir and w:bdo in one change, with one parameterized test. Closing this one to save you the extra rebase cycle.

@rmorgans rmorgans closed this Oct 17, 2026
@rmorgans
rmorgans deleted the fix/reject-in-fldsimple branch October 18, 2026 00:25
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