fix(xlsx): remove duplicate closing braces in chart reader

This commit is contained in:
AnhNgoo
2026-11-21 14:56:43 +07:00
parent 1e087adf28
commit e86b2ef0ef
+5 -16
View File
@@ -307,13 +307,11 @@ pub(crate) fn from_dml_chart(dc: DmlChart, root: Option<&El>) -> Chart {
// The c14 Choice uses different IDs, so read the c:style Fallback.
style: root
.and_then(|r| {
r.child_val("style")
.and_then(parse_chart_style)
.or_else(|| {
r.kids("AlternateContent")
.filter_map(|wrapper| wrapper.child("Fallback"))
.find_map(|fallback| fallback.child_val("style").and_then(parse_chart_style))
})
r.child_val("style").and_then(parse_chart_style).or_else(|| {
r.kids("AlternateContent")
.filter_map(|wrapper| wrapper.child("Fallback"))
.find_map(|fallback| fallback.child_val("style").and_then(parse_chart_style))
})
})
.or_else(|| (1..=48).contains(&dc.style).then_some(dc.style))
.unwrap_or(2),
@@ -326,15 +324,6 @@ pub(crate) fn from_dml_chart(dc: DmlChart, root: Option<&El>) -> Chart {
pivot: dc.pivot_source.as_deref().map(strip_book).filter(|n| !n.is_empty()).map(str::to_string),
}
}
hole_size,
first_slice_angle: dc.first_slice_angle,
x_title: dc.axis_titles.0,
y_title: dc.axis_titles.1,
source: None,
by_rows: false,
pivot: dc.pivot_source.as_deref().map(strip_book).filter(|n| !n.is_empty()).map(str::to_string),
}
}
pub fn read_chart(root: &El) -> Option<Chart> {
let craft = to_craft_el(root);