Commit 2a7c937c authored by GoshaZotov's avatar GoshaZotov

fix bug(add new format table without title into 1 row)

parent c62cd0e0
......@@ -387,6 +387,26 @@
worksheet._moveRange(rangeWithoutDiff, new Asc.Range(filterRange.c1, filterRange.r1 + 1, filterRange.c2, filterRange.r2));
}
}
else if(!addNameColumn)
{
if(filterRange.r1 === filterRange.r2)
{
if(t._isEmptyCellsUnderRange(rangeWithoutDiff))
{
filterRange.r2++;
}
else
{
filterRange.r2++;
//shift down not empty range and move
if(!isTurnOffHistory)
{
worksheet.getRange3(filterRange.r2, filterRange.c1, filterRange.r2, filterRange.c2).addCellsShiftBottom();
}
}
}
}
//add to model
var newTablePart = t._addNewFilter(filterRange, styleName, bWithoutFilter, tablePartDisplayName, pasteStyleObj);
......
......@@ -11342,10 +11342,11 @@
t.handlers.trigger("selectionChanged");
return;
}
var addNameColumn, filterRange;
if (addFormatTableOptionsObj && isChangeAutoFilterToTablePart(addFormatTableOptionsObj) === true)//CHANGE FILTER TO TABLEPART
{
var filterRange = t.model.AutoFilter.Ref.clone();
filterRange = t.model.AutoFilter.Ref.clone();
var addFilterCallBack = function () {
History.Create_NewPoint();
......@@ -11357,7 +11358,7 @@
History.EndTransaction();
};
var addNameColumn = false;
addNameColumn = false;
if (addFormatTableOptionsObj === false) {
addNameColumn = true;
} else if (typeof addFormatTableOptionsObj == 'object') {
......@@ -11370,7 +11371,6 @@
t._isLockedCells(filterRange, /*subType*/null, addFilterCallBack);
} else//ADD
{
var addNameColumn;
var addFilterCallBack = function () {
History.Create_NewPoint();
History.StartTransaction();
......@@ -11390,8 +11390,8 @@
addFilterCallBack();
} else {
var filterInfo = t.model.autoFilters._getFilterInfoByAddTableProps(ar, addFormatTableOptionsObj);
var filterRange = filterInfo.filterRange
var addNameColumn = filterInfo.addNameColumn;
filterRange = filterInfo.filterRange
addNameColumn = filterInfo.addNameColumn;
t._isLockedCells(filterRange, null, addFilterCallBack)
}
......
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