[SSE] For Bug 55011

This commit is contained in:
Julia Radzhabova 2022-01-21 14:24:55 +03:00
parent 931ad0b7ec
commit 1ae9e9eb62

View file

@ -484,16 +484,18 @@ define([
if (this.type == Common.Utils.importTextType.CSV || this.type == Common.Utils.importTextType.Paste || this.type == Common.Utils.importTextType.Columns || this.type == Common.Utils.importTextType.Data) { if (this.type == Common.Utils.importTextType.CSV || this.type == Common.Utils.importTextType.Paste || this.type == Common.Utils.importTextType.Columns || this.type == Common.Utils.importTextType.Data) {
var maxlength = 0; var maxlength = 0;
for (var i=0; i<data.length; i++) { for (var i=0; i<data.length; i++) {
if (data[i].length>maxlength) var str = data[i] || '';
maxlength = data[i].length; if (str.length>maxlength)
maxlength = str.length;
} }
var tpl = '<table>'; var tpl = '<table>';
for (var i=0; i<data.length; i++) { for (var i=0; i<data.length; i++) {
var str = data[i] || '';
tpl += '<tr style="vertical-align: top;">'; tpl += '<tr style="vertical-align: top;">';
for (var j=0; j<data[i].length; j++) { for (var j=0; j<str.length; j++) {
tpl += '<td>' + Common.Utils.String.htmlEncode(data[i][j]) + '</td>'; tpl += '<td>' + Common.Utils.String.htmlEncode(str[j]) + '</td>';
} }
for (j=data[i].length; j<maxlength; j++) { for (j=str.length; j<maxlength; j++) {
tpl += '<td></td>'; tpl += '<td></td>';
} }
tpl += '</tr>'; tpl += '</tr>';
@ -502,7 +504,8 @@ define([
} else { } else {
var tpl = '<table>'; var tpl = '<table>';
for (var i=0; i<data.length; i++) { for (var i=0; i<data.length; i++) {
tpl += '<tr style="vertical-align: top;"><td>' + Common.Utils.String.htmlEncode(data[i]) + '</td></tr>'; var str = data[i] || '';
tpl += '<tr style="vertical-align: top;"><td>' + Common.Utils.String.htmlEncode(str) + '</td></tr>';
} }
tpl += '</table>'; tpl += '</table>';
} }