Commit eb49d984 authored by Alexander.Trofimov's avatar Alexander.Trofimov

add function checkTypeCell2 (for existing cell values)

parent a136a5c0
...@@ -1945,6 +1945,25 @@ function checkTypeCell( val ) { ...@@ -1945,6 +1945,25 @@ function checkTypeCell( val ) {
} }
} }
// ToDo перевести на эту функцию все формулы...
function checkTypeCell2(cell) {
if (cell) {
var val = cell.getValueWithoutFormat();
var type = cell.getType();
if (CellValueType.Number === type) {
return new cNumber(val - 0);
} else if (CellValueType.Bool === type) {
return new cBool(val);
} else if (CellValueType.Error === type) {
return new cError(val);
} else {
return new cString(val);
}
} else {
return new cEmpty();
}
}
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/*Base classes for operators & functions */ /*Base classes for operators & functions */
/** @constructor */ /** @constructor */
...@@ -5104,6 +5123,7 @@ function rtl_math_erfc( x ) { ...@@ -5104,6 +5123,7 @@ function rtl_math_erfc( x ) {
window['AscCommonExcel'].cBaseFunction = cBaseFunction; window['AscCommonExcel'].cBaseFunction = cBaseFunction;
window['AscCommonExcel'].checkTypeCell = checkTypeCell; window['AscCommonExcel'].checkTypeCell = checkTypeCell;
window['AscCommonExcel'].checkTypeCell2 = checkTypeCell2;
window['AscCommonExcel'].cFormulaFunctionGroup = cFormulaFunctionGroup; window['AscCommonExcel'].cFormulaFunctionGroup = cFormulaFunctionGroup;
window['AscCommonExcel'].cFormulaFunction = cFormulaFunction; window['AscCommonExcel'].cFormulaFunction = cFormulaFunction;
......
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