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