Commit 3ac7d57d authored by GoshaZotov's avatar GoshaZotov

for bug 35738 (sheet formula)

parent 8ece9248
......@@ -565,7 +565,7 @@
cSHEET.prototype.isXLFN = true;
cSHEET.prototype.Calculate = function (arg, opt_bbox, opt_defName, ws) {
var res;
var res = null;
if(0 === arg.length){
res = new cNumber(ws.nSheetId);
}else{
......@@ -576,14 +576,24 @@
if(arg0.ws){
res = new cNumber(arg0.ws.nSheetId);
}else if(arg0.wsFrom){
var sheet1 = arg0.wsFrom.index;
var sheet2 = arg0.wsTo.index;
var sheet1 = arg0.wsFrom.nSheetId;
var sheet2 = arg0.wsTo.nSheetId;
res = new cNumber(Math.min(sheet1, sheet2));
}else if(cElementType.string === arg0.type){
var arg0Val = arg0.getValue();
var curWorksheet = ws.workbook.getWorksheetByName(arg0Val);
if(curWorksheet && undefined !== curWorksheet.nSheetId){
res = new cNumber(curWorksheet.nSheetId);
}
}
}
return this.value = res;
}
if(null === res){
res = new cError(cErrorType.wrong_value_type);
}
return this.value = res;
};
/**
......
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