From 9974ba0c948e5b3ec733d8a02ac24a58bbd3486f Mon Sep 17 00:00:00 2001 From: GoshaZotov Date: Fri, 29 Sep 2023 12:19:52 +0300 Subject: [PATCH 1/3] [se] Fix bug 54837 --- .../FormulaObjects/engineeringFunctions.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/cell/model/FormulaObjects/engineeringFunctions.js b/cell/model/FormulaObjects/engineeringFunctions.js index 5d4f07602f..a71ac414e2 100644 --- a/cell/model/FormulaObjects/engineeringFunctions.js +++ b/cell/model/FormulaObjects/engineeringFunctions.js @@ -528,9 +528,24 @@ function (window, undefined) { var res = []; var hasImag = this.img != 0, hasReal = !hasImag || (this.real != 0); + let toLocalString = function (val) { + let _res = val; + if (val != null) { + val = val.toString(); + if (val) { + val = val.replace(AscCommon.FormulaSeparators.digitSeparatorDef, AscCommon.FormulaSeparators.digitSeparator); + + if (val) { + _res = val; + } + } + } + return _res; + }; + if (hasReal) { - res.push(this.real); + res.push(toLocalString(this.real)); } if (hasImag) { if (this.img == 1) { @@ -540,7 +555,7 @@ function (window, undefined) { } else if (this.img == -1) { res.push("-"); } else { - this.img > 0 && hasReal ? res.push("+" + this.img) : res.push(this.img); + this.img > 0 && hasReal ? res.push("+" + (toLocalString(this.img))) : res.push(toLocalString(this.img)); } res.push(this.suffix ? this.suffix : "i"); } From 94ed64c87ead76199c76cefe53172ce9af045112 Mon Sep 17 00:00:00 2001 From: Sergey Luzyanin Date: Fri, 29 Sep 2023 15:10:33 +0300 Subject: [PATCH 2/3] fix name of calling method changePreset->putPreset --- common/Drawings/Format/Format.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/Drawings/Format/Format.js b/common/Drawings/Format/Format.js index 2a1721c7a4..c9c602791f 100644 --- a/common/Drawings/Format/Format.js +++ b/common/Drawings/Format/Format.js @@ -4106,7 +4106,7 @@ for(let nPrst = 0; nPrst < aPresets.length; ++nPrst) { let oShd = new asc_CShadowProperty(); let sPrst = aPresets[nPrst]; - oShd.changePreset(sPrst); + oShd.putPreset(sPrst); if(this.IsIdentical(oShd)) { return sPrst; } From 8b882f387e1a98e103545befec0ac2524e0bb473 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Fri, 29 Sep 2023 16:21:34 +0300 Subject: [PATCH 3/3] [plugins][macros] Change how plugin "Macros" works with history. --- common/apiBase.js | 4 ++++ common/plugins.js | 4 ++-- slide/Editor/Format/Presentation.js | 5 ++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/common/apiBase.js b/common/apiBase.js index 3ab9688646..725db1bab6 100644 --- a/common/apiBase.js +++ b/common/apiBase.js @@ -3724,6 +3724,10 @@ if (!this.macros) return true; + // we shouldn't create a history point and update it if macros haven't been changed + if (this.macros.Data && this.macros.Data === sData) + return true; + if (true === AscCommon.CollaborativeEditing.Get_GlobalLock()) return true; diff --git a/common/plugins.js b/common/plugins.js index 2bc22972de..8ee8b4ed15 100644 --- a/common/plugins.js +++ b/common/plugins.js @@ -1264,7 +1264,7 @@ AscFonts.IsCheckSymbols = false; - if (task.recalculate === true) + if (task.recalculate === true && !AscCommon.History.Is_LastPointEmpty()) { this.api._afterEvalCommand(function() { window.g_asc_plugins.shiftCommand(commandReturnValue); @@ -1278,7 +1278,7 @@ case AscCommon.c_oEditorId.Word: case AscCommon.c_oEditorId.Presentation: { - this.api.WordControl.m_oLogicDocument.FinalizeAction(); + this.api.WordControl.m_oLogicDocument.FinalizeAction(true); break; } case AscCommon.c_oEditorId.Spreadsheet: diff --git a/slide/Editor/Format/Presentation.js b/slide/Editor/Format/Presentation.js index 826f18859c..84c1ff3906 100644 --- a/slide/Editor/Format/Presentation.js +++ b/slide/Editor/Format/Presentation.js @@ -12218,9 +12218,12 @@ CPresentation.prototype.StartAction = function (nDescription) { this.Create_NewHistoryPoint(nDescription); this.StopAnimationPreview(); }; -CPresentation.prototype.FinalizeAction = function () { +CPresentation.prototype.FinalizeAction = function (isCheckEmptyAction) { this.Recalculate(); this.Api.checkChangesSize(); + if (true === isCheckEmptyAction && AscCommon.History.Is_LastPointEmpty()) { + AscCommon.History.RemoveLastPoint(); + } }; CPresentation.prototype.IsSplitPageBreakAndParaMark = function () {