Commit b57ab056 authored by GoshaZotov's avatar GoshaZotov

fix bug 32654

parent 73ea8818
......@@ -5336,6 +5336,26 @@ TableColumn.prototype.getTotalRowFormula = function(tablePart){
return res;
};
TableColumn.prototype.cleanTotalsData = function(){
this.CalculatedColumnFormula = null;
this.TotalsRowFormula = null;
this.TotalsRowFunction = null;
this.TotalsRowLabel = null;
};
TableColumn.prototype.setTotalsRowFormula = function(val){
this.cleanTotalsData();
this.TotalsRowFormula = val.substring(1);
this.TotalsRowFunction = Asc.ETotalsRowFunction.totalrowfunctionCustom;
};
TableColumn.prototype.setTotalsRowLabel = function(val){
this.cleanTotalsData();
this.TotalsRowLabel = val;
};
/** @constructor */
function TableStyleInfo() {
this.Name = null;
......
......@@ -2755,14 +2755,10 @@
var ref = filter.Ref;
var tableRange = new Asc.Range(ref.c1, ref.r1, ref.c2, ref.r1);
if(filter.HeaderRowCount === 0)
{
continue;
}
//в этом случае нашли ячейки(ячейку), которая входит в состав заголовка фильтра
var intersection = range.intersection(tableRange);
if(intersection != null)
if(null !== intersection && 0 !== filter.HeaderRowCount)
{
//проходимся по всем заголовкам
for(var j = tableRange.c1; j <= tableRange.c2; j++)
......@@ -2801,6 +2797,44 @@
worksheet.handlers.trigger("changeColumnTablePart", filter.DisplayName);
}
else
{
this._changeTotalsRowData(filter, range);
}
}
}
},
_changeTotalsRowData: function(tablePart, range)
{
if(!tablePart || !range || !tablePart.TotalsRowCount)
{
return false;
}
var worksheet = this.worksheet;
var tableRange = tablePart.Ref;
var totalRange = new Asc.Range(tableRange.c1, tableRange.r2, tableRange.c2, tableRange.r2);
var isIntersection = totalRange.intersection(range);
if(isIntersection)
{
for(var j = isIntersection.c1; j <= isIntersection.c2; j++)
{
var cell = worksheet.getCell3(tableRange.r2, j);
var tableColumn = tablePart.TableColumns[j - tableRange.c1];
if(cell.isFormula())
{
var val = cell.getFormula();
tableColumn.setTotalsRowFormula(val);
}
else
{
var val = cell.getValue();
tableColumn.setTotalsRowLabel(val);
}
}
}
},
......
......@@ -11325,6 +11325,7 @@
return false;
}
isFormula = c.isFormula();
t.model.autoFilters.renameTableColumn(oCellEdit);
} else {
c.setValue2(val);
// Вызываем функцию пересчета для заголовков форматированной таблицы
......
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