Commit d0368feb authored by Dmitry.Shahtanov's avatar Dmitry.Shahtanov Committed by Alexander.Trofimov

рефакторинг.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55864 954022d7-b5bf-4e40-9824-e11837661b57
parent 9e84b5e7
......@@ -7,7 +7,9 @@
* Time: 15:15
* To change this template use File | Settings | File Templates.
*/
FormulaObjects.cFormulaFunction.Cube = {
cFormulaFunction.Cube = {
'groupName':"Cube",
'CUBEKPIMEMBER':cCUBEKPIMEMBER,
'CUBEMEMBER':cCUBEMEMBER,
......@@ -34,6 +36,7 @@ function cCUBEKPIMEMBER() {
this.numFormat = this.formatType.def;
}
cCUBEKPIMEMBER.prototype = Object.create( cBaseFunction.prototype );
function cCUBEMEMBER() {
......@@ -52,6 +55,7 @@ function cCUBEMEMBER() {
this.numFormat = this.formatType.def;
}
cCUBEMEMBER.prototype = Object.create( cBaseFunction.prototype );
function cCUBEMEMBERPROPERTY() {
......@@ -70,6 +74,7 @@ function cCUBEMEMBERPROPERTY() {
this.numFormat = this.formatType.def;
}
cCUBEMEMBERPROPERTY.prototype = Object.create( cBaseFunction.prototype );
function cCUBERANKEDMEMBER() {
......@@ -88,6 +93,7 @@ function cCUBERANKEDMEMBER() {
this.numFormat = this.formatType.def;
}
cCUBERANKEDMEMBER.prototype = Object.create( cBaseFunction.prototype );
function cCUBESET() {
......@@ -106,6 +112,7 @@ function cCUBESET() {
this.numFormat = this.formatType.def;
}
cCUBESET.prototype = Object.create( cBaseFunction.prototype );
function cCUBESETCOUNT() {
......@@ -124,6 +131,7 @@ function cCUBESETCOUNT() {
this.numFormat = this.formatType.def;
}
cCUBESETCOUNT.prototype = Object.create( cBaseFunction.prototype );
function cCUBEVALUE() {
......@@ -142,4 +150,5 @@ function cCUBEVALUE() {
this.numFormat = this.formatType.def;
}
cCUBEVALUE.prototype = Object.create( cBaseFunction.prototype );
......@@ -7,7 +7,8 @@
* Time: 15:16
* To change this template use File | Settings | File Templates.
*/
FormulaObjects.cFormulaFunction.Database = {
cFormulaFunction.Database = {
'groupName':"Database",
'DAVERAGE':cDAVERAGE,
'DCOUNT':cDCOUNT,
......@@ -26,59 +27,71 @@ FormulaObjects.cFormulaFunction.Database = {
function cDAVERAGE() {
cBaseFunction.call( this, "DAVERAGE" );
}
cDAVERAGE.prototype = Object.create( cBaseFunction.prototype );
function cDCOUNT() {
cBaseFunction.call( this, "DCOUNT" );
}
cDCOUNT.prototype = Object.create( cBaseFunction.prototype );
function cDCOUNTA() {
cBaseFunction.call( this, "DCOUNTA" );
}
cDCOUNTA.prototype = Object.create( cBaseFunction.prototype );
function cDGET() {
cBaseFunction.call( this, "DGET" );
}
cDGET.prototype = Object.create( cBaseFunction.prototype );
function cDMAX() {
cBaseFunction.call( this, "DMAX" );
}
cDMAX.prototype = Object.create( cBaseFunction.prototype );
function cDMIN() {
cBaseFunction.call( this, "DMIN" );
}
cDMIN.prototype = Object.create( cBaseFunction.prototype );
function cDPRODUCT() {
cBaseFunction.call( this, "DPRODUCT" );
}
cDPRODUCT.prototype = Object.create( cBaseFunction.prototype );
function cDSTDEV() {
cBaseFunction.call( this, "DSTDEV" );
}
cDSTDEV.prototype = Object.create( cBaseFunction.prototype );
function cDSTDEVP() {
cBaseFunction.call( this, "DSTDEVP" );
}
cDSTDEVP.prototype = Object.create( cBaseFunction.prototype );
function cDSUM() {
cBaseFunction.call( this, "DSUM" );
}
cDSUM.prototype = Object.create( cBaseFunction.prototype );
function cDVAR() {
cBaseFunction.call( this, "DVAR" );
}
cDVAR.prototype = Object.create( cBaseFunction.prototype );
function cDVARP() {
cBaseFunction.call( this, "DVARP" );
}
cDVARP.prototype = Object.create( cBaseFunction.prototype );
......@@ -7,7 +7,8 @@
* Time: 15:21
* To change this template use File | Settings | File Templates.
*/
FormulaObjects.cFormulaFunction.Information = {
cFormulaFunction.Information = {
'groupName':"Information",
'ERROR.TYPE':cERROR_TYPE,
'ISBLANK':cISBLANK,
......@@ -54,6 +55,7 @@ function cERROR_TYPE() {
this.numFormat = this.formatType.def;
}
cERROR_TYPE.prototype = Object.create( cBaseFunction.prototype );
cERROR_TYPE.prototype.Calculate = function ( arg ) {
function typeError( elem ) {
......@@ -127,6 +129,7 @@ function cISBLANK() {
this.numFormat = this.formatType.def;
}
cISBLANK.prototype = Object.create( cBaseFunction.prototype );
cISBLANK.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -166,6 +169,7 @@ function cISERR() {
this.numFormat = this.formatType.def;
}
cISERR.prototype = Object.create( cBaseFunction.prototype );
cISERR.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -209,6 +213,7 @@ function cISERROR() {
this.numFormat = this.formatType.def;
}
cISERROR.prototype = Object.create( cBaseFunction.prototype );
cISERROR.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -252,6 +257,7 @@ function cISEVEN() {
this.numFormat = this.formatType.def;
}
cISEVEN.prototype = Object.create( cBaseFunction.prototype );
cISEVEN.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -299,6 +305,7 @@ function cISLOGICAL() {
this.numFormat = this.formatType.def;
}
cISLOGICAL.prototype = Object.create( cBaseFunction.prototype );
cISLOGICAL.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -341,6 +348,7 @@ function cISNA() {
this.numFormat = this.formatType.def;
}
cISNA.prototype = Object.create( cBaseFunction.prototype );
cISNA.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -384,6 +392,7 @@ function cISNONTEXT() {
this.numFormat = this.formatType.def;
}
cISNONTEXT.prototype = Object.create( cBaseFunction.prototype );
cISNONTEXT.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -426,6 +435,7 @@ function cISNUMBER() {
this.numFormat = this.formatType.def;
}
cISNUMBER.prototype = Object.create( cBaseFunction.prototype );
cISNUMBER.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -469,6 +479,7 @@ function cISODD() {
this.numFormat = this.formatType.def;
}
cISODD.prototype = Object.create( cBaseFunction.prototype );
cISODD.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -516,6 +527,7 @@ function cISREF() {
this.numFormat = this.formatType.def;
}
cISREF.prototype = Object.create( cBaseFunction.prototype );
cISREF.prototype.Calculate = function ( arg ) {
if ( (arg[0] instanceof cRef || arg[0] instanceof cArea || arg[0] instanceof cArea3D || arg[0] instanceof cRef3D) && arg[0].isValid && arg[0].isValid() )
......@@ -547,6 +559,7 @@ function cISTEXT() {
this.numFormat = this.formatType.def;
}
cISTEXT.prototype = Object.create( cBaseFunction.prototype );
cISTEXT.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -591,6 +604,7 @@ function cN() {
this.numFormat = this.formatType.noneFormat;
}
cN.prototype = Object.create( cBaseFunction.prototype );
cN.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -646,6 +660,7 @@ function cNA() {
this.numFormat = this.formatType.def;
}
cNA.prototype = Object.create( cBaseFunction.prototype );
cNA.prototype.Calculate = function () {
return this.value = new cError( cErrorType.not_available );
......@@ -675,6 +690,7 @@ function cTYPE() {
this.numFormat = this.formatType.def;
}
cTYPE.prototype = Object.create( cBaseFunction.prototype );
cTYPE.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......
......@@ -7,7 +7,8 @@
* Time: 15:22
* To change this template use File | Settings | File Templates.
*/
FormulaObjects.cFormulaFunction.Logical = {
cFormulaFunction.Logical = {
'groupName':"Logical",
'AND':cAND,
'FALSE':cFALSE,
......@@ -36,6 +37,7 @@ function cAND() {
this.numFormat = this.formatType.def;
}
cAND.prototype = Object.create( cBaseFunction.prototype );
cAND.prototype.Calculate = function ( arg ) {
var argResult = null;
......@@ -130,6 +132,7 @@ function cFALSE() {
};
this.numFormat = this.formatType.def;
}
cFALSE.prototype = Object.create( cBaseFunction.prototype );
cFALSE.prototype.Calculate = function () {
return this.value = new cBool( false );
......@@ -159,6 +162,7 @@ function cIF() {
// this.setArgumentsMin( 1 );
// this.setArgumentsMax( 3 );
}
cIF.prototype = Object.create( cBaseFunction.prototype );
cIF.prototype.Calculate = function ( arg ) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2];
......@@ -222,6 +226,7 @@ function cIFERROR() {
this.numFormat = this.formatType.def;
}
cIFERROR.prototype = Object.create( cBaseFunction.prototype );
cIFERROR.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -267,6 +272,7 @@ function cNOT() {
this.numFormat = this.formatType.def;
}
cNOT.prototype = Object.create( cBaseFunction.prototype );
cNOT.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -319,6 +325,7 @@ function cOR() {
this.numFormat = this.formatType.def;
}
cOR.prototype = Object.create( cBaseFunction.prototype );
cOR.prototype.Calculate = function ( arg ) {
var argResult = null;
......@@ -407,6 +414,7 @@ function cTRUE() {
this.numFormat = this.formatType.def;
}
cTRUE.prototype = Object.create( cBaseFunction.prototype );
cTRUE.prototype.Calculate = function () {
return this.value = new cBool( true );
......
This diff is collapsed.
......@@ -7,7 +7,8 @@
* Time: 15:17
* To change this template use File | Settings | File Templates.
*/
FormulaObjects.cFormulaFunction.TextAndData = {
cFormulaFunction.TextAndData = {
'groupName':"TextAndData",
'ASC':cASC,
'BAHTTEXT':cBAHTTEXT,
......@@ -48,11 +49,13 @@ FormulaObjects.cFormulaFunction.TextAndData = {
function cASC() {
cBaseFunction.call( this, "ASC" );
}
cASC.prototype = Object.create( cBaseFunction.prototype )
function cBAHTTEXT() {
cBaseFunction.call( this, "BAHTTEXT" );
}
cBAHTTEXT.prototype = Object.create( cBaseFunction.prototype )
function cCHAR() {
......@@ -73,6 +76,7 @@ function cCHAR() {
this.numFormat = this.formatType.def;
}
cCHAR.prototype = Object.create( cBaseFunction.prototype )
cCHAR.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -129,6 +133,7 @@ function cCLEAN() {
}
cCLEAN.prototype = Object.create( cBaseFunction.prototype )
cCLEAN.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -176,6 +181,7 @@ function cCODE() {
this.numFormat = this.formatType.def;
}
cCODE.prototype = Object.create( cBaseFunction.prototype )
cCODE.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -231,6 +237,7 @@ function cCONCATENATE() {
this.numFormat = this.formatType.def;
}
cCONCATENATE.prototype = Object.create( cBaseFunction.prototype )
cCONCATENATE.prototype.Calculate = function ( arg ) {
var arg0 = new cString( "" ), argI;
......@@ -288,6 +295,7 @@ function cDOLLAR() {
this.numFormat = this.formatType.noneFormat;
}
cDOLLAR.prototype = Object.create( cBaseFunction.prototype )
cDOLLAR.prototype.Calculate = function ( arg ) {
......@@ -484,6 +492,7 @@ function cEXACT() {
this.numFormat = this.formatType.def;
}
cEXACT.prototype = Object.create( cBaseFunction.prototype )
cEXACT.prototype.Calculate = function ( arg ) {
var arg0 = arg[0], arg1 = arg[1];
......@@ -539,6 +548,7 @@ function cFIND() {
this.numFormat = this.formatType.def;
}
cFIND.prototype = Object.create( cBaseFunction.prototype )
cFIND.prototype.Calculate = function ( arg ) {
var arg0 = arg[0], arg1 = arg[1], arg2 = this.getArguments() == 3 ? arg[2] : null, res, str, searchStr, pos = -1;
......@@ -609,7 +619,7 @@ cFIND.prototype.getInfo = function () {
}
function cFINDB() {
var r = new FormulaObjects.cFormulaFunction.TextAndData["FIND"]()
var r = new cFormulaFunction.TextAndData["FIND"]()
r.setName( "FINDB" );
return r;
}
......@@ -632,6 +642,7 @@ function cFIXED() {
this.numFormat = this.formatType.def;
}
cFIXED.prototype = Object.create( cBaseFunction.prototype )
cFIXED.prototype.Calculate = function ( arg ) {
......@@ -809,6 +820,7 @@ cFIXED.prototype.getInfo = function () {
function cJIS() {
cBaseFunction.call( this, "JIS" );
}
cJIS.prototype = Object.create( cBaseFunction.prototype )
function cLEFT() {
......@@ -829,6 +841,7 @@ function cLEFT() {
this.numFormat = this.formatType.def;
}
cLEFT.prototype = Object.create( cBaseFunction.prototype )
cLEFT.prototype.Calculate = function ( arg ) {
var arg0 = arg[0], arg1 = this.argumentsCurrent == 1 ? new cNumber( 1 ) : arg[1];
......@@ -869,7 +882,7 @@ cLEFT.prototype.getInfo = function () {
}
function cLEFTB() {
var r = new FormulaObjects.cFormulaFunction.TextAndData["LEFT"]()
var r = new cFormulaFunction.TextAndData["LEFT"]()
r.setName( "LEFTB" );
return r;
}
......@@ -892,6 +905,7 @@ function cLEN() {
this.numFormat = this.formatType.def;
}
cLEN.prototype = Object.create( cBaseFunction.prototype )
cLEN.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -918,7 +932,7 @@ cLEN.prototype.getInfo = function () {
}
function cLENB() {
var r = new FormulaObjects.cFormulaFunction.TextAndData["LEN"]();
var r = new cFormulaFunction.TextAndData["LEN"]();
r.setName( "LENB" );
return r;
}
......@@ -941,6 +955,7 @@ function cLOWER() {
this.numFormat = this.formatType.def;
}
cLOWER.prototype = Object.create( cBaseFunction.prototype )
cLOWER.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -981,6 +996,7 @@ function cMID() {
this.numFormat = this.formatType.def;
}
cMID.prototype = Object.create( cBaseFunction.prototype )
cMID.prototype.Calculate = function ( arg ) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2];
......@@ -1033,7 +1049,7 @@ cMID.prototype.getInfo = function () {
}
function cMIDB() {
var r = new FormulaObjects.cFormulaFunction.TextAndData["MID"]();
var r = new cFormulaFunction.TextAndData["MID"]();
r.setName( "MIDB" );
return r;
}
......@@ -1041,6 +1057,7 @@ function cMIDB() {
function cPHONETIC() {
cBaseFunction.call( this, "PHONETIC" );
}
cPHONETIC.prototype = Object.create( cBaseFunction.prototype )
function cPROPER() {
......@@ -1061,6 +1078,7 @@ function cPROPER() {
this.numFormat = this.formatType.def;
}
cPROPER.prototype = Object.create( cBaseFunction.prototype )
cPROPER.prototype.Calculate = function ( arg ) {
var reg_PROPER = new RegExp( "[-#$+*/^&%<\\[\\]='?_\\@!~`\">: ;.\\)\\(,]|\\d|\\s" ), arg0 = arg[0];
......@@ -1138,6 +1156,7 @@ function cREPLACE() {
this.numFormat = this.formatType.def;
}
cREPLACE.prototype = Object.create( cBaseFunction.prototype )
cREPLACE.prototype.Calculate = function ( arg ) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2], arg3 = arg[3];
......@@ -1210,7 +1229,7 @@ cREPLACE.prototype.getInfo = function () {
}
function cREPLACEB() {
var r = new FormulaObjects.cFormulaFunction.TextAndData["REPLACE"]();
var r = new cFormulaFunction.TextAndData["REPLACE"]();
r.setName( "REPLACEB" );
return r;
}
......@@ -1233,6 +1252,7 @@ function cREPT() {
this.numFormat = this.formatType.def;
}
cREPT.prototype = Object.create( cBaseFunction.prototype )
cREPT.prototype.Calculate = function ( arg ) {
var arg0 = arg[0], arg1 = arg[1], res = "";
......@@ -1304,6 +1324,7 @@ function cRIGHT() {
this.numFormat = this.formatType.def;
}
cRIGHT.prototype = Object.create( cBaseFunction.prototype )
cRIGHT.prototype.Calculate = function ( arg ) {
var arg0 = arg[0], arg1 = this.argumentsCurrent == 1 ? new cNumber( 1 ) : arg[1];
......@@ -1344,7 +1365,7 @@ cRIGHT.prototype.getInfo = function () {
}
function cRIGHTB() {
var r = new FormulaObjects.cFormulaFunction.TextAndData["RIGHT"]()
var r = new cFormulaFunction.TextAndData["RIGHT"]()
r.setName( "RIGHTB" );
return r;
}
......@@ -1367,6 +1388,7 @@ function cSEARCH() {
this.numFormat = this.formatType.def;
}
cSEARCH.prototype = Object.create( cBaseFunction.prototype )
cSEARCH.prototype.Calculate = function ( arg ) {
......@@ -1450,7 +1472,7 @@ cSEARCH.prototype.getInfo = function () {
}
function cSEARCHB() {
var r = new FormulaObjects.cFormulaFunction.TextAndData["SEARCH"]();
var r = new cFormulaFunction.TextAndData["SEARCH"]();
r.setName( "SEARCHB" );
return r;
}
......@@ -1473,6 +1495,7 @@ function cSUBSTITUTE() {
this.numFormat = this.formatType.def;
}
cSUBSTITUTE.prototype = Object.create( cBaseFunction.prototype )
cSUBSTITUTE.prototype.Calculate = function ( arg ) {
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2], arg3 = arg[3] ? arg[3] : new cNumber( 0 );
......@@ -1565,6 +1588,7 @@ function cT() {
this.numFormat = this.formatType.def;
}
cT.prototype = Object.create( cBaseFunction.prototype )
cT.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -1610,6 +1634,7 @@ function cTEXT() {
this.numFormat = this.formatType.def;
}
cTEXT.prototype = Object.create( cBaseFunction.prototype )
cTEXT.prototype.Calculate = function ( arg ) {
var arg0 = arg[0], arg1 = arg[1];
......@@ -1685,6 +1710,7 @@ function cTRIM() {
this.numFormat = this.formatType.def;
}
cTRIM.prototype = Object.create( cBaseFunction.prototype )
cTRIM.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -1701,7 +1727,7 @@ cTRIM.prototype.Calculate = function ( arg ) {
if ( arg0 instanceof cError )
return this.value = arg0;
return this.value = new cString( arg0.getValue().replace( rx_space_g, function ( $0, $1, $2 ) {
return this.value = new cString( arg0.getValue().replace( rx_space_g,function ( $0, $1, $2 ) {
var res;
rx_space.test( $2[$1 + 1] ) ? res = "" : res = $2[$1];
return res;
......@@ -1732,6 +1758,7 @@ function cUPPER() {
this.numFormat = this.formatType.def;
}
cUPPER.prototype = Object.create( cBaseFunction.prototype )
cUPPER.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......@@ -1772,6 +1799,7 @@ function cVALUE() {
this.numFormat = this.formatType.noneFormat;
}
cVALUE.prototype = Object.create( cBaseFunction.prototype )
cVALUE.prototype.Calculate = function ( arg ) {
var arg0 = arg[0];
......
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