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,19 +656,24 @@ cArea.prototype.foreach2 = function ( action ) { ...@@ -660,19 +656,24 @@ 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 ){
case CellValueType.Number:{
cell.getValueWithoutFormat() === "" ? val = new cEmpty() : val = new cNumber( cell.getValueWithoutFormat() ); cell.getValueWithoutFormat() === "" ? val = new cEmpty() : val = new cNumber( cell.getValueWithoutFormat() );
break;
} }
else if ( cellType === CellValueType.Bool ) { case CellValueType.Bool:{
val = new cBool( cell.getValueWithoutFormat() ); val = new cBool( cell.getValueWithoutFormat() );
break;
} }
else if ( cellType === CellValueType.Error ) { case CellValueType.Error:{
val = new cError( cell.getValueWithoutFormat() ); val = new cError( cell.getValueWithoutFormat() );
break;
} }
else if ( cellType === CellValueType.String ) { case CellValueType.String:{
val = new cString( cell.getValueWithoutFormat() ); val = new cString( cell.getValueWithoutFormat() );
break;
} }
else { default:{
if ( cell.getValueWithoutFormat() && cell.getValueWithoutFormat() !== "" ) { if ( cell.getValueWithoutFormat() && cell.getValueWithoutFormat() !== "" ) {
val = new cNumber( cell.getValueWithoutFormat() ); val = new cNumber( cell.getValueWithoutFormat() );
} }
...@@ -681,6 +682,7 @@ cArea.prototype.foreach2 = function ( action ) { ...@@ -681,6 +682,7 @@ cArea.prototype.foreach2 = function ( action ) {
} }
} }
} }
}
else { else {
val = new cEmpty(); val = new cEmpty();
} }
...@@ -1043,30 +1045,37 @@ cArea3D.prototype.foreach2 = function ( action ) { ...@@ -1043,30 +1045,37 @@ 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 ){
case CellValueType.Number:{
if ( _cell.getValueWithoutFormat() === "" ) { if ( _cell.getValueWithoutFormat() === "" ) {
val = new cEmpty(); val = new cEmpty();
} }
else { else {
val = new cNumber( _cell.getValueWithoutFormat() ); val = new cNumber( _cell.getValueWithoutFormat() );
} }
break;
} }
else if ( cellType === CellValueType.Bool ) { case CellValueType.Bool:{
val = new cBool( _cell.getValueWithoutFormat() ); val = new cBool( _cell.getValueWithoutFormat() );
break;
} }
else if ( cellType === CellValueType.Error ) { case CellValueType.Error:{
val = new cError( _cell.getValueWithoutFormat() ); val = new cError( _cell.getValueWithoutFormat() );
break;
} }
else if ( cellType === CellValueType.String ) { case CellValueType.String:{
val = new cString( _cell.getValueWithoutFormat() ); val = new cString( _cell.getValueWithoutFormat() );
break;
} }
else { default:{
if ( _cell.getValueWithoutFormat() && _cell.getValueWithoutFormat() !== "" ) { if ( _cell.getValueWithoutFormat() && _cell.getValueWithoutFormat() !== "" ) {
val = new cNumber( _cell.getValueWithoutFormat() ); val = new cNumber( _cell.getValueWithoutFormat() );
} }
else { else {
val = checkTypeCell( "" + _cell.getValueWithoutFormat() ); val = checkTypeCell( "" + _cell.getValueWithoutFormat() );
} }
break;
}
} }
} }
else { else {
......
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