From 86c733e234e83ef26c010c73e4f8e1d98b092835 Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Wed, 5 Nov 2025 11:48:43 +0300 Subject: [PATCH] Add method for streamed content --- word/api_plugins.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/word/api_plugins.js b/word/api_plugins.js index c21a8d0a12..9e24d382fd 100644 --- a/word/api_plugins.js +++ b/word/api_plugins.js @@ -1361,6 +1361,37 @@ return direction; } + /** + * Insert streamed content. + * @undocumented + * @memberof Api + * @typeofeditors ["CDE"] + * @alias InsertStreamedContent + * @returns {undefined} + * @since 9.2.0 + */ + Api.prototype["pluginMethod_InsertStreamedContent"] = function(streamObj) + { + let logicDocument = this.private_GetLogicDocument(); + if (!logicDocument) + return null; + + if (streamObj["word"] && streamObj["word"]["removeSelection"]) + logicDocument.RemoveSelection(); + + if (streamObj["undo"]) + this["pluginMethod_EndAction"]("GroupActions", "", "cancel"); + + if (streamObj["stable"] !== "") + this["pluginMethod_PasteHtml"](streamObj["stable"]); + + if (streamObj["tail"] !== "") + { + this["pluginMethod_StartAction"]("GroupActions"); + this["pluginMethod_PasteHtml"](streamObj["tail"]); + } + }; + window["AscCommon"] = window["AscCommon"] || {}; window["AscCommon"].readContentControlCommonPr = readContentControlCommonPr;