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

fix bug #31113

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66862 954022d7-b5bf-4e40-9824-e11837661b57
parent 22b91ba1
......@@ -351,6 +351,9 @@ function fSortAscending( a, b ) {
function fSortDescending( a, b ) {
return b - a;
}
function fOnlyUnique(value, index, self) {
return self.indexOf(value) === index;
}
function isLeadingSurrogateChar(nCharCode) {
return (nCharCode >= 0xD800 && nCharCode <= 0xDFFF);
}
......
......@@ -705,16 +705,15 @@
// Проверяет, есть ли числовые значения в диапазоне
WorksheetView.prototype._hasNumberValueInActiveRange = function () {
var cell, cellType, isNumberFormat;
var result = null;
var cell, cellType, isNumberFormat, arrCols = null, arrRows = null;
if (this._rangeIsSingleCell(this.activeRange)) {
// Для одной ячейки не стоит ничего делать
return result;
return null;
}
var mergedRange = this.model.getMergedByCell(this.activeRange.r1, this.activeRange.c1);
if (mergedRange && mergedRange.isEqual(this.activeRange)) {
// Для одной ячейки не стоит ничего делать
return result;
return null;
}
for (var c = this.activeRange.c1; c <= this.activeRange.c2; ++c) {
......@@ -725,25 +724,24 @@
cellType = cell.cellType;
isNumberFormat = (null == cellType || CellValueType.Number === cellType);
if (isNumberFormat) {
if (null === result) {
result = {};
result.arrCols = [];
result.arrRows = [];
if (!arrCols) {
arrCols = [];
arrRows = [];
}
result.arrCols.push(c);
result.arrRows.push(r);
arrCols.push(c);
arrRows.push(r);
}
}
}
}
if (null !== result) {
if (arrCols) {
// Делаем массивы уникальными и сортируем
$.unique(result.arrCols);
$.unique(result.arrRows);
result.arrCols = result.arrCols.sort(fSortAscending);
result.arrRows = result.arrRows.sort(fSortAscending);
}
return result;
arrCols = arrCols.filter(fOnlyUnique);
arrRows = arrRows.filter(fOnlyUnique);
return {arrCols: arrCols.sort(fSortAscending), arrRows: arrRows.sort(fSortAscending)};
} else {
return null;
}
};
// Автодополняет формулу диапазоном, если это возможно
......
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