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

delete getBBox function. Use getBBox0.

cross return 0-base index
parent b5144379
......@@ -1016,9 +1016,6 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
cArea.prototype.getWS = function () {
return this.ws;
};
cArea.prototype.getBBox = function () {
return this.getRange().getBBox();
};
cArea.prototype.getBBox0 = function () {
return this.getRange().getBBox0();
};
......@@ -1029,10 +1026,10 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
}
cross = r.cross(arg);
if (cross) {
if (cross.r != undefined) {
return this.getValue2(cross.r - this.getBBox().r1, 0);
} else if (cross.c != undefined) {
return this.getValue2(0, cross.c - this.getBBox().c1);
if (undefined !== cross.r) {
return this.getValue2(cross.r - this.getBBox0().r1, 0);
} else if (undefined !== cross.c) {
return this.getValue2(0, cross.c - this.getBBox0().c1);
}
}
return new cError(cErrorType.wrong_value_type);
......@@ -1270,20 +1267,13 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
}
var cross = r.cross(arg);
if (cross) {
if (cross.r != undefined) {
return this.getValue2(new CellAddress(cross.r, this.getBBox().c1));
} else if (cross.c != undefined) {
return this.getValue2(new CellAddress(this.getBBox().r1, cross.c));
} else {
return new cError(cErrorType.wrong_value_type);
if (undefined !== cross.r) {
return this.getValue2(new CellAddress(cross.r, this.getBBox0().c1));
} else if (undefined !== cross.c) {
return this.getValue2(new CellAddress(this.getBBox0().r1, cross.c));
}
} else {
return new cError(cErrorType.wrong_value_type);
}
};
cArea3D.prototype.getBBox = function () {
var range = this.getRange();
return range ? range.getBBox() : range;
return new cError(cErrorType.wrong_value_type);
};
cArea3D.prototype.getBBox0 = function () {
var range = this.getRange();
......
......@@ -5746,11 +5746,10 @@ Range.prototype._foreachNoEmpty=function(action, excludeHiddenRows){
cell.nRow <= this.bbox.r2 && cell.nCol <= this.bbox.c2;
};
Range.prototype.cross = function(bbox){
if( bbox.r1 >= this.bbox.r1 && bbox.r1 <= this.bbox.r2 && this.bbox.c1 == this.bbox.c2)
return {r:bbox.r1 + 1};
return {r:bbox.r1};
if( bbox.c1 >= this.bbox.c1 && bbox.c1 <= this.bbox.c2 && this.bbox.r1 == this.bbox.r2)
return {c:bbox.c1 + 1};
return {c:bbox.c1};
return undefined;
};
......@@ -5767,10 +5766,6 @@ Range.prototype._foreachNoEmpty=function(action, excludeHiddenRows){
var oBBox = this.bbox;
return oBBox.r1 == oBBox.r2 && oBBox.c1 == oBBox.c2;
};
Range.prototype.getBBox=function(){
//1 - based
return {r1: this.bbox.r1 + 1, r2: this.bbox.r2 + 1, c1: this.bbox.c1 + 1, c2: this.bbox.c2 + 1};
};
Range.prototype.getBBox0=function(){
//0 - based
return this.bbox;
......
......@@ -5050,8 +5050,8 @@
apl: _t1.left + _t1.width / 4
};
} else {
var _t1 = gCM(_wsV, me[id].getBBox().c1, me[id].getBBox().r1), _t2 = gCM(_wsV, me[id].getBBox().c2,
me[id].getBBox().r2);
var _t1 = gCM(_wsV, me[id].getBBox0().c1, me[id].getBBox0().r1), _t2 = gCM(_wsV, me[id].getBBox0().c2,
me[id].getBBox0().r2);
nodeCellMetrics = {
t: _t1.top,
......
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