From 82f0c467bee153f5c8ff45bd0fd581abb9d8a4a6 Mon Sep 17 00:00:00 2001 From: Mex <44814932+MMexicann@users.noreply.github.com> Date: Mon, 16 Nov 2026 21:32:11 +0100 Subject: [PATCH] M14: describe encrypted OpenDocument command support (#6776) --- crates/engine/src/cmd/file.rs | 8 ++++---- crates/engine/src/io.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index 0a067b6d4c..1301213659 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -90,7 +90,7 @@ pub fn specs() -> Vec { CommandSpec::new("file.new", "New", "File", new).key("Mod+N").params(r#"{"template"?: "blank|sample|letter|resume|report"}"#).pure(), CommandSpec::new("file.open", "Open", "File", open) .key("Mod+O / Mod+F12 / Mod+Alt+F2") - .params(r#"{"path": string, "data"?: base64 (the file's bytes; `path` then only names it), "password"?: string (for a password-protected Word document)}"#) + .params(r#"{"path": string, "data"?: base64 (the file's bytes; `path` then only names it), "password"?: string (for a password-protected Word or OpenDocument text file)}"#) .pure(), CommandSpec::new("file.save", "Save", "File", save) .key("Mod+S / Shift+F12 / Alt+Shift+F2") @@ -100,7 +100,7 @@ pub fn specs() -> Vec { // Pure: the password must not land in Repeat or a recorded macro, and it isn't an edit // to undo; it marks the document as changed itself. CommandSpec::new("file.encrypt", "Encrypt with Password", "File › Info › Protect Document", encrypt) - .params(r#"{"password": string (Word documents are saved encrypted with it) | null or "" (saved unencrypted)}"#) + .params(r#"{"password": string (Word packages and OpenDocument text files (.odt, .ott) are saved encrypted with it) | null or "" (saved unencrypted)}"#) .pure(), CommandSpec::new("file.exportPdf", "Export PDF", "File › Export", |s, v| { // No path (the command search, say): the app asks where to save, as File › Export @@ -368,8 +368,8 @@ fn close_document(s: &mut Session, v: &Value) -> CmdResult { Ok(json!({"closed": id, "active": s.document_id(), "documents": s.documents()})) } -/// File › Info › Protect Document › Encrypt with Password: the password Word documents are saved -/// with from now on, or none. +/// File › Info › Protect Document › Encrypt with Password: the password Word packages and +/// OpenDocument text files (.odt, .ott) are saved with from now on, or none. fn encrypt(s: &mut Session, v: &Value) -> CmdResult { let password = match v.get("password") { Some(Value::Null) => None, diff --git a/crates/engine/src/io.rs b/crates/engine/src/io.rs index 4f149d8eda..a7760d3282 100644 --- a/crates/engine/src/io.rs +++ b/crates/engine/src/io.rs @@ -464,7 +464,7 @@ pub fn save_bytes_opts(name: &str, doc: &Document, opts: &ExportOptions) -> Resu } /// [`save_bytes`], encrypted with `password` when there is one and the format is a Word package -/// (other formats are copies and are written as they are). +/// or OpenDocument text file (.odt, .ott); other formats are copies and are written as they are. pub fn save_bytes_with(name: &str, doc: &Document, password: Option<&str>, opts: &ExportOptions) -> Result, String> { let bytes = save_bytes_opts(name, doc, opts)?; match password {