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,29 +5444,41 @@
// ----- Selection -----
// 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();
if (canReturnNull) {
result.col = result.row = null;
}
x += this.cellsLeft;
y += this.cellsTop;
while (c < this.cols.length) {
tmpCol = this.cols[c];
if (x <= tmpCol.left + tmpCol.width) {
result.col = c;
break;
if (!skipCol) {
while (c < this.cols.length) {
tmpCol = this.cols[c];
if (x <= tmpCol.left + tmpCol.width) {
result.col = c;
break;
}
++c;
}
++c;
if (null !== result.col)
result.colOff = x - this.cols[result.col].left;
}
while (r < this.rows.length) {
tmpRow = this.rows[r];
if (y <= tmpRow.top + tmpRow.height) {
result.row = r;
break;
if (!skipRow) {
while (r < this.rows.length) {
tmpRow = this.rows[r];
if (y <= tmpRow.top + tmpRow.height) {
result.row = r;
break;
}
++r;
}
++r;
if (null !== result.row)
result.rowOff = y - this.rows[result.row].top;
}
result.colOff = x - this.cols[result.col].left;
result.rowOff = y - this.rows[result.row].top;
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