Commit 5a830809 authored by Alexander.Trofimov's avatar Alexander.Trofimov

Возвращаем только не пустые данные для getData

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@65971 954022d7-b5bf-4e40-9824-e11837661b57
parent 25474cd0
...@@ -10897,8 +10897,8 @@ ...@@ -10897,8 +10897,8 @@
History.TurnOn(); History.TurnOn();
this._updateCellsRange(oAllRange.bbox); // ToDo Стоит обновить nRowsCount и nColsCount this._updateCellsRange(oAllRange.bbox); // ToDo Стоит обновить nRowsCount и nColsCount
}; };
WorksheetView.prototype.getData = function () { WorksheetView.prototype.getData = function() {
var arrResult = [], cell, c, r, row; var arrResult, arrCells = [], cell, c, r, row, lastC = -1, lastR = -1, val;
var maxCols = Math.min(this.model.getColsCount(), gc_nMaxCol); var maxCols = Math.min(this.model.getColsCount(), gc_nMaxCol);
var maxRows = Math.min(this.model.getRowsCount(), gc_nMaxRow); var maxRows = Math.min(this.model.getRowsCount(), gc_nMaxRow);
...@@ -10906,9 +10906,23 @@ ...@@ -10906,9 +10906,23 @@
row = []; row = [];
for (c = 0; c < maxCols; ++c) { for (c = 0; c < maxCols; ++c) {
cell = this.model._getCellNoEmpty(r, c); cell = this.model._getCellNoEmpty(r, c);
row.push(cell ? cell.getValue() : ''); if (cell && '' !== (val = cell.getValue())) {
lastC = Math.max(lastC, c);
lastR = Math.max(lastR, r);
} else {
val = '';
}
row.push(val);
}
arrCells.push(row);
}
arrResult = arrCells.slice(0, lastR + 1);
++lastC;
if (lastC < maxCols) {
for (r = 0; r < arrResult.length; ++r) {
arrResult[r] = arrResult[r].slice(0, lastC);
} }
arrResult.push(row);
} }
return arrResult; return arrResult;
}; };
......
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