Skip to content

fix: preserve DOCX visual RTL table order#199

Merged
developer0hye merged 2 commits into
mainfrom
fix/docx-rtl-table-order
Jul 13, 2026
Merged

fix: preserve DOCX visual RTL table order#199
developer0hye merged 2 commits into
mainfrom
fix/docx-rtl-table-order

Conversation

@developer0hye

@developer0hye developer0hye commented Jul 13, 2026

Copy link
Copy Markdown
Owner

What changed

  • detect enabled w:bidiVisual table properties from raw DOCX XML
  • reverse RTL table rows and column widths during DOCX conversion
  • remap column spans, vertical-merge indices, physical borders, and padding
  • add real-world and asymmetric colspan regression coverage
  • hydrate Git LFS fixtures in normal cross-platform test jobs so strict fixture assertions execute

Why

DOCX stores RTL table cells in logical order and uses w:bidiVisual to request right-to-left visual presentation. The converter ignored that property, so cells appeared in the opposite order from Microsoft Word.

Visual comparison

Microsoft Word GT Before After
GT Before After

Verification

  • cargo test -p office2pdf --lib (1082 passed)
  • cargo test -p office2pdf --test docx_fixtures (151 passed)
  • cargo clippy -p office2pdf --lib --tests -- -D warnings
  • CI: Linux, macOS, Windows, WASM, Clippy, format, DCO, and bulk fixtures passed
  • AI visual inspection: after matches Word cell order (B1 | A1, B2 | A2); remaining offset is renderer margin/font metrics

Related: #195

Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye
developer0hye merged commit b875530 into main Jul 13, 2026
14 checks passed
@developer0hye
developer0hye deleted the fix/docx-rtl-table-order branch July 13, 2026 12:30
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