Commit 4c6efb1d authored by GoshaZotov's avatar GoshaZotov

fix for #32505

[Copy&Paste] Cannot read property 'I' of null при применении Select Data после копирования исходной таблицы, если открыто окно Resize table
parent 5d84250e
...@@ -4720,29 +4720,33 @@ TablePart.prototype.changeRefOnRange = function(range, autoFilters, generateNewT ...@@ -4720,29 +4720,33 @@ TablePart.prototype.changeRefOnRange = function(range, autoFilters, generateNewT
{ {
var newTableColumns = []; var newTableColumns = [];
var intersectionRanges = this.Ref.intersection(range); var intersectionRanges = this.Ref.intersection(range);
for(var i = range.c1; i <= range.c2; i++)
if(null !== intersectionRanges)
{ {
var tableColumn; for(var i = range.c1; i <= range.c2; i++)
if(i >= intersectionRanges.c1 && i <= intersectionRanges.c2)
{ {
var tableIndex = i - this.Ref.c1; var tableColumn;
tableColumn = this.TableColumns[tableIndex]; if(i >= intersectionRanges.c1 && i <= intersectionRanges.c2)
{
var tableIndex = i - this.Ref.c1;
tableColumn = this.TableColumns[tableIndex];
}
else
{
tableColumn = new TableColumn();
}
newTableColumns.push(tableColumn);
} }
else
for(var j = 0; j < newTableColumns.length; j++)
{ {
tableColumn = new TableColumn(); if(newTableColumns[j].Name === null)
newTableColumns[j].Name = autoFilters._generateColumnName2(newTableColumns);
} }
newTableColumns.push(tableColumn); this.TableColumns = newTableColumns;
}
for(var j = 0; j < newTableColumns.length; j++)
{
if(newTableColumns[j].Name === null)
newTableColumns[j].Name = autoFilters._generateColumnName2(newTableColumns);
} }
this.TableColumns = newTableColumns;
} }
this.Ref = Asc.Range(range.c1, range.r1, range.c2, range.r2); this.Ref = Asc.Range(range.c1, range.r1, range.c2, range.r2);
......
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