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

добавлена функция ODDFPRICE;

рефакторинг после проверки JSHINT'ом.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55699 954022d7-b5bf-4e40-9824-e11837661b57
parent 06520e7b
...@@ -16,7 +16,7 @@ cFormulaFunction.Cube = { ...@@ -16,7 +16,7 @@ cFormulaFunction.Cube = {
'CUBESET':cCUBESET, 'CUBESET':cCUBESET,
'CUBESETCOUNT':cCUBESETCOUNT, 'CUBESETCOUNT':cCUBESETCOUNT,
'CUBEVALUE':cCUBEVALUE 'CUBEVALUE':cCUBEVALUE
} };
function cCUBEKPIMEMBER() { function cCUBEKPIMEMBER() {
// cBaseFunction.call( this, "CUBEKPIMEMBER" ); // cBaseFunction.call( this, "CUBEKPIMEMBER" );
...@@ -34,7 +34,7 @@ function cCUBEKPIMEMBER() { ...@@ -34,7 +34,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() {
// cBaseFunction.call( this, "CUBEMEMBER" ); // cBaseFunction.call( this, "CUBEMEMBER" );
...@@ -52,7 +52,7 @@ function cCUBEMEMBER() { ...@@ -52,7 +52,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() {
// cBaseFunction.call( this, "CUBEMEMBERPROPERTY" ); // cBaseFunction.call( this, "CUBEMEMBERPROPERTY" );
...@@ -70,7 +70,7 @@ function cCUBEMEMBERPROPERTY() { ...@@ -70,7 +70,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() {
// cBaseFunction.call( this, "CUBERANKEDMEMBER" ); // cBaseFunction.call( this, "CUBERANKEDMEMBER" );
...@@ -88,7 +88,7 @@ function cCUBERANKEDMEMBER() { ...@@ -88,7 +88,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() {
// cBaseFunction.call( this, "CUBESET" ); // cBaseFunction.call( this, "CUBESET" );
...@@ -106,7 +106,7 @@ function cCUBESET() { ...@@ -106,7 +106,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() {
// cBaseFunction.call( this, "CUBESETCOUNT" ); // cBaseFunction.call( this, "CUBESETCOUNT" );
...@@ -124,7 +124,7 @@ function cCUBESETCOUNT() { ...@@ -124,7 +124,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() {
// cBaseFunction.call( this, "CUBEVALUE" ); // cBaseFunction.call( this, "CUBEVALUE" );
...@@ -142,4 +142,4 @@ function cCUBEVALUE() { ...@@ -142,4 +142,4 @@ function cCUBEVALUE() {
this.numFormat = this.formatType.def; this.numFormat = this.formatType.def;
} }
cCUBEVALUE.prototype = Object.create( cBaseFunction.prototype ) cCUBEVALUE.prototype = Object.create( cBaseFunction.prototype );
...@@ -21,64 +21,64 @@ cFormulaFunction.Database = { ...@@ -21,64 +21,64 @@ cFormulaFunction.Database = {
'DSUM':cDSUM, 'DSUM':cDSUM,
'DVAR':cDVAR, 'DVAR':cDVAR,
'DVARP':cDVARP 'DVARP':cDVARP
} };
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 );
This diff is collapsed.
...@@ -3422,29 +3422,29 @@ Woorksheet.prototype._BuildDependencies=function(cellRange){ ...@@ -3422,29 +3422,29 @@ Woorksheet.prototype._BuildDependencies=function(cellRange){
var oNewElem; var oNewElem;
if(range.isOneCell()) if(range.isOneCell())
{ {
if(elem instanceof cRef3D) if(elem instanceof CRef3D)
oNewElem = new cRef3D(ref, elem.ws.getName(), elem._wb); oNewElem = new CRef3D(ref, elem.ws.getName(), elem._wb);
else if(elem instanceof cArea3D) else if(elem instanceof CArea3D)
{ {
var wsFrom = elem._wb.getWorksheetById( elem.wsFrom ).getName(); var wsFrom = elem._wb.getWorksheetById( elem.wsFrom ).getName();
var wsTo = elem._wb.getWorksheetById( elem.wsTo ).getName(); var wsTo = elem._wb.getWorksheetById( elem.wsTo ).getName();
oNewElem = new cArea3D(ref, wsFrom, wsTo, elem._wb); oNewElem = new CArea3D(ref, wsFrom, wsTo, elem._wb);
} }
else else
oNewElem = new cRef(ref, elem.ws); oNewElem = new CRef(ref, elem.ws);
} }
else else
{ {
if(elem instanceof cRef3D) if(elem instanceof CRef3D)
oNewElem = new cArea3D(ref, elem.ws.getName(), elem.ws.getName(), elem._wb); oNewElem = new CArea3D(ref, elem.ws.getName(), elem.ws.getName(), elem._wb);
else if(elem instanceof cArea3D) else if(elem instanceof CArea3D)
{ {
var wsFrom = elem._wb.getWorksheetById( elem.wsFrom ).getName(); var wsFrom = elem._wb.getWorksheetById( elem.wsFrom ).getName();
var wsTo = elem._wb.getWorksheetById( elem.wsTo ).getName(); var wsTo = elem._wb.getWorksheetById( elem.wsTo ).getName();
oNewElem = new cArea3D(ref, wsFrom, wsTo, elem._wb); oNewElem = new CArea3D(ref, wsFrom, wsTo, elem._wb);
} }
else else
oNewElem = new cArea(ref, elem.ws); oNewElem = new CArea(ref, elem.ws);
} }
if ( ref.indexOf( "$" ) > -1 ) if ( ref.indexOf( "$" ) > -1 )
oNewElem.isAbsolute = true; oNewElem.isAbsolute = true;
...@@ -3535,9 +3535,9 @@ Woorksheet.prototype._RecalculatedFunctions=function(cell,bad){ ...@@ -3535,9 +3535,9 @@ Woorksheet.prototype._RecalculatedFunctions=function(cell,bad){
if ( c.formulaParsed && c.formulaParsed.outStack ) { if ( c.formulaParsed && c.formulaParsed.outStack ) {
for ( var i = 0, length = c.formulaParsed.outStack.length; i < length; i++ ) { for ( var i = 0, length = c.formulaParsed.outStack.length; i < length; i++ ) {
elem = c.formulaParsed.outStack[i]; elem = c.formulaParsed.outStack[i];
if ( elem instanceof cRef || elem instanceof cRef3D || elem instanceof cArea || elem instanceof cArea3D ) { if ( elem instanceof CRef || elem instanceof CRef3D || elem instanceof CArea || elem instanceof CArea3D ) {
var r = elem.getRange(); var r = elem.getRange();
if ( elem instanceof cArea3D && r.length > 0 ) if ( elem instanceof CArea3D && r.length > 0 )
r = r[0]; r = r[0];
if ( r && r.getNumFormatStr ) { if ( r && r.getNumFormatStr ) {
var sCurFormat = c.getNumFormatStr(); var sCurFormat = c.getNumFormatStr();
...@@ -3568,7 +3568,7 @@ Woorksheet.prototype._RecalculatedFunctions=function(cell,bad){ ...@@ -3568,7 +3568,7 @@ Woorksheet.prototype._RecalculatedFunctions=function(cell,bad){
res = __cell.formulaParsed.calculate(); res = __cell.formulaParsed.calculate();
} }
else { else {
res = new cError( cErrorType.bad_reference ) res = new CError( cErrorType.bad_reference )
} }
if(res){ if(res){
if( res.type == cElementType.cell){ if( res.type == cElementType.cell){
......
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