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

добавлены функции: BIN2DEC, BIN2HEX, BIN2OCT, DEC2BIN, DEC2HEX, DEC2OCT,...

добавлены функции: BIN2DEC, BIN2HEX, BIN2OCT, DEC2BIN, DEC2HEX, DEC2OCT, HEX2BIN, HEX2DEC, HEX2OCT, OCT2BIN, OCT2DEC, OCT2HEX
fix: Bug 24099 - [XLSX] Ошибка в консоли 'ho' при открытии таблицы

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56085 954022d7-b5bf-4e40-9824-e11837661b57
parent 8a82c85b
This diff is collapsed.
...@@ -163,6 +163,14 @@ Math.sign = function(a){ ...@@ -163,6 +163,14 @@ Math.sign = function(a){
return (a < 0) ? -1 : (a == 0) ? 0 : 1; return (a < 0) ? -1 : (a == 0) ? 0 : 1;
} }
String.prototype.repeat = function (s, n){
var a = [];
while(a.length < n){
a.push(s);
}
return a.join('');
}
/** @constructor */ /** @constructor */
function cBaseType( val ) { function cBaseType( val ) {
this.needRecalc = false; this.needRecalc = false;
...@@ -451,25 +459,30 @@ cArea.prototype.getValue = function () { ...@@ -451,25 +459,30 @@ cArea.prototype.getValue = function () {
else { else {
r._foreachNoEmpty( function ( cell ) { r._foreachNoEmpty( function ( cell ) {
var cellType = cell.getType(); var cellType = cell.getType();
if ( cellType === CellValueType.Number ) { switch ( cellType ) {
cell.getValueWithoutFormat() === "" ? val.push( new cEmpty() ) : val.push( new cNumber( cell.getValueWithoutFormat() ) ); case CellValueType.Number:
} cell.getValueWithoutFormat() === "" ? val.push( new cEmpty() ) : val.push( new cNumber( cell.getValueWithoutFormat() ) );
else if ( cellType === CellValueType.Bool ) { break;
val.push( new cBool( cell.getValueWithoutFormat() ) );
} case CellValueType.Bool:
else if ( cellType === CellValueType.Error ) { val.push( new cBool( cell.getValueWithoutFormat() ) );
val.push( new cError( cell.getValueWithoutFormat() ) ); break;
}
else if ( cellType === CellValueType.String ) { case CellValueType.Error:
val.push( checkTypeCell( "" + cell.getValueWithoutFormat() ) ); val.push( new cError( cell.getValueWithoutFormat() ) );
} break;
else {
if ( cell.getValueWithoutFormat() && cell.getValueWithoutFormat() !== "" ) { case CellValueType.String:
val.push( new cNumber( cell.getValueWithoutFormat() ) );
}
else {
val.push( checkTypeCell( "" + cell.getValueWithoutFormat() ) ); val.push( checkTypeCell( "" + cell.getValueWithoutFormat() ) );
} break;
default:
if ( cell.getValueWithoutFormat() && cell.getValueWithoutFormat() !== "" ) {
val.push( new cNumber( cell.getValueWithoutFormat() ) );
}
else {
val.push( checkTypeCell( "" + cell.getValueWithoutFormat() ) );
}
} }
} ); } );
} }
...@@ -528,6 +541,7 @@ cArea.prototype.tocBool = function () { ...@@ -528,6 +541,7 @@ cArea.prototype.tocBool = function () {
return this.getValue()[0].tocBool(); return this.getValue()[0].tocBool();
}; };
cArea.prototype.toString = function () { cArea.prototype.toString = function () {
// return this.getRange().getName();
return this._cells; return this._cells;
}; };
cArea.prototype.setRange = function ( cell ) { cArea.prototype.setRange = function ( cell ) {
...@@ -820,14 +834,16 @@ cArea3D.prototype.changeSheet = function ( lastName, newName ) { ...@@ -820,14 +834,16 @@ cArea3D.prototype.changeSheet = function ( lastName, newName ) {
} }
}; };
cArea3D.prototype.toString = function () { cArea3D.prototype.toString = function () {
var wsFrom = this._wb.getWorksheetById( this.wsFrom ).getName(); var wsFrom = this._wb.getWorksheetById( this.wsFrom ).getName(),
var wsTo = this._wb.getWorksheetById( this.wsTo ).getName(); wsTo = this._wb.getWorksheetById( this.wsTo ).getName(),
// name = Asc.g_oRangeCache.getActiveRange(this._cells ).getName();
name = this._cells;
if ( !rx_test_ws_name.test( wsFrom ) || !rx_test_ws_name.test( wsTo ) ) { if ( !rx_test_ws_name.test( wsFrom ) || !rx_test_ws_name.test( wsTo ) ) {
wsFrom = wsFrom.replace( /'/g, "''" ); wsFrom = wsFrom.replace( /'/g, "''" );
wsTo = wsTo.replace( /'/g, "''" ); wsTo = wsTo.replace( /'/g, "''" );
return "'" + (wsFrom !== wsTo ? wsFrom + ":" + wsTo : wsFrom) + "'!" + this._cells; return "'" + (wsFrom !== wsTo ? wsFrom + ":" + wsTo : wsFrom) + "'!" + name;
} }
return (wsFrom !== wsTo ? wsFrom + ":" + wsTo : wsFrom) + "!" + this._cells; return (wsFrom !== wsTo ? wsFrom + ":" + wsTo : wsFrom) + "!" + name;
}; };
cArea3D.prototype.tocNumber = function () { cArea3D.prototype.tocNumber = function () {
return this.getValue()[0].tocNumber(); return this.getValue()[0].tocNumber();
...@@ -1490,13 +1506,13 @@ cBaseOperator.prototype = { ...@@ -1490,13 +1506,13 @@ cBaseOperator.prototype = {
}; };
/** @constructor */ /** @constructor */
function cBaseFunction( name ) { function cBaseFunction( name, argMin, argMax ) {
this.name = name; this.name = name;
this.type = cElementType.func; this.type = cElementType.func;
this.value = null; this.value = null;
this.argumentsMin = 0; this.argumentsMin = argMin ? argMin : 0;
this.argumentsCurrent = 0; this.argumentsCurrent = 0;
this.argumentsMax = 255; this.argumentsMax = argMax ? argMax : 255;
this.formatType = { this.formatType = {
def:-1, //подразумевается формат первой ячейки входящей в формулу. def:-1, //подразумевается формат первой ячейки входящей в формулу.
noneFormat:-2 noneFormat:-2
...@@ -3138,6 +3154,7 @@ parserFormula.prototype = { ...@@ -3138,6 +3154,7 @@ parserFormula.prototype = {
if ( found_operand != null && found_operand != undefined ) { if ( found_operand != null && found_operand != undefined ) {
this.outStack.push( found_operand ); this.outStack.push( found_operand );
operand_expected = false; operand_expected = false;
found_operand = null
} }
else { else {
/*this.error.push( c_oAscError.ID.FrmlAnotherParsingError ); /*this.error.push( c_oAscError.ID.FrmlAnotherParsingError );
......
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