Commit d5b0fbf2 authored by GoshaZotov's avatar GoshaZotov

new function->prototype into cAGGREGATE/cSUBTOTAL functions

parent f930f00d
...@@ -313,72 +313,72 @@ ...@@ -313,72 +313,72 @@
var f = null; var f = null;
switch (nFunc) { switch (nFunc) {
case AGGREGATE_FUNC_AVE: case AGGREGATE_FUNC_AVE:
f = new AscCommonExcel.cAVERAGE(); f = AscCommonExcel.cAVERAGE.prototype;
break; break;
case AGGREGATE_FUNC_CNT: case AGGREGATE_FUNC_CNT:
f = new AscCommonExcel.cCOUNT(); f = AscCommonExcel.cCOUNT.prototype;
break; break;
case AGGREGATE_FUNC_CNTA: case AGGREGATE_FUNC_CNTA:
f = new AscCommonExcel.cCOUNTA(); f = AscCommonExcel.cCOUNTA.prototype;
break; break;
case AGGREGATE_FUNC_MAX: case AGGREGATE_FUNC_MAX:
f = new AscCommonExcel.cMAX(); f = AscCommonExcel.cMAX.prototype;
break; break;
case AGGREGATE_FUNC_MIN: case AGGREGATE_FUNC_MIN:
f = new AscCommonExcel.cMIN(); f = AscCommonExcel.cMIN.prototype;
break; break;
case AGGREGATE_FUNC_PROD: case AGGREGATE_FUNC_PROD:
f = new AscCommonExcel.cPRODUCT(); f = AscCommonExcel.cPRODUCT.prototype;
break; break;
case AGGREGATE_FUNC_STD: case AGGREGATE_FUNC_STD:
f = new AscCommonExcel.cSTDEV_S(); f = AscCommonExcel.cSTDEV_S.prototype;
break; break;
case AGGREGATE_FUNC_STDP: case AGGREGATE_FUNC_STDP:
f = new AscCommonExcel.cSTDEV_P(); f = AscCommonExcel.cSTDEV_P.prototype;
break; break;
case AGGREGATE_FUNC_SUM: case AGGREGATE_FUNC_SUM:
f = new AscCommonExcel.cSUM(); f = AscCommonExcel.cSUM.prototype;
break; break;
case AGGREGATE_FUNC_VAR: case AGGREGATE_FUNC_VAR:
f = new AscCommonExcel.cVAR_S(); f = AscCommonExcel.cVAR_S.prototype;
break; break;
case AGGREGATE_FUNC_VARP: case AGGREGATE_FUNC_VARP:
f = new AscCommonExcel.cVAR_P(); f = AscCommonExcel.cVAR_P.prototype;
break; break;
case AGGREGATE_FUNC_MEDIAN: case AGGREGATE_FUNC_MEDIAN:
f = new AscCommonExcel.cMEDIAN(); f = AscCommonExcel.cMEDIAN.prototype;
break; break;
case AGGREGATE_FUNC_MODSNGL: case AGGREGATE_FUNC_MODSNGL:
f = new AscCommonExcel.cMODE_SNGL(); f = AscCommonExcel.cMODE_SNGL.prototype;
break; break;
case AGGREGATE_FUNC_LARGE: case AGGREGATE_FUNC_LARGE:
if (arg[3]) { if (arg[3]) {
f = new AscCommonExcel.cLARGE(); f = AscCommonExcel.cLARGE.prototype;
} }
break; break;
case AGGREGATE_FUNC_SMALL: case AGGREGATE_FUNC_SMALL:
if (arg[3]) { if (arg[3]) {
f = new AscCommonExcel.cSMALL(); f = AscCommonExcel.cSMALL.prototype;
} }
break; break;
case AGGREGATE_FUNC_PERCINC: case AGGREGATE_FUNC_PERCINC:
if (arg[3]) { if (arg[3]) {
f = new AscCommonExcel.cPERCENTILE_INC(); f = AscCommonExcel.cPERCENTILE_INC.prototype;
} }
break; break;
case AGGREGATE_FUNC_QRTINC: case AGGREGATE_FUNC_QRTINC:
if (arg[3]) { if (arg[3]) {
f = new AscCommonExcel.cQUARTILE_INC(); f = AscCommonExcel.cQUARTILE_INC.prototype;
} }
break; break;
case AGGREGATE_FUNC_PERCEXC: case AGGREGATE_FUNC_PERCEXC:
if (arg[3]) { if (arg[3]) {
f = new AscCommonExcel.cPERCENTILE_EXC(); f = AscCommonExcel.cPERCENTILE_EXC.prototype;
} }
break; break;
case AGGREGATE_FUNC_QRTEXC: case AGGREGATE_FUNC_QRTEXC:
if (arg[3]) { if (arg[3]) {
f = new AscCommonExcel.cQUARTILE_EXC(); f = AscCommonExcel.cQUARTILE_EXC.prototype;
} }
break; break;
default: default:
...@@ -441,7 +441,6 @@ ...@@ -441,7 +441,6 @@
return new cError(cErrorType.wrong_value_type); return new cError(cErrorType.wrong_value_type);
} }
f.setArgumentsCount(newArgs.length);
res = f.Calculate(newArgs); res = f.Calculate(newArgs);
} }
...@@ -4174,59 +4173,57 @@ ...@@ -4174,59 +4173,57 @@
case cSubTotalFunctionType.excludes.AVERAGE: case cSubTotalFunctionType.excludes.AVERAGE:
exclude = true; exclude = true;
case cSubTotalFunctionType.includes.AVERAGE: case cSubTotalFunctionType.includes.AVERAGE:
f = new AscCommonExcel.cAVERAGE(); f = AscCommonExcel.cAVERAGE.prototype;
break; break;
case cSubTotalFunctionType.excludes.COUNT: case cSubTotalFunctionType.excludes.COUNT:
exclude = true; exclude = true;
case cSubTotalFunctionType.includes.COUNT: case cSubTotalFunctionType.includes.COUNT:
f = new AscCommonExcel.cCOUNT(); f = AscCommonExcel.prototype;
break; break;
case cSubTotalFunctionType.excludes.COUNTA: case cSubTotalFunctionType.excludes.COUNTA:
exclude = true; exclude = true;
case cSubTotalFunctionType.includes.COUNTA: case cSubTotalFunctionType.includes.COUNTA:
f = new AscCommonExcel.cCOUNTA(); f = AscCommonExcel.prototype;
break; break;
case cSubTotalFunctionType.excludes.MAX: case cSubTotalFunctionType.excludes.MAX:
exclude = true; exclude = true;
case cSubTotalFunctionType.includes.MAX: case cSubTotalFunctionType.includes.MAX:
f = new AscCommonExcel.cMAX(); f = AscCommonExcel.prototype;
f.setArgumentsCount(arg.length - 1);
break; break;
case cSubTotalFunctionType.excludes.MIN: case cSubTotalFunctionType.excludes.MIN:
exclude = true; exclude = true;
case cSubTotalFunctionType.includes.MIN: case cSubTotalFunctionType.includes.MIN:
f = new AscCommonExcel.cMIN(); f = AscCommonExcel.prototype;
f.setArgumentsCount(arg.length - 1);
break; break;
case cSubTotalFunctionType.excludes.PRODUCT: case cSubTotalFunctionType.excludes.PRODUCT:
exclude = true; exclude = true;
case cSubTotalFunctionType.includes.PRODUCT: case cSubTotalFunctionType.includes.PRODUCT:
f = new cPRODUCT(); f = cPRODUCT.prototype;
break; break;
case cSubTotalFunctionType.excludes.STDEV: case cSubTotalFunctionType.excludes.STDEV:
exclude = true; exclude = true;
case cSubTotalFunctionType.includes.STDEV: case cSubTotalFunctionType.includes.STDEV:
f = new AscCommonExcel.cSTDEV(); f = AscCommonExcel.cSTDEV.prototype;
break; break;
case cSubTotalFunctionType.excludes.STDEVP: case cSubTotalFunctionType.excludes.STDEVP:
exclude = true; exclude = true;
case cSubTotalFunctionType.includes.STDEVP: case cSubTotalFunctionType.includes.STDEVP:
f = new AscCommonExcel.cSTDEVP(); f = AscCommonExcel.cSTDEVP.prototype;
break; break;
case cSubTotalFunctionType.excludes.SUM: case cSubTotalFunctionType.excludes.SUM:
exclude = true; exclude = true;
case cSubTotalFunctionType.includes.SUM: case cSubTotalFunctionType.includes.SUM:
f = new cSUM(); f = cSUM.prototype;
break; break;
case cSubTotalFunctionType.excludes.VAR: case cSubTotalFunctionType.excludes.VAR:
exclude = true; exclude = true;
case cSubTotalFunctionType.includes.VAR: case cSubTotalFunctionType.includes.VAR:
f = new AscCommonExcel.cVAR(); f = AscCommonExcel.cVAR.prototype;
break; break;
case cSubTotalFunctionType.excludes.VARP: case cSubTotalFunctionType.excludes.VARP:
exclude = true; exclude = true;
case cSubTotalFunctionType.includes.VARP: case cSubTotalFunctionType.includes.VARP:
f = new AscCommonExcel.cVARP(); f = AscCommonExcel.cVARP.prototype;
break; break;
} }
var res; var 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