Commit d8e8cedd authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Поправил findCellByXY (добавил параметр canReturnNull, skipCol и skipRow)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57501 954022d7-b5bf-4e40-9824-e11837661b57
parent 1967452c
...@@ -5444,10 +5444,15 @@ ...@@ -5444,10 +5444,15 @@
// ----- Selection ----- // ----- Selection -----
// x,y - абсолютные координаты относительно листа (без учета заголовков) // x,y - абсолютные координаты относительно листа (без учета заголовков)
WorksheetView.prototype.findCellByXY = function (x, y) { WorksheetView.prototype.findCellByXY = function (x, y, canReturnNull, skipCol, skipRow) {
var r = 0, c = 0, tmpRow, tmpCol, result = new CCellObjectInfo(); var r = 0, c = 0, tmpRow, tmpCol, result = new CCellObjectInfo();
if (canReturnNull) {
result.col = result.row = null;
}
x += this.cellsLeft; x += this.cellsLeft;
y += this.cellsTop; y += this.cellsTop;
if (!skipCol) {
while (c < this.cols.length) { while (c < this.cols.length) {
tmpCol = this.cols[c]; tmpCol = this.cols[c];
if (x <= tmpCol.left + tmpCol.width) { if (x <= tmpCol.left + tmpCol.width) {
...@@ -5456,6 +5461,11 @@ ...@@ -5456,6 +5461,11 @@
} }
++c; ++c;
} }
if (null !== result.col)
result.colOff = x - this.cols[result.col].left;
}
if (!skipRow) {
while (r < this.rows.length) { while (r < this.rows.length) {
tmpRow = this.rows[r]; tmpRow = this.rows[r];
if (y <= tmpRow.top + tmpRow.height) { if (y <= tmpRow.top + tmpRow.height) {
...@@ -5465,8 +5475,10 @@ ...@@ -5465,8 +5475,10 @@
++r; ++r;
} }
result.colOff = x - this.cols[result.col].left; if (null !== result.row)
result.rowOff = y - this.rows[result.row].top; result.rowOff = y - this.rows[result.row].top;
}
return result; return result;
}; };
......
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