Commit 40de021f authored by GoshaZotov's avatar GoshaZotov

fix bug 33008

parent a10aca4d
......@@ -2104,6 +2104,43 @@
return isUpdate ? range : null;
},
afterMoveAutoFilters: function(arnFrom, arnTo)
{
//если переносим часть ф/т, применяем стиль к ячейкам arnTo
//todo пересмотреть перенос ячеек из ф/т. скорее всего нужно будет внести правки со стилями внутри moveRange
var worksheet = this.worksheet;
var intersectionRangeWithTablePartsFrom = this._intersectionRangeWithTableParts(arnFrom);
var intersectionRangeWithTablePartsTo = this._intersectionRangeWithTableParts(arnTo);
if(intersectionRangeWithTablePartsFrom && intersectionRangeWithTablePartsFrom.length === 1 && intersectionRangeWithTablePartsTo === false)
{
var refTable = intersectionRangeWithTablePartsFrom[0] ? intersectionRangeWithTablePartsFrom[0].Ref : null;
if(refTable && !arnFrom.containsRange(refTable))
{
var intersection = refTable.intersection(arnFrom);
//проходимся по всем ячейкам
var cell, cellTo;
var diffRow = arnTo.r1 - arnFrom.r1;
var diffCol = arnTo.c1 - arnFrom.c1;
for(var i = intersection.r1; i <= intersection.r2; i++)
{
for(var j = intersection.c1; j <= intersection.c2; j++)
{
cell = worksheet._getCell(i, j);
cellTo = worksheet._getCell(i + diffRow, j + diffCol);
var xfsTo = cellTo.getCompiledStyle();
if(null === xfsTo)
{
var xfsFrom = cell.getCompiledStyle();
cellTo.setStyle(xfsFrom);
}
}
}
}
}
},
//if active range intersect even a part tablePart(for insert(delete) cells)
isActiveCellsCrossHalfFTable: function(activeCells, val, prop)
{
......@@ -4472,8 +4509,6 @@
var diffCol = arnTo.c1 - arnFrom.c1;
var diffRow = arnTo.r1 - arnFrom.r1;
var applyStyleByCells = true;
if(!copyRange)
{
var findFilters = this._searchFiltersInRange(arnFrom);
......@@ -4500,7 +4535,6 @@
this._openHiddenRows(findFilters[i]);
}
applyStyleByCells = false;
}
//TODO пока будем всегда чистить фильтры, которые будут в месте вставки. Позже сделать аналогично MS либо пересмотреть все возможные ситуации.
......@@ -4515,26 +4549,6 @@
if(!(arnTo.r1 === ref.r1 && arnTo.c1 === ref.c1) && !arnFrom.containsRange(ref))
this.isEmptyAutoFilters(ref, null, findFilters);
}
applyStyleByCells = false;
}
}
if(applyStyleByCells)
{
var intersectionRangeWithTablePartsFrom = this._intersectionRangeWithTableParts(arnFrom);
var intersectionRangeWithTablePartsTo = this._intersectionRangeWithTableParts(arnTo);
if(intersectionRangeWithTablePartsFrom && intersectionRangeWithTablePartsFrom.length === 1 && intersectionRangeWithTablePartsTo === false)
{
//проходимся по всем ячейкам
var cell;
for(var i = arnFrom.r1; i <= arnFrom.r2; i++)
{
for(var j = arnFrom.c1; j <= arnFrom.c2; j++)
{
cell = worksheet._getCell(i, j);
cell.setStyle(cell.compiledXfs);
}
}
}
}
},
......
......@@ -8819,6 +8819,8 @@
t.model.autoFilters.renameTableColumn( arnFrom );
t.model.autoFilters.renameTableColumn( arnTo );
t.model.autoFilters.reDrawFilter( arnFrom );
t.model.autoFilters.afterMoveAutoFilters( arnFrom, arnTo );
History.EndTransaction();
......
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