R9.3, R9.4: AutoFilter without the header query (GitHub #4); paste on Windows

Patch 0053: under LOK, Calc takes the first row as header instead of
asking asynchronously; the worker closed the query and crashed.
Patch 0049 includes doc.hxx (gcc on Linux did not build it).
arboard read a missing HTML clipboard format as an error on Windows;
the clipboard checks the format first, and paste errors show the
whole chain. ElyTable tests compare CSV and selection text the
platform's way (P3-09).
This commit is contained in:
雷电芽衣 committed 2026-10-20 02:23:17 -04:00
1 parent ba358c7de6
commit 72bec20a60
19 files changed
+118 -20

No files matched your search

+27
View File
@@ -152,3 +152,30 @@ fn one_cell_in_another_block_filters_that_block() {
let entries: Vec<String> = sheet::filter_values(&json).expect("parses").entries.into_iter().map(|e| e.text).collect();
assert_eq!(entries, ["9", "10"], "an AutoFilter from D1 is D's");
}
/// A text-only column: no cell looks like a header.
const WORDS: &str = r#"<?xml version="1.0" encoding="UTF-8"?>
<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.spreadsheet">
<office:body><office:spreadsheet><table:table table:name="S">
<table:table-row><table:table-cell><text:p>Name</text:p></table:table-cell></table:table-row>
<table:table-row><table:table-cell><text:p>a</text:p></table:table-cell></table:table-row>
<table:table-row><table:table-cell><text:p>b</text:p></table:table-cell></table:table-row>
</table:table></office:spreadsheet></office:body>
</office:document>"#;
#[test]
fn a_whole_column_without_a_clear_header_filters_from_its_first_row() {
if install().is_none() {
eprintln!("SKIP: no pinned LOK build");
return;
}
let (_dir, mut worker, doc) = open_book(WORDS);
worker.run(&doc, "cell.goto", &["A:A"]).expect("marks the column");
worker.run(&doc, "data.autofilter", &[]).expect("filters without asking");
doc.paint_tile(&mut worker, (0, 0, 3840, 3840), (256, 256))
.expect("the buttons paint");
// The whole column holds blanks too.
assert_eq!(entries(&mut worker, &doc), ["", "a", "b"], "the first row heads");
}
+1 -1
View File
@@ -82,7 +82,7 @@ pub(super) fn mark_of(html: &str) -> Option<&str> {
/// Pastes the system clipboard.
pub(super) fn paste(worker: &mut Worker, doc: &Doc) -> io::Result<()> {
let Some(clip) = clipboard::read().map_err(io::Error::other)? else {
let Some(clip) = clipboard::read().map_err(|error| io::Error::other(format!("{error:#}")))? else {
return Ok(());
};
let (mime, data) = flavor_of(clip);
+6
View File
@@ -247,6 +247,12 @@ fn the_clipboard_moves_html_tables_and_images() {
text.contains(&"left".to_string()) && text.contains(&"right".to_string()),
"{text:?}"
);
// Plain text from another app, with no HTML beside it.
clipboard::write(&Clip::Text("outside words".into())).expect("the text writes");
cx.update(|app| view.update(app, |view, _| view.send(crate::view::input::Input::Paste)));
flush(&cx);
let text = saved(&view, &mut cx);
assert!(text.iter().any(|line| line.contains("outside words")), "{text:?}");
let mut png = Vec::new();
image::RgbaImage::from_pixel(4, 4, image::Rgba([255, 0, 0, 255]))