Skip to content

feat: add PPTX table style support#168

Merged
developer0hye merged 6 commits intomainfrom
feat/pptx-table-styles
Mar 14, 2026
Merged

feat: add PPTX table style support#168
developer0hye merged 6 commits intomainfrom
feat/pptx-table-styles

Conversation

@developer0hye
Copy link
Copy Markdown
Owner

Summary

  • Parse tableStyles.xml and resolve theme-based colors (schemeClr, srgbClr, sysClr) with tint/shade transforms
  • Apply table style regions (firstRow, lastRow, firstCol, lastCol, band1H, band2H, wholeTbl) during table parsing
  • Respect explicit cell-level overrides over style-derived values

Test plan

  • Unit tests for parse_table_styles_xml (solid fill, scheme colors, banded rows, color transforms)
  • Unit tests for apply_table_style (header fill, banding with skip, explicit override, missing style noop)
  • Integration tests: end-to-end PPTX with tableStyles.xml → correct IR table output
  • Full test suite passes (1,418 tests, 0 failures)
  • Visual comparison against PowerPoint ground truth on real PPTX (slides 5, 21, 24)

🤖 Generated with Claude Code

developer0hye and others added 5 commits March 14, 2026 02:02
Add Tint and Shade variants to ColorTransform enum for OOXML color
processing. Tint blends toward white (new = 255 - (255 - old) * t) and
Shade blends toward black (new = old * s), both applied in RGB space
before luminance transforms. Fix test_scheme_color_as_start_element to
assert correct tinted color instead of ignoring the transform.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Add pptx_table_styles module that:
- Parses <a:tblStyleLst> XML from ppt/tableStyles.xml into a
  TableStyleMap keyed by style ID
- Extracts per-region styles (wholeTbl, firstRow, lastRow, firstCol,
  lastCol, band1H, band2H) including fill color, text color, bold
- Applies resolved styles to table cells with correct priority:
  cell-explicit > firstRow/lastRow/firstCol/lastCol > band > wholeTbl
- Preserves explicit cell-level overrides (background, text color)

Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Thread TableStyleMap from ppt/tableStyles.xml through the parser chain:
PptxParser::parse → parse_single_slide → SlideXmlParser → parse_pptx_table.
Parse <a:tblPr> attributes (firstRow, bandRow, etc.) and <a:tableStyleId>
text content. Apply resolved table styles in PptxTableParser::finish() so
cells receive background fills and text formatting from the style definition.
Set header_row_count from the firstRow attribute.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye developer0hye force-pushed the feat/pptx-table-styles branch from 023768e to 627e4b5 Compare March 13, 2026 17:05
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye developer0hye merged commit 5835926 into main Mar 14, 2026
12 of 14 checks passed
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