craft-drawingml: review fixes for chart category format and fraction tests

This commit is contained in:
vangel76 committed 2026-11-16 19:24:22 +01:00
1 parent 99ff45c013
commit 4c9665f4ed
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -497,7 +497,7 @@ fn category_format(pa: &El, cat_ax: Option<&El>) -> Option<String> {
// gives no number format, and no later series does.
let cat = pa
.elements()
.filter(|g| g.local().ends_with("Chart"))
.filter(|g| g.local().ends_with("Chart") && group_chart_type(g.local(), g).is_some())
.flat_map(|g| g.children(Local("ser")))
.filter_map(|s| s.child(Local("cat")).or_else(|| s.child(Local("xVal"))))
.find(|c| !strings_capped(c, MAX_CACHE_POINTS).is_empty())?;
+2 -2
View File
@@ -1040,9 +1040,9 @@ mod tests {
fn a_negative_fraction_that_rounds_to_zero_shows_no_minus() {
check(&[
// code, value, Excel shows
("# ?/?", -0.01, "0"),
("# ?/?", -0.01, "0 "),
("?/?", -0.01, "0/1"),
("# ?/?", -0.5, "-1/2"),
("# ?/?", -0.5, "- 1/2"),
("# ?/?", -1.5, "-1 1/2"),
]);
}