diff --git a/crates/engine/src/cmd/data.rs b/crates/engine/src/cmd/data.rs index 8fe74779c..8f7c47fb8 100644 --- a/crates/engine/src/cmd/data.rs +++ b/crates/engine/src/cmd/data.rs @@ -656,7 +656,7 @@ fn filter_blank(v: &Value) -> bool { /// A table's own filter is left to the table, and a row typed after a blank row does not count. /// A formula counts before it is calculated: this runs inside the edit, ahead of the recalc. pub(crate) fn grow_autofilter(sh: &mut Sheet, at: CellRef) { - if !sh.cells.get(at).is_some_and(|c| !c.value.is_empty() || c.formula.is_some()) { + if !sh.cells.get(at).is_some_and(|c| !filter_blank(&c.value) || c.formula.is_some()) { return; } let Some(af) = sh.autofilter.as_ref() else { return }; @@ -1589,6 +1589,9 @@ mod tests { // A cell outside the filter's columns does not either. s.execute("cell.set", json!({"cell": "C6", "input": "x"})).unwrap(); assert_eq!(range(&s), Some("A1:B5".to_string())); + // Empty text is a blank entry, not a value. + s.execute("range.setValues", json!({"range": "A6", "parse": false, "values": [[""]]})).unwrap(); + assert_eq!(range(&s), Some("A1:B5".to_string())); // A formula and Ctrl+Enter (range.fill) are entries too. s.execute("cell.set", json!({"cell": "B6", "input": "=1+1"})).unwrap(); assert_eq!(range(&s), Some("A1:B6".to_string())); diff --git a/crates/functions/src/math.rs b/crates/functions/src/math.rs index 998a1c069..53a92f00f 100644 --- a/crates/functions/src/math.rs +++ b/crates/functions/src/math.rs @@ -309,9 +309,7 @@ fn modulo(x: f64, d: f64) -> R { // `%` is an exact remainder (truncated), so |r| < |d| even for tiny divisors. let r = x % d; // Keep the sign of the divisor and avoid returning |d| from rounding. - if r != 0.0 && (r < 0.0) != (d < 0.0) { - return Ok(r + d); - } + let r = if r != 0.0 && (r < 0.0) != (d < 0.0) { r + d } else { r }; if r.abs() >= d.abs() { return Ok(0.0); } diff --git a/crates/ui-egui/tests/contextual_ribbon_tab.rs b/crates/ui-egui/tests/it/contextual_ribbon_tab.rs similarity index 100% rename from crates/ui-egui/tests/contextual_ribbon_tab.rs rename to crates/ui-egui/tests/it/contextual_ribbon_tab.rs diff --git a/crates/ui-egui/tests/it/main.rs b/crates/ui-egui/tests/it/main.rs index 9b04d3869..fc00fb520 100644 --- a/crates/ui-egui/tests/it/main.rs +++ b/crates/ui-egui/tests/it/main.rs @@ -16,6 +16,7 @@ mod comments_pane; mod commit_after_pointing; mod committed_text_fields; mod context_menu_stays_open; +mod contextual_ribbon_tab; mod control_timeout; mod dialog_button_row; mod dialog_confirm;