Commit 5a68c96e authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix bug 21067

parent ae11c17d
......@@ -571,7 +571,7 @@
var t = this, arg0 = arg[0].tocString(), arg1 = arg[1] ? arg[1] :
new cBool(true), r1 = arguments[1], wb = r1.worksheet.workbook, o = {
Formula: "", pCurrPos: 0
}, r2 = arguments[2], ref, found_operand;
}, ref, found_operand, ret;
function parseReference() {
if ((ref = parserHelp.is3DRef.call(o, o.Formula, o.pCurrPos))[0]) {
......@@ -599,7 +599,7 @@
}
if (cElementType.array === arg0.type) {
var ret = new cArray();
ret = new cArray();
arg0.foreach(function (elem, r) {
o = {Formula: elem.toString(), pCurrPos: 0};
parseReference();
......@@ -608,21 +608,22 @@
}
ret.addElement(found_operand)
});
return this.value = ret;
return this.setCA(ret, true);
} else {
o.Formula = arg0.toString();
parseReference();
}
if (found_operand) {
if (cElementType.name === found_operand.type) {
found_operand = found_operand.toRef();
}
return this.value = found_operand;
ret = found_operand;
} else {
ret = new cError(cErrorType.bad_reference);
}
}
return this.value = new cError(cErrorType.bad_reference);
return this.setCA(ret, true);
};
cINDIRECT.prototype.getInfo = function () {
......
......@@ -5329,25 +5329,23 @@ Woorksheet.prototype.isApplyFilterBySheet = function(){
}
};
Cell.prototype._calculateRefType = function () {
var nF, val = this.formulaParsed.value;
var val = this.formulaParsed.value;
var nF = val.numFormat;
var ca = val.ca;
if (cElementType.cell === val.type || cElementType.cell3D === val.type) {
nF = val.numFormat;
val = val.getValue();
val.numFormat = nF;
if (cElementType.empty === val.type) {
// Bug http://bugzilla.onlyoffice.com/show_bug.cgi?id=33941
val.value = 0;
val.type = cElementType.number;
}
} else if (cElementType.array === val.type) {
nF = val.numFormat;
val = val.getElement(0);
val.numFormat = nF;
} else if (cElementType.cellsRange === val.type || cElementType.cellsRange3D === val.type) {
nF = val.numFormat;
val = val.cross(new Asc.Range(this.nCol, this.nRow, this.nCol, this.nRow), this.ws.getId());
val.numFormat = nF;
}
val.numFormat = nF;
val.ca = ca;
this.formulaParsed.value = val;
};
Cell.prototype._updateCellValue = function() {
......
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