#3535: an existing file at the .xml name is refused on the status bar

CodeRabbit: export_dialog drops ask_file's result, so the refusal was silent with a
blocking Save dialog. finish_pick now puts it on the status bar as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Martin Ball
2026-11-15 16:01:41 +00:00
co-authored by Claude Opus 5.5
parent 66c159c228
commit 06b4d911cc
2 changed files with 6 additions and 1 deletions
+2
View File
@@ -878,6 +878,8 @@ mod tests {
// The appended name already exists: the system dialog never confirmed it, so refuse.
let bare = dir.join("letter").to_string_lossy().into_owned();
assert!(a.finish_pick(AfterPick::Export { ext: "xml".into() }, Some(bare)).is_err());
let said = a.status_msg.as_ref().map(|(m, _)| m.clone()).unwrap_or_default();
assert!(said.contains("letter.xml already exists"), "the refusal is on the status bar: {said:?}");
let _ = std::fs::remove_dir_all(&dir);
}
+4 -1
View File
@@ -310,7 +310,10 @@ impl WordApp {
path.push_str(".xml");
// The dialog only confirmed the name it was given, not this one.
if std::path::Path::new(&path).exists() {
return Err(format!("{path} already exists; choose another name"));
// Callers drop the result, so say it where the person sees it.
let msg = format!("{path} already exists; choose another name");
self.status(msg.clone());
return Err(msg);
}
}
// Word XML even over a Word 2003 XML file, which a save by path would keep.