diff --git a/common/apiBase.js b/common/apiBase.js index 9b8874cf80..46f39d38b4 100644 --- a/common/apiBase.js +++ b/common/apiBase.js @@ -744,7 +744,7 @@ * @param {Asc.c_oAscAsyncActionType} id * @param {Asc.c_oAscRestrictionType} [actionRestriction] */ - baseEditorsApi.prototype.sync_StartAction = function(type, id, actionRestriction, additional) + baseEditorsApi.prototype.sync_StartAction = function(type, id, actionRestriction) { if (type !== c_oAscAsyncActionType.Empty) this.sendEvent('asc_onStartAction', type, id); @@ -765,8 +765,6 @@ AscCommon.CollaborativeEditing.Set_GlobalLock(true); this.incrementCounterActionRestriction(actionRestriction); } - - this.getMacroRecorder().onAction(id, additional); }; /** * @param type {Asc.c_oAscAsyncAction} @@ -802,6 +800,8 @@ // editor.removeRestriction(Asc.c_oAscRestrictionType.OnlySignatures) if (this.restrictions & Asc.c_oAscRestrictionType.OnlySignatures) return; + + this.macroRecorder.stop(); this.restrictions = val; this.onUpdateRestrictions(additionalSettings); @@ -814,6 +814,8 @@ }; baseEditorsApi.prototype.asc_addRestriction = function(val) { + this.macroRecorder.stop(); + this.restrictions |= val; this.onUpdateRestrictions(); this.checkInputMode(); diff --git a/common/macro-recorder.js b/common/macro-recorder.js index 81807a73fa..10e59ac7af 100644 --- a/common/macro-recorder.js +++ b/common/macro-recorder.js @@ -56,9 +56,14 @@ this.result = ""; this.paused = false; this.inProgress = true; + + this.editor.sendEvent("asc_onMacroRecordingStart"); }; MacroRecorder.prototype.stop = function() { + if (!this.inProgress) + return; + this.inProgress = false; this.paused = false; @@ -93,6 +98,7 @@ }); this.editor.asc_setMacros(JSON.stringify(macroData)); + this.editor.sendEvent("asc_onMacroRecordingStop"); }; MacroRecorder.prototype.pause = function() { @@ -100,6 +106,7 @@ return; this.paused = true; + this.editor.sendEvent("asc_onMacroRecordingPause"); }; MacroRecorder.prototype.resume = function() { @@ -107,6 +114,7 @@ return; this.paused = false; + this.editor.sendEvent("asc_onMacroRecordingResume"); }; MacroRecorder.prototype.isInProgress = function() { diff --git a/word/Editor/Document.js b/word/Editor/Document.js index b80d47b99e..341cc51dc6 100644 --- a/word/Editor/Document.js +++ b/word/Editor/Document.js @@ -22785,6 +22785,8 @@ CDocument.prototype.OnEndLoadScript = function() }; CDocument.prototype.BeginViewModeInReview = function(nMode) { + this.Api.macroRecorder.stop(); + if (this.IsViewModeInReview()) this.EndViewModeInReview();