diff --git a/crates/xlsx/src/sheet_read.rs b/crates/xlsx/src/sheet_read.rs index 3e5c83b..2c8865e 100644 --- a/crates/xlsx/src/sheet_read.rs +++ b/crates/xlsx/src/sheet_read.rs @@ -541,7 +541,7 @@ pub fn parse_iso_datetime(s: &str, sys: DateSystem) -> Option { } pub fn parse_sqref(s: Option<&str>) -> Vec { - s.unwrap_or("").split_whitespace().filter_map(RangeRef::parse).take(10_000).collect() + s.unwrap_or("").split_whitespace().filter_map(RangeRef::parse).collect() } fn cf_op(s: Option<&str>) -> CfOperator { @@ -974,4 +974,12 @@ mod tests { assert_eq!(parse_iso_datetime("garbage", DateSystem::D1900), None); assert_eq!(parse_iso_datetime("2024-13-01", DateSystem::D1900), None); } + + #[test] + fn sqref_keeps_more_than_ten_thousand_ranges() { + let sq = (1..=12_000).map(|r| format!("A{r}")).collect::>().join(" "); + let ranges = parse_sqref(Some(&sq)); + assert_eq!(ranges.len(), 12_000); + assert_eq!(ranges.last().copied(), RangeRef::parse("A12000")); + } }