From 3f6a2c46f4b052a7853ab5e0fcbeedc21d65749a Mon Sep 17 00:00:00 2001 From: KirillovIlya Date: Tue, 10 Oct 2023 19:30:08 +0300 Subject: [PATCH] Fix bug #63721 Fix correctEnterText method for slide editor --- slide/Editor/Format/Presentation.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/slide/Editor/Format/Presentation.js b/slide/Editor/Format/Presentation.js index 5f21937d6b..48c8be8854 100644 --- a/slide/Editor/Format/Presentation.js +++ b/slide/Editor/Format/Presentation.js @@ -7818,7 +7818,14 @@ CPresentation.prototype.Set_DocumentDefaultTab = function (DTab) { CPresentation.prototype.SetDocumentMargin = function () { }; -CPresentation.prototype.EnterText = function (codePoints) { +CPresentation.prototype.EnterText = function (value) { + if (undefined === value + || null === value + || (Array.isArray(value) && !value.length)) + return false; + + let codePoints = typeof(value) === "string" ? value.codePointsArray() : value; + if (!this.CanEdit()) return false; @@ -7928,7 +7935,7 @@ CPresentation.prototype.CorrectEnterText = function (oldValue, newValue) { if (!run) return false; - if (!this.History.checkAsYouTypeEnterText(run, inRunPos, oldCodePoints[oldCodePoints.length - 1])) + if (!AscWord.checkAsYouTypeEnterText(run, inRunPos, oldCodePoints[oldCodePoints.length - 1])) return false; if (undefined === newCodePoints || null === newCodePoints)