Repository navigation
Conversation
Excel 2010+ writes a conditional format into the extension list alone (x14:conditionalFormatting, formulas in xm:f, the format inline in x14:dxf) when its formula refers to another sheet, and some exporters write every rule that way. GridCraft read that list only for data-bar extensions and dropped these rules, so such sheets lost their highlighting. The cfRule parsing is shared (cf_rule), the dxf parsing too (read_dxf); a standalone x14 rule is read with its xm:sqref ranges and saved as an ordinary conditional format. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
FredApps
left a comment
There was a problem hiding this comment.
ReviewerA — source-read COMMENT (not an approval)
I read the head of the diff: the xlsx reader reads conditional formats kept only in the x14 extension list. Excel 2010 and later store some rules (data bars with extra options, icon sets with custom icons, rules referring to other sheets) in extLst under the x14 namespace, and a reader that looks only at conditionalFormatting loses them. The rule construction (cellIs, expression, containsText and others) is moved so both places share it, and read_dxf is imported for the differential formats. Losing rules on open is a data-loss bug, so reading the extension is right. The parser handles untrusted XML: bounds on the number of rules and on formula length apply to the new path too, and a round-trip test with a file from Excel that has an x14-only rule is the proof. I read the imports and the removed block. I have not run it, and no exact-head CI result exists for this head. Nothing was run.
I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.
Status: waiting_author.
|
@coderabbitai review |
Action not completed
|
Summary
Excel 2010+ writes a conditional format into the extension list alone when the rule's formula refers to another sheet:
x14:conditionalFormatting, with formulas inxm:fand the format inline inx14:dxf. Some exporters write every rule that way. GridCraft read that list only for data-bar extensions and dropped these rules. In three grade sheets from a private corpus (not committed), the pink "repeat student" highlighting over a whole block of rows was missing.cf_rule(): thecfRuletype match is now shared between<conditionalFormatting>and the x14 list.styles::read_dxf(): dxf parsing is shared, and also reads an inlinex14:dxf.xm:sqrefranges, priority and stop-if-true. It is saved as an ordinary conditional format. A rule without a range is skipped with the existing warning.Tests (built in code)
crates/xlsx/src/tests/x14_cond_formats.rs:x14_only_rules_are_read: a cell-value rule (operator, formula, font and fill colours, priority) and an expression rule over two ranges are read, and a rule without a range is dropped.x14_only_rules_survive_saving: the same checks afterwrite_xlsxand a re-read.Both fail on
main, where no rules are read.CI
cargo xtask ci: fmt, clippy, assets, layers, wasm, parity and keytips pass, and every test passes except the pre-existingheader_autofit::table_filter_autofit_works_through_command_and_header_double_click. That test fails identically onmainon this machine with Carlito installed (see #2257).🤖 Generated with Claude Code
Summary by CodeRabbit