[de] Return nothing to a plugin when the builder script was canceled

This commit is contained in:
KirillovIlya
2024-03-04 18:09:49 +03:00
committed by Ilya Kirillov
parent 004598a7a3
commit 0e6b2f26ba
6 changed files with 17 additions and 6 deletions

View File

@ -6928,6 +6928,7 @@ var editor;
};
spreadsheet_api.prototype.onEndBuilderScript = function() {
this.asc_endPaste();
return true;
};

View File

@ -3125,6 +3125,7 @@
};
baseEditorsApi.prototype.onEndBuilderScript = function()
{
return true;
};
// Native

View File

@ -1270,14 +1270,17 @@
{
let _t = this;
this.api._afterEvalCommand(function() {
_t.api.onEndBuilderScript();
if (!_t.api.onEndBuilderScript())
commandReturnValue = undefined;
_t.shiftCommand(commandReturnValue);
});
return;
}
else
{
this.api.onEndBuilderScript();
if (!this.api.onEndBuilderScript())
commandReturnValue = undefined;
}
}
}

View File

@ -8323,6 +8323,7 @@ background-repeat: no-repeat;\
this.asc_Recalculate();
let logicDocument = this.getLogicDocument();
logicDocument.FinalizeAction();
return true;
};
asc_docs_api.prototype.asc_SetAutomaticBulletedLists = function(isAuto)

View File

@ -2727,11 +2727,12 @@ CDocument.prototype.private_Redraw = function(nStartPage, nEndPage)
/**
* Завершаем действие
* @param {boolean} [isCheckEmptyAction=true] Нужно ли проверять, что действие ничего не делало
* @returns {boolean} Выполнилось ли действие
*/
CDocument.prototype.FinalizeAction = function(isCheckEmptyAction)
{
if (!this.IsActionStarted())
return;
return true;
if (this.Action.Depth > 0)
{
@ -2743,8 +2744,10 @@ CDocument.prototype.FinalizeAction = function(isCheckEmptyAction)
}
this.Action.Depth--;
return;
return true;
}
let actionCanceled = false;
this.private_CheckAdditionalOnFinalize();
@ -2760,6 +2763,7 @@ CDocument.prototype.FinalizeAction = function(isCheckEmptyAction)
}
this.RecalculateByChanges(arrChanges);
actionCanceled = true;
}
else if (false !== isCheckEmptyAction)
{
@ -2820,7 +2824,7 @@ CDocument.prototype.FinalizeAction = function(isCheckEmptyAction)
this.Api.checkChangesSize();
if (this.Action.UpdateStates)
return;
return !actionCanceled;
this.Action.UpdateStates = true;
@ -2852,6 +2856,7 @@ CDocument.prototype.FinalizeAction = function(isCheckEmptyAction)
this.Action.UpdateStates = false;
this.sendEvent("asc_onUserActionEnd");
return !actionCanceled;
};
/**
* Сообщаем, что нужно отменить начатое действие

View File

@ -9578,7 +9578,7 @@ background-repeat: no-repeat;\
let logicDocument = this.getLogicDocument();
logicDocument.Recalculate();
logicDocument.CheckActionLock();
logicDocument.FinalizeAction();
return logicDocument.FinalizeAction();
};
//----------------------------------------------------------------------------------------------------------------------
// Работаем с полями