Commit b0b6d9fe authored by Alexander.Trofimov's avatar Alexander.Trofimov

delete formatType from all functions

delete numFormat from all functions -> move to prototype
parent 59d8975a
This diff is collapsed.
......@@ -32,143 +32,100 @@
"use strict";
(
/**
* @param {Window} window
* @param {undefined} undefined
(/**
* @param {Window} window
* @param {undefined} undefined
*/
function (window, undefined) {
var cElementType = AscCommonExcel.cElementType;
var cBaseFunction = AscCommonExcel.cBaseFunction;
var cFormulaFunctionGroup = AscCommonExcel.cFormulaFunctionGroup;
cFormulaFunctionGroup['Cube'] = cFormulaFunctionGroup['Cube'] || [];
cFormulaFunctionGroup['Cube'].push(
cCUBEKPIMEMBER,
cCUBEMEMBER,
cCUBEMEMBERPROPERTY,
cCUBERANKEDMEMBER,
cCUBESET,
cCUBESETCOUNT,
cCUBEVALUE
);
function cCUBEKPIMEMBER() {
this.name = "CUBEKPIMEMBER";
this.type = cElementType.func;
this.value = null;
this.argumentsMin = 0;
this.argumentsCurrent = 0;
this.argumentsMax = 255;
this.formatType = {
def:-1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat:-2
};
this.numFormat = this.formatType.def;
}
cCUBEKPIMEMBER.prototype = Object.create( cBaseFunction.prototype );
function cCUBEMEMBER() {
this.name = "CUBEMEMBER";
this.type = cElementType.func;
this.value = null;
this.argumentsMin = 0;
this.argumentsCurrent = 0;
this.argumentsMax = 255;
this.formatType = {
def:-1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat:-2
};
this.numFormat = this.formatType.def;
}
cCUBEMEMBER.prototype = Object.create( cBaseFunction.prototype );
function cCUBEMEMBERPROPERTY() {
this.name = "CUBEMEMBERPROPERTY";
this.type = cElementType.func;
this.value = null;
this.argumentsMin = 0;
this.argumentsCurrent = 0;
this.argumentsMax = 255;
this.formatType = {
def:-1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat:-2
};
this.numFormat = this.formatType.def;
}
cCUBEMEMBERPROPERTY.prototype = Object.create( cBaseFunction.prototype );
function cCUBERANKEDMEMBER() {
this.name = "CUBERANKEDMEMBER";
this.type = cElementType.func;
this.value = null;
this.argumentsMin = 0;
this.argumentsCurrent = 0;
this.argumentsMax = 255;
this.formatType = {
def:-1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat:-2
};
this.numFormat = this.formatType.def;
}
cCUBERANKEDMEMBER.prototype = Object.create( cBaseFunction.prototype );
function cCUBESET() {
this.name = "CUBESET";
this.type = cElementType.func;
this.value = null;
this.argumentsMin = 0;
this.argumentsCurrent = 0;
this.argumentsMax = 255;
this.formatType = {
def:-1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat:-2
};
this.numFormat = this.formatType.def;
}
cCUBESET.prototype = Object.create( cBaseFunction.prototype );
function cCUBESETCOUNT() {
this.name = "CUBESETCOUNT";
this.type = cElementType.func;
this.value = null;
this.argumentsMin = 0;
this.argumentsCurrent = 0;
this.argumentsMax = 255;
this.formatType = {
def:-1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat:-2
};
this.numFormat = this.formatType.def;
}
cCUBESETCOUNT.prototype = Object.create( cBaseFunction.prototype );
function cCUBEVALUE() {
this.name = "CUBEVALUE";
this.type = cElementType.func;
this.value = null;
this.argumentsMin = 0;
this.argumentsCurrent = 0;
this.argumentsMax = 255;
this.formatType = {
def:-1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat:-2
};
this.numFormat = this.formatType.def;
}
cCUBEVALUE.prototype = Object.create( cBaseFunction.prototype );
function (window, undefined) {
var cElementType = AscCommonExcel.cElementType;
var cBaseFunction = AscCommonExcel.cBaseFunction;
var cFormulaFunctionGroup = AscCommonExcel.cFormulaFunctionGroup;
cFormulaFunctionGroup['Cube'] = cFormulaFunctionGroup['Cube'] || [];
cFormulaFunctionGroup['Cube'].push(cCUBEKPIMEMBER, cCUBEMEMBER, cCUBEMEMBERPROPERTY, cCUBERANKEDMEMBER, cCUBESET,
cCUBESETCOUNT, cCUBEVALUE);
/** @constructor */
function cCUBEKPIMEMBER() {
this.name = "CUBEKPIMEMBER";
this.type = cElementType.func;
this.value = null;
this.argumentsMin = 0;
this.argumentsCurrent = 0;
this.argumentsMax = 255;
}
cCUBEKPIMEMBER.prototype = Object.create(cBaseFunction.prototype);
/** @constructor */
function cCUBEMEMBER() {
this.name = "CUBEMEMBER";
this.type = cElementType.func;
this.value = null;
this.argumentsMin = 0;
this.argumentsCurrent = 0;
this.argumentsMax = 255;
}
cCUBEMEMBER.prototype = Object.create(cBaseFunction.prototype);
/** @constructor */
function cCUBEMEMBERPROPERTY() {
this.name = "CUBEMEMBERPROPERTY";
this.type = cElementType.func;
this.value = null;
this.argumentsMin = 0;
this.argumentsCurrent = 0;
this.argumentsMax = 255;
}
cCUBEMEMBERPROPERTY.prototype = Object.create(cBaseFunction.prototype);
/** @constructor */
function cCUBERANKEDMEMBER() {
this.name = "CUBERANKEDMEMBER";
this.type = cElementType.func;
this.value = null;
this.argumentsMin = 0;
this.argumentsCurrent = 0;
this.argumentsMax = 255;
}
cCUBERANKEDMEMBER.prototype = Object.create(cBaseFunction.prototype);
/** @constructor */
function cCUBESET() {
this.name = "CUBESET";
this.type = cElementType.func;
this.value = null;
this.argumentsMin = 0;
this.argumentsCurrent = 0;
this.argumentsMax = 255;
}
cCUBESET.prototype = Object.create(cBaseFunction.prototype);
/** @constructor */
function cCUBESETCOUNT() {
this.name = "CUBESETCOUNT";
this.type = cElementType.func;
this.value = null;
this.argumentsMin = 0;
this.argumentsCurrent = 0;
this.argumentsMax = 255;
}
cCUBESETCOUNT.prototype = Object.create(cBaseFunction.prototype);
/** @constructor */
function cCUBEVALUE() {
this.name = "CUBEVALUE";
this.type = cElementType.func;
this.value = null;
this.argumentsMin = 0;
this.argumentsCurrent = 0;
this.argumentsMax = 255;
}
cCUBEVALUE.prototype = Object.create(cBaseFunction.prototype);
})(window);
......@@ -32,100 +32,99 @@
"use strict";
(
/**
* @param {Window} window
* @param {undefined} undefined
*/
function (window, undefined) {
var cBaseFunction = AscCommonExcel.cBaseFunction;
var cFormulaFunctionGroup = AscCommonExcel.cFormulaFunctionGroup;
(/**
* @param {Window} window
* @param {undefined} undefined
*/
function (window, undefined) {
var cBaseFunction = AscCommonExcel.cBaseFunction;
var cFormulaFunctionGroup = AscCommonExcel.cFormulaFunctionGroup;
cFormulaFunctionGroup['Database'] = cFormulaFunctionGroup['Database'] || [];
cFormulaFunctionGroup['Database'].push(
cDAVERAGE,
cDCOUNT,
cDCOUNTA,
cDGET,
cDMAX,
cDMIN,
cDPRODUCT,
cDSTDEV,
cDSTDEVP,
cDSUM,
cDVAR,
cDVARP
);
cFormulaFunctionGroup['Database'] = cFormulaFunctionGroup['Database'] || [];
cFormulaFunctionGroup['Database'].push(cDAVERAGE, cDCOUNT, cDCOUNTA, cDGET, cDMAX, cDMIN, cDPRODUCT, cDSTDEV,
cDSTDEVP, cDSUM, cDVAR, cDVARP);
function cDAVERAGE() {
cBaseFunction.call( this, "DAVERAGE" );
}
/** @constructor */
function cDAVERAGE() {
cBaseFunction.call(this, "DAVERAGE");
}
cDAVERAGE.prototype = Object.create( cBaseFunction.prototype );
cDAVERAGE.prototype = Object.create(cBaseFunction.prototype);
function cDCOUNT() {
cBaseFunction.call( this, "DCOUNT" );
}
/** @constructor */
function cDCOUNT() {
cBaseFunction.call(this, "DCOUNT");
}
cDCOUNT.prototype = Object.create( cBaseFunction.prototype );
cDCOUNT.prototype = Object.create(cBaseFunction.prototype);
function cDCOUNTA() {
cBaseFunction.call( this, "DCOUNTA" );
}
/** @constructor */
function cDCOUNTA() {
cBaseFunction.call(this, "DCOUNTA");
}
cDCOUNTA.prototype = Object.create( cBaseFunction.prototype );
cDCOUNTA.prototype = Object.create(cBaseFunction.prototype);
function cDGET() {
cBaseFunction.call( this, "DGET" );
}
/** @constructor */
function cDGET() {
cBaseFunction.call(this, "DGET");
}
cDGET.prototype = Object.create( cBaseFunction.prototype );
cDGET.prototype = Object.create(cBaseFunction.prototype);
function cDMAX() {
cBaseFunction.call( this, "DMAX" );
}
/** @constructor */
function cDMAX() {
cBaseFunction.call(this, "DMAX");
}
cDMAX.prototype = Object.create( cBaseFunction.prototype );
cDMAX.prototype = Object.create(cBaseFunction.prototype);
function cDMIN() {
cBaseFunction.call( this, "DMIN" );
}
/** @constructor */
function cDMIN() {
cBaseFunction.call(this, "DMIN");
}
cDMIN.prototype = Object.create( cBaseFunction.prototype );
cDMIN.prototype = Object.create(cBaseFunction.prototype);
function cDPRODUCT() {
cBaseFunction.call( this, "DPRODUCT" );
}
/** @constructor */
function cDPRODUCT() {
cBaseFunction.call(this, "DPRODUCT");
}
cDPRODUCT.prototype = Object.create( cBaseFunction.prototype );
cDPRODUCT.prototype = Object.create(cBaseFunction.prototype);
function cDSTDEV() {
cBaseFunction.call( this, "DSTDEV" );
}
/** @constructor */
function cDSTDEV() {
cBaseFunction.call(this, "DSTDEV");
}
cDSTDEV.prototype = Object.create( cBaseFunction.prototype );
cDSTDEV.prototype = Object.create(cBaseFunction.prototype);
function cDSTDEVP() {
cBaseFunction.call( this, "DSTDEVP" );
}
/** @constructor */
function cDSTDEVP() {
cBaseFunction.call(this, "DSTDEVP");
}
cDSTDEVP.prototype = Object.create( cBaseFunction.prototype );
cDSTDEVP.prototype = Object.create(cBaseFunction.prototype);
function cDSUM() {
cBaseFunction.call( this, "DSUM" );
}
/** @constructor */
function cDSUM() {
cBaseFunction.call(this, "DSUM");
}
cDSUM.prototype = Object.create( cBaseFunction.prototype );
cDSUM.prototype = Object.create(cBaseFunction.prototype);
function cDVAR() {
cBaseFunction.call( this, "DVAR" );
}
/** @constructor */
function cDVAR() {
cBaseFunction.call(this, "DVAR");
}
cDVAR.prototype = Object.create( cBaseFunction.prototype );
cDVAR.prototype = Object.create(cBaseFunction.prototype);
function cDVARP() {
cBaseFunction.call( this, "DVARP" );
}
/** @constructor */
function cDVARP() {
cBaseFunction.call(this, "DVARP");
}
cDVARP.prototype = Object.create( cBaseFunction.prototype );
cDVARP.prototype = Object.create(cBaseFunction.prototype);
})(window);
......@@ -102,11 +102,6 @@
this.argumentsMin = 2;
this.argumentsCurrent = 0;
this.argumentsMax = 5;
this.formatType = {
def: -1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat: -2
};
this.numFormat = this.formatType.def;
}
cADDRESS.prototype = Object.create(cBaseFunction.prototype);
......@@ -231,11 +226,6 @@
this.argumentsMin = 2;
this.argumentsCurrent = 0;
this.argumentsMax = 30;
this.formatType = {
def: -1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat: -2
};
this.numFormat = this.formatType.def;
}
cCHOOSE.prototype = Object.create(cBaseFunction.prototype);
......@@ -275,11 +265,6 @@
this.argumentsMin = 0;
this.argumentsCurrent = 0;
this.argumentsMax = 1;
this.formatType = {
def: -1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat: -2
};
this.numFormat = this.formatType.def;
}
cCOLUMN.prototype = Object.create(cBaseFunction.prototype);
......@@ -311,11 +296,6 @@
this.argumentsMin = 1;
this.argumentsCurrent = 0;
this.argumentsMax = 1;
this.formatType = {
def: -1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat: -2
};
this.numFormat = this.formatType.def;
}
cCOLUMNS.prototype = Object.create(cBaseFunction.prototype);
......@@ -352,11 +332,6 @@
this.argumentsMin = 3;
this.argumentsCurrent = 0;
this.argumentsMax = 4;
this.formatType = {
def: -1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat: -2
};
this.numFormat = this.formatType.def;
}
cHLOOKUP.prototype = Object.create(cBaseFunction.prototype);
......@@ -473,11 +448,6 @@
this.argumentsMin = 2;
this.argumentsCurrent = 0;
this.argumentsMax = 4;
this.formatType = {
def: -1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat: -2
};
this.numFormat = this.formatType.def;
}
cINDEX.prototype = Object.create(cBaseFunction.prototype);
......@@ -560,11 +530,6 @@
this.argumentsMin = 1;
this.argumentsCurrent = 0;
this.argumentsMax = 2;
this.formatType = {
def: -1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat: -2
};
this.numFormat = this.formatType.def;
}
cINDIRECT.prototype = Object.create(cBaseFunction.prototype);
......@@ -640,11 +605,6 @@
this.argumentsMin = 2;
this.argumentsCurrent = 0;
this.argumentsMax = 3;
this.formatType = {
def: -1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat: -2
};
this.numFormat = this.formatType.def;
}
cLOOKUP.prototype = Object.create(cBaseFunction.prototype);
......@@ -791,11 +751,6 @@
this.argumentsMin = 2;
this.argumentsCurrent = 0;
this.argumentsMax = 3;
this.formatType = {
def: -1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat: -2
};
this.numFormat = this.formatType.def;
}
cMATCH.prototype = Object.create(cBaseFunction.prototype);
......@@ -902,11 +857,6 @@
this.argumentsMin = 3;
this.argumentsCurrent = 0;
this.argumentsMax = 5;
this.formatType = {
def: -1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat: -2
};
this.numFormat = this.formatType.def;
}
cOFFSET.prototype = Object.create(cBaseFunction.prototype);
......@@ -1008,11 +958,6 @@
this.argumentsMin = 0;
this.argumentsCurrent = 0;
this.argumentsMax = 1;
this.formatType = {
def: -1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat: -2
};
this.numFormat = this.formatType.def;
}
cROW.prototype = Object.create(cBaseFunction.prototype);
......@@ -1044,11 +989,6 @@
this.argumentsMin = 1;
this.argumentsCurrent = 0;
this.argumentsMax = 1;
this.formatType = {
def: -1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat: -2
};
this.numFormat = this.formatType.def;
}
cROWS.prototype = Object.create(cBaseFunction.prototype);
......@@ -1085,14 +1025,10 @@
this.argumentsMin = 1;
this.argumentsCurrent = 0;
this.argumentsMax = 1;
this.formatType = {
def: -1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat: -2
};
this.numFormat = this.formatType.noneFormat;
}
cTRANSPOSE.prototype = Object.create(cBaseFunction.prototype);
cTRANSPOSE.prototype.numFormat = AscCommonExcel.cNumFormatNone;
cTRANSPOSE.prototype.Calculate = function (arg) {
function TransposeMatrix(A) {
......@@ -1223,11 +1159,6 @@
this.argumentsMin = 3;
this.argumentsCurrent = 0;
this.argumentsMax = 4;
this.formatType = {
def: -1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat: -2
};
this.numFormat = this.formatType.def;
}
cVLOOKUP.prototype = Object.create(cBaseFunction.prototype);
......
This diff is collapsed.
......@@ -5263,12 +5263,11 @@ Woorksheet.prototype.isApplyFilterBySheet = function(){
Cell.prototype._adjustCellFormat = function() {
if (this.formulaParsed && this.formulaParsed.value && this.formulaParsed.outStack) {
var valueCalc = this.formulaParsed.value;
if (valueCalc.numFormat !== undefined && valueCalc.numFormat >= 0) {
if (0 <= valueCalc.numFormat) {
if (aStandartNumFormatsId[this.getNumFormatStr()] == 0) {
this.setNumFormat(aStandartNumFormats[valueCalc.numFormat]);
}
}
else if (valueCalc.numFormat !== undefined && valueCalc.numFormat == -1) {
} else if (AscCommonExcel.cNumFormatFirstCell === valueCalc.numFormat) {
// ищет в формуле первый рэндж и устанавливает формат ячейки как формат первой ячейки в рэндже
for (var i = 0, length = this.formulaParsed.outStack.length; i < length; i++) {
var elem = this.formulaParsed.outStack[i];
......
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