Commit 6fcb5e62 authored by GoshaZotov's avatar GoshaZotov Committed by Alexander.Trofimov

changes for update format table

parent cd93bfe2
......@@ -443,6 +443,9 @@ CHistory.prototype._addRedoObjectParam = function (oRedoObjectParam, Point) {
oRedoObjectParam.oOnUpdateSheetViewSettings[Point.SheetId] = Point.SheetId;
else if (AscCommonExcel.g_oUndoRedoWorksheet === Point.Class && (historyitem_Worksheet_RemoveRows === Point.Type || historyitem_Worksheet_RemoveCols === Point.Type || historyitem_Worksheet_AddRows === Point.Type || historyitem_Worksheet_AddCols === Point.Type))
oRedoObjectParam.bAddRemoveRowCol = true;
else if(g_oUndoRedoAutoFilters === Point.Class && historyitem_AutoFilter_ChangeTableInfo === Point.Type)
oRedoObjectParam.oChangeWorksheetUpdate[Point.SheetId] = Point.SheetId;
};
CHistory.prototype.Get_RecalcData = function(Point2)
{
......
......@@ -4782,6 +4782,16 @@ TablePart.prototype.isShowButton = function()
return res;
};
TablePart.prototype.generateTotalsRowLabel = function()
{
if(!this.TableColumns)
{
return;
}
this.TableColumns[0].generateTotalsRowLabel();
};
/** @constructor */
function AutoFilter() {
this.Ref = null;
......@@ -4983,6 +4993,14 @@ TableColumn.prototype.clone = function() {
res.CalculatedColumnFormula = this.CalculatedColumnFormula;
return res;
};
TableColumn.prototype.generateTotalsRowLabel = function(){
//TODO добавить в перевод
if(this.TotalsRowLabel === null)
{
this.TotalsRowLabel = "Summary";
}
};
/** @constructor */
function TableStyleInfo() {
this.Name = null;
......
......@@ -2151,6 +2151,11 @@
tablePart.TotalsRowCount = tablePart.TotalsRowCount === null ? 1 : null;
}
if(val === true)
{
tablePart.generateTotalsRowLabel();
}
}
break;
......@@ -3764,20 +3769,39 @@
if(style && style.Name && worksheet.workbook.TableStyles && worksheet.workbook.TableStyles.AllStyles && (styleForCurTable = worksheet.workbook.TableStyles.AllStyles[style.Name]))
{
//заполняем названия столбцов
if(true != isOpenFilter && headerRowCount > 0 && options.TableColumns)
if(true != isOpenFilter && isSetVal && !bRedoChanges)
{
for(var ncol = bbox.c1; ncol <= bbox.c2; ncol++)
if((headerRowCount > 0 || totalsRowCount > 0) && options.TableColumns)
{
var range = worksheet.getCell3(bbox.r1, ncol);
var num = ncol - bbox.c1;
var tableColumn = options.TableColumns[num];
if(null != tableColumn && null != tableColumn.Name && !bRedoChanges && isSetVal)
for(var ncol = bbox.c1; ncol <= bbox.c2; ncol++)
{
range.setValue(tableColumn.Name);
range.setType(CellValueType.String);
var range = worksheet.getCell3(bbox.r1, ncol);
var num = ncol - bbox.c1;
var tableColumn = options.TableColumns[num];
if(null != tableColumn && null != tableColumn.Name && headerRowCount > 0)
{
range.setValue(tableColumn.Name);
range.setType(CellValueType.String);
}
if(tableColumn !== null && tableColumn.TotalsRowLabel !== null && totalsRowCount > 0)
{
range = worksheet.getCell3(bbox.r2, ncol);
range.setValue(tableColumn.TotalsRowLabel);
range.setType(CellValueType.String);
//TODO + далее необходимо добавлять формулу
}
}
}
else if(totalsRowCount)
{
//var range = worksheet.getCell3(bbox.r2, bbox.c1);
//range.setValue(tableColumn.Name);
//range.setType(CellValueType.String);
}
}
//заполняем стили
var aNoHiddenCol = [];
for(var i = bbox.c1; i <= bbox.c2; i++)
......
......@@ -10206,7 +10206,7 @@
return true;
};
WorksheetView.prototype.changeWorksheet = function ( prop, val, displayNameFormatTable ) {
WorksheetView.prototype.changeWorksheet = function ( prop, val ) {
// Проверка глобального лока
if ( this.collaborativeEditing.getGlobalLock() ) {
return;
......@@ -10340,7 +10340,7 @@
functionModelAction = function () {
History.Create_NewPoint();
History.StartTransaction();
if ( range.addCellsShiftRight(displayNameFormatTable) ) {
if ( range.addCellsShiftRight() ) {
fullRecalc = true;
reinitRanges = true;
t.cellCommentator.updateCommentsDependencies( true, val, arn );
......@@ -10361,7 +10361,7 @@
functionModelAction = function () {
History.Create_NewPoint();
History.StartTransaction();
if ( range.addCellsShiftBottom(displayNameFormatTable) ) {
if ( range.addCellsShiftBottom() ) {
fullRecalc = true;
reinitRanges = true;
t.cellCommentator.updateCommentsDependencies( true, val, arn );
......@@ -12812,10 +12812,13 @@
var isChangeTableInfo = this.af_checkChangeTableInfo(tablePart, optionType);
if(isChangeTableInfo !== false)
{
History.Create_NewPoint();
History.StartTransaction();
this.model.autoFilters.changeFormatTableInfo(tableName, optionType, val);
this._onUpdateFormatTable(isChangeTableInfo, false, true);
//TODO добавить перерисовку таблицы и перерисовку шаблонов
History.EndTransaction();
}
};
......@@ -13037,7 +13040,11 @@
}
//TODO тестовый вариант. нужно сделать методы и добавлять в историю
//ws.workbook.dependencyFormulas.changeDefName( tableName, newName );
var oldNamedrange = this.model.workbook.dependencyFormulas.getDefNameNodeByName(tablePart.DisplayName);
var newNamedrange = oldNamedrange.clone();
newNamedrange.Name = newName;
oldNamedrange.changeDefName(newNamedrange);
tablePart.DisplayName = newName;
};
......
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