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

fix bug 33468

parent b781237c
...@@ -1259,45 +1259,41 @@ cArea3D.prototype.tocArea = function () { ...@@ -1259,45 +1259,41 @@ cArea3D.prototype.tocArea = function () {
cArea3D.prototype.getWS = function () { cArea3D.prototype.getWS = function () {
return this.wsRange()[0]; return this.wsRange()[0];
}; };
cArea3D.prototype.cross = function ( arg, wsID ) { cArea3D.prototype.cross = function (arg, wsID) {
if ( this.wsFrom !== this.wsTo ) { if (!this.isSingleSheet()) {
return new cError( cErrorType.wrong_value_type ); return new cError(cErrorType.wrong_value_type);
} }
/*if ( this.wsFrom !== wsID ) { /*if ( this.wsFrom !== wsID ) {
return new cError( cErrorType.wrong_value_type ); return new cError( cErrorType.wrong_value_type );
}*/ }*/
var r = this.getRange(); var r = this.getRange();
if ( !r ) { if (!r) {
return new cError( cErrorType.wrong_name ); return new cError(cErrorType.wrong_name);
} }
var cross = r[0].cross( arg ); var cross = r.cross(arg);
if ( cross ) { if (cross) {
if ( cross.r != undefined ) { if (cross.r != undefined) {
return this.getValue2( new CellAddress( cross.r, this.getBBox().c1 ) ); return this.getValue2(new CellAddress(cross.r, this.getBBox().c1));
} else if (cross.c != undefined) { } else if (cross.c != undefined) {
return this.getValue2( new CellAddress( this.getBBox().r1, cross.c ) ); return this.getValue2(new CellAddress(this.getBBox().r1, cross.c));
} else { } else {
return new cError( cErrorType.wrong_value_type ); return new cError(cErrorType.wrong_value_type);
} }
} else { } else {
return new cError( cErrorType.wrong_value_type ); return new cError(cErrorType.wrong_value_type);
} }
}; };
cArea3D.prototype.getBBox = function () { cArea3D.prototype.getBBox = function () {
return this.getRange()[0].getBBox(); var range = this.getRange();
}; return range ? range.getBBox() : range;
cArea3D.prototype.getBBox0 = function () { };
return this.getRange()[0].getBBox0(); cArea3D.prototype.getBBox0 = function () {
}; var range = this.getRange();
cArea3D.prototype.isValid = function () { return range ? range.getBBox0() : range;
var r = this.getRange(); };
for ( var i = 0; i < r.length; i++ ) { cArea3D.prototype.isValid = function () {
if ( !r[i] ) { return !!this.getRange();
return false; };
}
}
return true;
};
cArea3D.prototype.countCells = function () { cArea3D.prototype.countCells = function () {
var _wsA = this.wsRange(); var _wsA = this.wsRange();
var _val = []; var _val = [];
...@@ -1354,7 +1350,7 @@ cArea3D.prototype.isValid = function () { ...@@ -1354,7 +1350,7 @@ cArea3D.prototype.isValid = function () {
} }
}; };
cArea3D.prototype.isSingleSheet = function () { cArea3D.prototype.isSingleSheet = function () {
return this.wsFrom == this.wsTo; return this.wsFrom === this.wsTo;
}; };
/** @constructor */ /** @constructor */
......
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