Read PPTX merge attributes from table cells to preserve merged content - #1077
Merged
Merged
Conversation
Signed-off-by: Floating-Y <118035379+Floating-Y@users.noreply.github.com>
WaylandYang
approved these changes
Oct 4, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thanks @Floating-Y. You are right, and I missed it when I reviewed #1042: the fixtures put the merge attributes where the parser looked, so the test and the parser agreed with each other and not with DrawingML.
Checked with a real file written by python-pptx, one horizontal and one vertical merge. It writes <a:tc gridSpan="2"> and <a:tc hMerge="1">, with an empty <a:tcPr/> after. On dev the header row reads | Summary | | Total |; on this branch | | Summary | Total |, the grid renderer's shape for a spanning header. Landing it.
6 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
DrawingML stores
gridSpan,hMerge, andvMergeona:tc, but the PPTX parser read them froma:tcPr. Correctly generated slides therefore lost their merge information. The existing fixtures used the same incorrect attribute location, and the empty vertical continuation could pass without readingvMerge.Follow-up to #1023 and #1042.
What changes
a:tc, preserving the existing defaults and boolean parsing. Remove botha:tcPrmerge-reading branches so neither XML event form can overwrite cell state.<a:tcPr/>and<a:tcPr></a:tcPr>. Nonempty diagnostic markers in horizontal and vertical continuations must disappear, while the expected table shape and values remain.How it was checked
Local verification during implementation:
cargo test -p utopia-ingest --test pptx_tables: 11 passed after the fix.cargo test -p utopia-ingest: 159 passed, including related table, single-column, and surrounding-text coverage.cargo clippy -p utopia-ingest --all-targets -- -D warnings: passed.cargo fmt --all --check: passed.python-pptx(40 package parts), inspected the actual cell attributes, and verified both merged-table outputs through the existingrender_docexample. This is separate from the minimal parser fixtures; no PowerPoint UI validation was performed.Before submission, rebased onto
devat663881d; the intervening upstream changes only touchutopia-reason/src/derive.rs, with no ingest or dependency changes. Reviewed the resulting two-file diff and rerangit diff --check. Full workspace Clippy/tests and frontend checks were not run locally; All six CI jobs passed for commit8fce6f4: CI run.Before review
git commit -s).cargo fmt --all --checkand the ingest-specific tests and Clippy checks pass locally.