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

исправлено падение при перемещении диапазона вида A:A, 1:1;

поправлено получение range при сборке формул.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56139 954022d7-b5bf-4e40-9824-e11837661b57
parent a88cd60e
......@@ -134,6 +134,15 @@ Math.fact = function ( n ) {
return res;
};
Math.factor = function ( n ) {
var res = 1;
n = this.floor( n );
while ( n !== 0 ) {
res = res * n--;
}
return res;
};
Math.ln = Math.log;
Math.log10 = function ( x ) {
......@@ -436,8 +445,8 @@ function cArea( val, ws ) {/*Area means "A1:E5" for example*/
this._cells = val;
this.isAbsolute = false;
this.type = cElementType.cellsRange;
// this.range = this.wb.getWorksheetById(this.ws).getRange2(val);
// this._valid = this.range ? true : false;
this.range = null;
// this._valid = this.range ? true : false;
}
cArea.prototype = Object.create( cBaseType.prototype );
......@@ -529,7 +538,10 @@ cArea.prototype.getValue2 = function ( cell ) {
}
};
cArea.prototype.getRange = function () {
return this.ws.getRange2( this._cells );
if( !this.range ){
this.range = this.ws.getRange2( this._cells )
}
return this.range;
};
cArea.prototype.tocNumber = function () {
return this.getValue()[0].tocNumber();
......@@ -541,8 +553,7 @@ cArea.prototype.tocBool = function () {
return this.getValue()[0].tocBool();
};
cArea.prototype.toString = function () {
// return this.getRange().getName();
return this._cells;
return this.getRange().getName();
};
cArea.prototype.setRange = function ( cell ) {
this._cells = this.value = cell;
......@@ -836,14 +847,15 @@ cArea3D.prototype.changeSheet = function ( lastName, newName ) {
cArea3D.prototype.toString = function () {
var wsFrom = this._wb.getWorksheetById( this.wsFrom ).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 ) ) {
name = Asc.g_oRangeCache.getActiveRange(this._cells).getName();
if ( rx_test_ws_name.test( wsFrom ) && rx_test_ws_name.test( wsTo ) ) {
return (wsFrom !== wsTo ? wsFrom + ":" + wsTo : wsFrom) + "!" + name;
}
else{
wsFrom = wsFrom.replace( /'/g, "''" );
wsTo = wsTo.replace( /'/g, "''" );
return "'" + (wsFrom !== wsTo ? wsFrom + ":" + wsTo : wsFrom) + "'!" + name;
}
return (wsFrom !== wsTo ? wsFrom + ":" + wsTo : wsFrom) + "!" + name;
};
cArea3D.prototype.tocNumber = function () {
return this.getValue()[0].tocNumber();
......@@ -1190,11 +1202,11 @@ cRef3D.prototype.changeSheet = function ( lastName, newName ) {
};
cRef3D.prototype.toString = function () {
var wsName = this.ws.getName();
if ( !rx_test_ws_name.test( wsName ) ) {
return "'" + wsName.replace( /'/g, "''" ) + "'" + "!" + this._cells;
if ( rx_test_ws_name.test( wsName ) ) {
return wsName + "!" + this._cells;
}
else {
return wsName + "!" + this._cells;
return "'" + wsName.replace( /'/g, "''" ) + "'" + "!" + this._cells;
}
};
cRef3D.prototype.getWS = function () {
......
......@@ -7437,8 +7437,8 @@
}
} else {
this.startCellMoveResizeRange.normalize();
var colDelta = colByX - this.startCellMoveResizeRange2.c1;
var rowDelta = rowByY - this.startCellMoveResizeRange2.r1;
var colDelta = this.startCellMoveResizeRange.type != c_oAscSelectionType.RangeRow && this.startCellMoveResizeRange.type != c_oAscSelectionType.RangeMax ? colByX - this.startCellMoveResizeRange2.c1 : 0;
var rowDelta = this.startCellMoveResizeRange.type != c_oAscSelectionType.RangeCol && this.startCellMoveResizeRange.type != c_oAscSelectionType.RangeMax ? rowByY - this.startCellMoveResizeRange2.r1 : 0;
ar.c1 = this.startCellMoveResizeRange.c1 + colDelta;
if (0 > ar.c1) {
......
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