Refactoring

This commit is contained in:
Julia.Radzhabova
2025-09-17 13:02:21 +03:00
parent 66c0492688
commit dbcd9d05a4
2 changed files with 25 additions and 17 deletions

View File

@ -3223,21 +3223,20 @@ define([], function () {
}
var funcdesc = this.getApplication().getController('FormulaDialog').getDescription(Common.Utils.InternalSettings.get("sse-settings-func-locale")),
hint = '',
args = '';
if (funcdesc && funcdesc[name]) {
hint = this.api.asc_getFormulaLocaleName(name) + funcdesc[name].a;
hint = hint.replace(/[,;]/g, this.api.asc_getFunctionArgumentSeparator());
args = funcdesc[name].a.replace(/[,;]/g, this.api.asc_getFunctionArgumentSeparator());
} else {
var custom = this.api.asc_getCustomFunctionInfo(name),
arr_args = custom ? custom.asc_getArg() || [] : [];
hint = this.api.asc_getFormulaLocaleName(name) + '(' + arr_args.map(function (item) { return item.asc_getIsOptional() ? '[' + item.asc_getName() + ']' : item.asc_getName(); }).join(this.api.asc_getFunctionArgumentSeparator() + ' ') + ')';
args = '(' + arr_args.map(function (item) { return item.asc_getIsOptional() ? '[' + item.asc_getName() + ']' : item.asc_getName(); }).join(this.api.asc_getFunctionArgumentSeparator() + ' ') + ')';
}
var argstype = funcInfo.asc_getArgumentsType(),
activeArg = funcInfo.asc_getActiveArgPos();
argstype = funcInfo.asc_getArgumentsType(),
activeArg = funcInfo.asc_getActiveArgPos(),
activeArgsCount = funcInfo.asc_getActiveArgsCount();
if (argstype && activeArg && activeArgsCount) {
var args = '';
if (funcdesc && funcdesc[name]) {
args = funcdesc[name].a.replace(/[,;]/g, this.api.asc_getFunctionArgumentSeparator());
} else {
var custom = this.api.asc_getCustomFunctionInfo(name),
arr_args = custom ? custom.asc_getArg() || [] : [];
args = '(' + arr_args.map(function (item) { return item.asc_getIsOptional() ? '[' + item.asc_getName() + ']' : item.asc_getName(); }).join(this.api.asc_getFunctionArgumentSeparator() + ' ') + ')';
}
if (argstype && activeArg) {
var argsNames = this.parseArgsDesc(args),
minArgCount = funcInfo.asc_getArgumentMin(),
maxArgCount = funcInfo.asc_getArgumentMax(),
@ -3269,13 +3268,22 @@ define([], function () {
fillArgs(types);
}
if (arr.length<=activeArg && repeatedArg) { // add repeated
while (arr.length<=activeArg) {
if (arr.length<=activeArgsCount && repeatedArg) { // add repeated
while (arr.length<=activeArgsCount) {
fillArgs(repeatedArg);
}
}
repeatedArg && arr.push('...');
hint = this.api.asc_getFormulaLocaleName(name) + '(' + arr.join(this.api.asc_getFunctionArgumentSeparator() + ' ') + ')';
} else {
if (funcdesc && funcdesc[name]) {
hint = this.api.asc_getFormulaLocaleName(name) + funcdesc[name].a;
hint = hint.replace(/[,;]/g, this.api.asc_getFunctionArgumentSeparator());
} else {
var custom = this.api.asc_getCustomFunctionInfo(name),
arr_args = custom ? custom.asc_getArg() || [] : [];
hint = this.api.asc_getFormulaLocaleName(name) + '(' + arr_args.map(function (item) { return item.asc_getIsOptional() ? '[' + item.asc_getName() + ']' : item.asc_getName(); }).join(this.api.asc_getFunctionArgumentSeparator() + ' ') + ')';
}
}
if (functip.ref && functip.ref.isVisible()) {

View File

@ -1076,7 +1076,7 @@
"SSE.Controllers.DocumentHolder.txtWarnUrl": "Clicking this link can be harmful to your device and data.To protect you computer, click only those hyperlinks from trusted sources. This location may be unsafe:<br><br>{0}<br><br>Are you sure you want to continue?",
"SSE.Controllers.DocumentHolder.txtWidth": "Width",
"SSE.Controllers.DocumentHolder.warnFilterError": "You need at least one field in the Values area in order to apply a value filter.",
"SSE.Controllers.DocumentHolder.textArgument": "Argument",
"SSE.Controllers.DocumentHolder.textArgument": "argument",
"SSE.Controllers.FormulaDialog.sCategoryAll": "All",
"SSE.Controllers.FormulaDialog.sCategoryCube": "Cube",
"SSE.Controllers.FormulaDialog.sCategoryCustom": "Custom",