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,21 +10897,35 @@ ...@@ -10897,21 +10897,35 @@
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);
for (r = 0; r < maxRows; ++r) {
row = [];
for (c = 0; c < maxCols; ++c) {
cell = this.model._getCellNoEmpty(r, c);
if (cell && '' !== (val = cell.getValue())) {
lastC = Math.max(lastC, c);
lastR = Math.max(lastR, r);
} else {
val = '';
}
row.push(val);
}
arrCells.push(row);
}
for (r = 0; r < maxRows; ++r) { arrResult = arrCells.slice(0, lastR + 1);
row = []; ++lastC;
for (c = 0; c < maxCols; ++c) { if (lastC < maxCols) {
cell = this.model._getCellNoEmpty(r, c); for (r = 0; r < arrResult.length; ++r) {
row.push(cell ? cell.getValue() : ''); arrResult[r] = arrResult[r].slice(0, lastC);
} }
arrResult.push(row); }
} return arrResult;
return arrResult; };
};
/* /*
* Export * Export
......
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