Commit e5b63418 authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix SUMIFS wrong count arguments

parent 2bb137f0
...@@ -4163,6 +4163,9 @@ cSQRTPI.prototype.getInfo = function () { ...@@ -4163,6 +4163,9 @@ cSQRTPI.prototype.getInfo = function () {
} }
} }
return this.value = new cNumber(_sum); return this.value = new cNumber(_sum);
};
cSUMIFS.prototype.checkArguments = function () {
return (this.argumentsCurrent % 2) && cBaseFunction.prototype.checkArguments.apply(this, arguments);
}; };
cSUMIFS.prototype.getInfo = function () { cSUMIFS.prototype.getInfo = function () {
return { return {
......
...@@ -4425,7 +4425,7 @@ parserFormula.prototype.parse = function(local, digitDelim) { ...@@ -4425,7 +4425,7 @@ parserFormula.prototype.parse = function(local, digitDelim) {
return false; return false;
} }
var p = top_elem, func; var p = top_elem, func, bError = false;
this.elemArr.pop(); this.elemArr.pop();
if (this.elemArr.length != 0 && ( func = this.elemArr[this.elemArr.length - 1] ).type == cElementType.func) { if (this.elemArr.length != 0 && ( func = this.elemArr[this.elemArr.length - 1] ).type == cElementType.func) {
p = this.elemArr.pop(); p = this.elemArr.pop();
...@@ -4437,7 +4437,14 @@ parserFormula.prototype.parse = function(local, digitDelim) { ...@@ -4437,7 +4437,14 @@ parserFormula.prototype.parse = function(local, digitDelim) {
} else { } else {
if (top_elem.getArguments() >= func.getMinArguments()) { if (top_elem.getArguments() >= func.getMinArguments()) {
func.setArgumentsCount(top_elem.getArguments()); func.setArgumentsCount(top_elem.getArguments());
if (!func.checkArguments()) {
bError = true;
}
} else { } else {
bError = true;
}
if (bError) {
this.outStack = []; this.outStack = [];
this.elemArr = []; this.elemArr = [];
this.error.push(c_oAscError.ID.FrmlWrongCountArgument); this.error.push(c_oAscError.ID.FrmlWrongCountArgument);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment