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

поправлен конструктор класса ошибка для формул.

fixed:
Bug 24926 - Аргументы Frequency/Basis при вычислении в формуле YIELD не усекаются до целого
Bug 24918 - Функция XNPV рассчитывается без обязательных аргументов Rate, Values, Dates

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56870 954022d7-b5bf-4e40-9824-e11837661b57
parent 19d1f017
...@@ -356,14 +356,8 @@ cString.prototype.tryConvert = function () { ...@@ -356,14 +356,8 @@ cString.prototype.tryConvert = function () {
function cBool( val ) { function cBool( val ) {
cBaseType.call( this, val ); cBaseType.call( this, val );
this.needRecalc = false;
this.numFormat = null;
this.ca = false;
this.node = undefined;
this.type = cElementType.bool; this.type = cElementType.bool;
var v = val.toString().toUpperCase(); this.value = val.toString().toUpperCase() === "TRUE";
this.value = v === "TRUE";
} }
cBool.prototype = Object.create( cBaseType.prototype ); cBool.prototype = Object.create( cBaseType.prototype );
...@@ -410,6 +404,8 @@ function cError( val ) { ...@@ -410,6 +404,8 @@ function cError( val ) {
case "#NULL!": case "#NULL!":
case cErrorType.null_value: case cErrorType.null_value:
{ {
this.value = "#NULL!";
this.errorType = cErrorType.null_value;
break; break;
} }
case "#DIV/0!": case "#DIV/0!":
...@@ -660,24 +656,30 @@ cArea.prototype.foreach2 = function ( action ) { ...@@ -660,24 +656,30 @@ cArea.prototype.foreach2 = function ( action ) {
var val, cellType; var val, cellType;
if ( cell ) { if ( cell ) {
cellType = cell.getType(); cellType = cell.getType();
if ( cellType === CellValueType.Number ) { switch( cellType ){
cell.getValueWithoutFormat() === "" ? val = new cEmpty() : val = new cNumber( cell.getValueWithoutFormat() ); case CellValueType.Number:{
} cell.getValueWithoutFormat() === "" ? val = new cEmpty() : val = new cNumber( cell.getValueWithoutFormat() );
else if ( cellType === CellValueType.Bool ) { break;
val = new cBool( cell.getValueWithoutFormat() );
}
else if ( cellType === CellValueType.Error ) {
val = new cError( cell.getValueWithoutFormat() );
}
else if ( cellType === CellValueType.String ) {
val = new cString( cell.getValueWithoutFormat() );
}
else {
if ( cell.getValueWithoutFormat() && cell.getValueWithoutFormat() !== "" ) {
val = new cNumber( cell.getValueWithoutFormat() );
} }
else { case CellValueType.Bool:{
val = checkTypeCell( "" + cell.getValueWithoutFormat() ); val = new cBool( cell.getValueWithoutFormat() );
break;
}
case CellValueType.Error:{
val = new cError( cell.getValueWithoutFormat() );
break;
}
case CellValueType.String:{
val = new cString( cell.getValueWithoutFormat() );
break;
}
default:{
if ( cell.getValueWithoutFormat() && cell.getValueWithoutFormat() !== "" ) {
val = new cNumber( cell.getValueWithoutFormat() );
}
else {
val = checkTypeCell( "" + cell.getValueWithoutFormat() );
}
} }
} }
} }
...@@ -1043,29 +1045,36 @@ cArea3D.prototype.foreach2 = function ( action ) { ...@@ -1043,29 +1045,36 @@ cArea3D.prototype.foreach2 = function ( action ) {
var val; var val;
if ( _cell ) { if ( _cell ) {
var cellType = _cell.getType(); var cellType = _cell.getType();
if ( cellType === CellValueType.Number ) { switch( cellType ){
if ( _cell.getValueWithoutFormat() === "" ) { case CellValueType.Number:{
val = new cEmpty(); if ( _cell.getValueWithoutFormat() === "" ) {
val = new cEmpty();
}
else {
val = new cNumber( _cell.getValueWithoutFormat() );
}
break;
} }
else { case CellValueType.Bool:{
val = new cNumber( _cell.getValueWithoutFormat() ); val = new cBool( _cell.getValueWithoutFormat() );
break;
} }
} case CellValueType.Error:{
else if ( cellType === CellValueType.Bool ) { val = new cError( _cell.getValueWithoutFormat() );
val = new cBool( _cell.getValueWithoutFormat() ); break;
}
else if ( cellType === CellValueType.Error ) {
val = new cError( _cell.getValueWithoutFormat() );
}
else if ( cellType === CellValueType.String ) {
val = new cString( _cell.getValueWithoutFormat() );
}
else {
if ( _cell.getValueWithoutFormat() && _cell.getValueWithoutFormat() !== "" ) {
val = new cNumber( _cell.getValueWithoutFormat() );
} }
else { case CellValueType.String:{
val = checkTypeCell( "" + _cell.getValueWithoutFormat() ); val = new cString( _cell.getValueWithoutFormat() );
break;
}
default:{
if ( _cell.getValueWithoutFormat() && _cell.getValueWithoutFormat() !== "" ) {
val = new cNumber( _cell.getValueWithoutFormat() );
}
else {
val = checkTypeCell( "" + _cell.getValueWithoutFormat() );
}
break;
} }
} }
} }
......
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