diff --git a/crates/engine/src/cmd/insert.rs b/crates/engine/src/cmd/insert.rs index 41b8fd37a..35daaea25 100644 --- a/crates/engine/src/cmd/insert.rs +++ b/crates/engine/src/cmd/insert.rs @@ -1079,6 +1079,9 @@ fn shape_set_text(s: &mut Session, p: &Json) -> Result { if shape.kind == ShapeKind::WordArt && text.is_empty() { return Err(bad("shape.setText", "WordArt text must not be empty")); } + if shape.kind == ShapeKind::WordArt && text.chars().nth(super::wordart::MAX_CHARS).is_some() { + return Err(bad("shape.setText", format!("`text` is longer than {} characters", super::wordart::MAX_CHARS))); + } // Sheet protection locks drawing objects (there is no "edit objects" allowance yet). if sh.is_protected() { return Err(EngineError::Other(PROTECTED.into()));