Commit 47ab5835 authored by GoshaZotov's avatar GoshaZotov

add sheet formula

parent 17fb645c
......@@ -60,12 +60,12 @@
cFormulaFunctionGroup['LookupAndReference'] = cFormulaFunctionGroup['LookupAndReference'] || [];
cFormulaFunctionGroup['LookupAndReference'].push(cFORMULATEXT);
cFormulaFunctionGroup['Information'] = cFormulaFunctionGroup['Information'] || [];
cFormulaFunctionGroup['Information'].push(cSHEET, cSHEETS);
cFormulaFunctionGroup['Information'].push(cSHEETS);
cFormulaFunctionGroup['NotRealised'] = cFormulaFunctionGroup['NotRealised'] || [];
cFormulaFunctionGroup['NotRealised'].push(cDBCS, cUNICHAR, cUNICODE, cF_TEST, cFORECAST_ETS,
cFORECAST_ETS_CONFINT, cFORECAST_ETS_SEASONALITY, cFORECAST_ETS_STAT, cHYPGEOM_DIST, cPDURATION,
cMUNIT, cFORMULATEXT, cSHEET, cSHEETS);
cMUNIT, cFORMULATEXT, cSHEETS);
/**
* @constructor
......@@ -211,18 +211,6 @@
cQUERYSTRING.prototype = Object.create(cBaseFunction.prototype);
cQUERYSTRING.prototype.constructor = cQUERYSTRING;
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function cSHEET() {
cBaseFunction.call(this, "SHEET");
this.isXLFN = true;
}
cSHEET.prototype = Object.create(cBaseFunction.prototype);
cSHEET.prototype.constructor = cSHEET;
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
......
......@@ -49,10 +49,11 @@
var cArray = AscCommonExcel.cArray;
var cBaseFunction = AscCommonExcel.cBaseFunction;
var cFormulaFunctionGroup = AscCommonExcel.cFormulaFunctionGroup;
var cElementType = AscCommonExcel.cElementType;
cFormulaFunctionGroup['Information'] = cFormulaFunctionGroup['Information'] || [];
cFormulaFunctionGroup['Information'].push(cERROR_TYPE, cISBLANK, cISERR, cISERROR, cISEVEN, cISFORMULA, cISLOGICAL, cISNA,
cISNONTEXT, cISNUMBER, cISODD, cISREF, cISTEXT, cN, cNA, cTYPE);
cISNONTEXT, cISNUMBER, cISODD, cISREF, cISTEXT, cN, cNA, cSHEET, cTYPE);
/**
* @constructor
......@@ -547,6 +548,38 @@
return this.value = new cError(cErrorType.not_available);
};
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function cSHEET() {
this.name = "SHEET";
this.value = null;
this.argumentsCurrent = 0;
}
cSHEET.prototype = Object.create(cBaseFunction.prototype);
cSHEET.prototype.constructor = cSHEET;
cSHEET.prototype.argumentsMin = 0;
cSHEET.prototype.argumentsMax = 1;
cSHEET.prototype.isXLFN = true;
cSHEET.prototype.Calculate = function (arg, opt_bbox, opt_defName, ws) {
var res;
if(0 === arg.length){
res = new cNumber(ws.nSheetId);
}else{
var arg0 = arg[0];
if(cElementType.error === arg0.type){
res = arg0;
}else{
res = new cNumber(arg[0].ws.nSheetId);
}
}
return this.value = res;
};
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
......
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