Commit 2cb40a6b authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Переделал findCell

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56745 954022d7-b5bf-4e40-9824-e11837661b57
parent e901b11b
...@@ -10139,34 +10139,8 @@ ...@@ -10139,34 +10139,8 @@
}; };
WorksheetView.prototype.findCell = function (reference) { WorksheetView.prototype.findCell = function (reference) {
var t = this; var range = asc.g_oRangeCache.getAscRange(reference);
var match = (/(?:R(\d+)C(\d+)|([A-Z]+[0-9]+))(?::(?:R(\d+)C(\d+)|([A-Z]+[0-9]+)))?/i).exec(reference); return range ? this.setSelection(range, true) : null;
if (!match) {return null;}
function _findCell(match1, match2, match3) {
var addr = typeof match1 === "string" ?
new CellAddress(parseInt(match1), parseInt(match2)) :
typeof match3 === "string" ? new CellAddress(match3) : null;
if (addr && addr.isValid() && addr.getRow0() >= t.rows.length) {
t.nRowsCount = addr.getRow0() + 1;
t._calcRowHeights(/*fullRecalc*/2);
}
if (addr && addr.isValid() && addr.getCol0() >= t.cols.length) {
t.nColsCount = addr.getCol0() + 1;
t._calcColumnWidths(/*fullRecalc*/2);
}
return addr && addr.isValid() ? addr : null;
}
var addr1 = _findCell(match[1], match[2], match[3]);
var addr2 = _findCell(match[4], match[5], match[6]);
if (!addr1 && !addr2) {
return {};
}
var delta = t._setActiveCell(addr1.getCol0(), addr1.getRow0());
return !addr2 ? delta :
t.changeSelectionEndPoint(addr2.getCol0() - addr1.getCol0(), addr2.getRow0() - addr1.getRow0(),
/*isCoord*/false, /*isSelectMode*/false);
}; };
/* Ищет дополнение для ячейки */ /* Ищет дополнение для ячейки */
......
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