Skip to content

Commit

Permalink
[plugins][macros] Change how plugin "Macros" works with history.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyMatveev686 authored and K0R0L committed Sep 29, 2023
1 parent 94ed64c commit 8b882f3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions common/apiBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions common/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion slide/Editor/Format/Presentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 8b882f3

Please sign in to comment.