Commit 5c8e5e25 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

fix bug #31170

Если выделено несколько строк/столбцов с разными высотой/шириной, то ничего не показывать в данных

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66994 954022d7-b5bf-4e40-9824-e11837661b57
parent 48bf8def
......@@ -1933,7 +1933,7 @@ var editor;
spreadsheet_api.prototype.asc_getColumnWidth = function() {
var ws = this.wb.getWorksheet();
return ws.getColumnWidthInSymbols(ws.getSelectedColumnIndex());
return ws.getSelectedColumnWidthInSymbols();
};
spreadsheet_api.prototype.asc_setColumnWidth = function(width) {
......@@ -1950,7 +1950,7 @@ var editor;
spreadsheet_api.prototype.asc_getRowHeight = function() {
var ws = this.wb.getWorksheet();
return ws.getRowHeight(ws.getSelectedRowIndex(), 1/*pt*/, /*isHeightReal*/true);
return ws.getSelectedRowHeight();
};
spreadsheet_api.prototype.asc_setRowHeight = function(height) {
......
......@@ -513,18 +513,36 @@
return null;
};
WorksheetView.prototype.getColumnWidthInSymbols = function (index) {
if (index >= 0 && index < this.cols.length) {
return this.cols[index].charCount;
}
return null;
WorksheetView.prototype.getSelectedColumnWidthInSymbols = function () {
var c, res = null;
for (c = this.activeRange.c1; c <= this.activeRange.c2 && c < this.cols.length; ++c) {
if (null === res) {
res = this.cols[c].charCount;
} else if (res !== this.cols[c].charCount) {
return null;
}
}
// ToDo сравнить с default для проверки выделения всего
return res;
};
WorksheetView.prototype.getRowHeight = function (index, units, isHeightReal) {
WorksheetView.prototype.getSelectedRowHeight = function () {
var r, res = null;
for (r = this.activeRange.r1; r <= this.activeRange.r2 && r < this.rows.length; ++r) {
if (null === res) {
res = this.rows[r].heightReal;
} else if (res !== this.rows[r].heightReal) {
return null;
}
}
// ToDo сравнить с default для проверки выделения всего
return res;
};
WorksheetView.prototype.getRowHeight = function (index, units) {
if (index >= 0 && index < this.rows.length) {
var u = units >= 0 && units <= 3 ? units : 0;
var h = isHeightReal ? this.rows[index].heightReal : this.rows[index].height;
return h * asc_getcvt(1/*pt*/, u, this._getPPIY());
return this.rows[index].height * asc_getcvt(1/*pt*/, u, this._getPPIY());
}
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