Commit 8ecfbee5 authored by GoshaZotov's avatar GoshaZotov

check errors for textjoin formula

parent b0742732
...@@ -2483,15 +2483,30 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara ...@@ -2483,15 +2483,30 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
arg = arg.getMatrix(); arg = arg.getMatrix();
for (var i = 0; i < arg.length; i++) { for (var i = 0; i < arg.length; i++) {
for (var j = 0; j < arg[i].length; j++) { for (var j = 0; j < arg[i].length; j++) {
res.push(getValue(arg[i][j])); if(cElementType.error === arg[i][j].type){
res = arg[i][j];
break;
}else{
res.push(getValue(arg[i][j]));
}
} }
} }
}else if(cElementType.array === arg.type){ }else if(cElementType.array === arg.type){
arg.foreach(function (elem) { arg.foreach(function (elem) {
res.push(getValue(elem)); if(cElementType.error === elem.type){
res = elem;
return;
}else{
res.push(getValue(elem));
}
}) })
}else{ }else{
res.push(getValue(arg)); if(cElementType.error === arg.type){
res = elem;
return;
}else{
res.push(getValue(arg));
}
} }
return res; return res;
......
...@@ -1816,8 +1816,11 @@ ...@@ -1816,8 +1816,11 @@
var ignore_empty = argClone[1].toBool(); var ignore_empty = argClone[1].toBool();
var delimiter = argClone[0]; var delimiter = argClone[0];
var delimiterArr = this._getOneDimensionalArray(delimiter);
var delimiterIter = 0; var delimiterIter = 0;
var delimiterArr = this._getOneDimensionalArray(delimiter);
if(delimiterArr instanceof cError){
return this.value = delimiterArr;
}
var concatString = function(string1, string2){ var concatString = function(string1, string2){
var res = string1; var res = string1;
...@@ -1841,28 +1844,29 @@ ...@@ -1841,28 +1844,29 @@
var arg0 = new cString(""), argI; var arg0 = new cString(""), argI;
for (var i = 2; i < this.argumentsCurrent; i++) { for (var i = 2; i < this.argumentsCurrent; i++) {
argI = arg[i]; argI = arg[i];
if (argI instanceof cArea || argI instanceof cArea3D) {
argI.foreach2(function (elem) {
arg0 = new cString(concatString(arg0.toString(), elem.toString()));
});
}else{
argI = argI.tocString();
if (argI instanceof cError) { if(argI instanceof cArea || argI instanceof cArray || argI instanceof cArea3D){
return this.value = argI; if (argI instanceof cArea || argI instanceof cArray) {
} else if (argI instanceof cArray) { argI = argI.getMatrix();
argI.foreach(function (elem) { } else if (argI instanceof cArea3D) {
if (elem instanceof cError) { argI = argI.getMatrix()[0];
arg0 = elem; }
return true;
}
arg0 = new cString(concatString(arg0.toString(), elem.toString()));
});
if (arg0 instanceof cError) { for (var n = 0; n < argI.length; n++) {
return this.value = arg0; for (var j = 0; j < argI[n].length; j++) {
if(cElementType.error === argI[n][j].type){
return this.value = argI[n][j];
}else{
arg0 = new cString(concatString(arg0.toString(), argI[n][j].toString()));
}
} }
} else { }
}else{
argI = argI.tocString();
if (arg0 instanceof cError) {
return this.value = arg0;
}else{
arg0 = new cString(concatString(arg0.toString(), argI.toString())); arg0 = new cString(concatString(arg0.toString(), argI.toString()));
} }
} }
......
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