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 @@
History.TurnOn();
this._updateCellsRange(oAllRange.bbox); // ToDo Стоит обновить nRowsCount и nColsCount
};
WorksheetView.prototype.getData = function () {
var arrResult = [], cell, c, r, row;
var maxCols = Math.min(this.model.getColsCount(), gc_nMaxCol);
var maxRows = Math.min(this.model.getRowsCount(), gc_nMaxRow);
WorksheetView.prototype.getData = function() {
var arrResult, arrCells = [], cell, c, r, row, lastC = -1, lastR = -1, val;
var maxCols = Math.min(this.model.getColsCount(), gc_nMaxCol);
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) {
row = [];
for (c = 0; c < maxCols; ++c) {
cell = this.model._getCellNoEmpty(r, c);
row.push(cell ? cell.getValue() : '');
}
arrResult.push(row);
}
return arrResult;
};
arrResult = arrCells.slice(0, lastR + 1);
++lastC;
if (lastC < maxCols) {
for (r = 0; r < arrResult.length; ++r) {
arrResult[r] = arrResult[r].slice(0, lastC);
}
}
return arrResult;
};
/*
* 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