Commit 00882207 authored by GoshaZotov's avatar GoshaZotov

add check elements type specialFunctionStart/specialFunctionEnd(for sumproduct)

parent 81eac37e
...@@ -5214,6 +5214,9 @@ parserFormula.prototype.setFormula = function(formula) { ...@@ -5214,6 +5214,9 @@ parserFormula.prototype.setFormula = function(formula) {
if (currentElement.name === "(") { if (currentElement.name === "(") {
continue; continue;
} }
if(currentElement.type === cElementType.specialFunctionStart || currentElement.type === cElementType.specialFunctionEnd){
continue;
}
if (currentElement.type === cElementType.operator || currentElement.type === cElementType.func) { if (currentElement.type === cElementType.operator || currentElement.type === cElementType.func) {
if (elemArr.length < currentElement.getArguments()) { if (elemArr.length < currentElement.getArguments()) {
elemArr = []; elemArr = [];
...@@ -5597,6 +5600,11 @@ parserFormula.prototype.setFormula = function(formula) { ...@@ -5597,6 +5600,11 @@ parserFormula.prototype.setFormula = function(formula) {
var currentElement = null, _count = this.outStack.length, elemArr = new Array(_count), res = undefined, _count_arg; var currentElement = null, _count = this.outStack.length, elemArr = new Array(_count), res = undefined, _count_arg;
for (var i = 0, j = 0; i < _count; i++, j++) { for (var i = 0, j = 0; i < _count; i++, j++) {
currentElement = this.outStack[i]; currentElement = this.outStack[i];
if(currentElement.type === cElementType.specialFunctionStart || currentElement.type === cElementType.specialFunctionEnd){
continue;
}
if (cElementType.operator === currentElement.type || cElementType.func === currentElement.type) { if (cElementType.operator === currentElement.type || cElementType.func === currentElement.type) {
_count_arg = currentElement.getArguments(); _count_arg = currentElement.getArguments();
res = currentElement.Assemble2(elemArr, j - _count_arg, _count_arg); res = currentElement.Assemble2(elemArr, j - _count_arg, _count_arg);
...@@ -5626,6 +5634,11 @@ parserFormula.prototype.assembleLocale = function(locale, digitDelim) { ...@@ -5626,6 +5634,11 @@ parserFormula.prototype.assembleLocale = function(locale, digitDelim) {
var currentElement = null, _count = this.outStack.length, elemArr = new Array(_count), res = undefined, _count_arg; var currentElement = null, _count = this.outStack.length, elemArr = new Array(_count), res = undefined, _count_arg;
for (var i = 0, j = 0; i < _count; i++, j++) { for (var i = 0, j = 0; i < _count; i++, j++) {
currentElement = this.outStack[i]; currentElement = this.outStack[i];
if(currentElement.type === cElementType.specialFunctionStart || currentElement.type === cElementType.specialFunctionEnd){
continue;
}
if (currentElement.type == cElementType.operator || currentElement.type == cElementType.func) { if (currentElement.type == cElementType.operator || currentElement.type == cElementType.func) {
_count_arg = currentElement.getArguments(); _count_arg = currentElement.getArguments();
res = currentElement.Assemble2Locale(elemArr, j - _count_arg, _count_arg, locale, digitDelim); res = currentElement.Assemble2Locale(elemArr, j - _count_arg, _count_arg, locale, digitDelim);
......
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