fix(xlsx): honor data bar rule color written as start/end tags#397
Merged
Conversation
Data bars fell back to the default steel blue when the rule's <color> (and <cfvo>) children were written as start/end pairs instead of self-closing tags — umya-spreadsheet's DataBar reader only matched Event::Empty, so the color collection came back empty (issue #371). The reader fix lands in the umya-spreadsheet fork (branch fix/panic-safety-v2, upstreamed as MathNya/umya-spreadsheet#347); this change pins the behavior with a regression test that rewrites the fixture XML into the start/end-tag form before parsing. Also ships the side-by-side comparison for follow-up defect #396 (auto-height rows render taller than Excel). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
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.
Summary
Data bars ignored the conditional-formatting rule's
<color rgb>and always rendered the parser's default steel blue when the rule's children were written as start/end pairs (<color rgb="FF1E2761"></color>, the form produced by openpyxl among others). umya-spreadsheet'sDataBarreader only matchedEvent::Empty, so both the cfvo and color collections came back empty andapply_data_bar_rulefell back to#638EC6(issue #371).The reader fix lands in the umya-spreadsheet fork this workspace patches to (branch
fix/panic-safety-v2), mirroringColorScale's reader which already handles both event kinds. It is also upstreamed as MathNya/umya-spreadsheet#347. This PR pins the behavior on the office2pdf side with a regression test that rewrites fixture XML into the start/end-tag form before parsing.Measured on the sales-dashboard fixture: bars now render the rule navy
#1E2761with column x-positions matching GT exactly (Total column values at x=494.5 vs GT 494.0).Related issue
Fixes #371
Testing
cargo test --workspace— greentest_cond_fmt_data_bar_color_from_start_end_tag_children(rewrites<cfvo/>/<color/>into start/end pairs and asserts the IR bar color and fill percent)read_child_elements_with_end_tags/read_child_elements_self_closing, full fork suite green06_sales_dashboard_en.xlsx: bars render navy, matching ExcelVisual impact
Visual audit
06_sales_dashboard_en.xlsx(synthetic real-world audit set, external)fixassets/bugfixes/issue-371/gt.jpgassets/bugfixes/issue-371/before.jpgassets/bugfixes/issue-371/after.jpgVisual comparison
Required inspection
Deviation audit
Checklist
Signed-off-byline🤖 Generated with Claude Code