Commit 3ea8c45d authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

корректировал undo/redo для форматированных таблиц

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48438 954022d7-b5bf-4e40-9824-e11837661b57
parent 54197e1b
......@@ -350,6 +350,7 @@ var UndoRedoDataTypes = new function() {
this.GOPathCubicBezTo = 60;
this.GOPathClose = 61;
this.GOSetAdjustmentValue = 62;
this.AddFormatTableOptions = 63;
this.Create = function(nType)
......@@ -388,6 +389,7 @@ var UndoRedoDataTypes = new function() {
case this.AutoFilter: return new UndoRedoData_AutoFilter(); break;
case this.AutoFiltersOptions: return new Asc.AutoFiltersOptions(); break;
case this.AutoFiltersOptionsElements: return new Asc.AutoFiltersOptionsElements(); break;
case this.AddFormatTableOptions: return new Asc.AddFormatTableOptions(); break;
case this.SingleProperty: return new UndoRedoData_SingleProperty(); break;
case this.RgbColor: return new RgbColor(); break;
case this.ThemeColor: return new ThemeColor(); break;
......@@ -1142,7 +1144,8 @@ function UndoRedoData_AutoFilter() {
lTable : 1,
type : 2,
cellId : 3,
autoFiltersObject : 4
autoFiltersObject : 4,
addFormatTableOptionsObj: 5
};
this.undo = null;
......@@ -1152,6 +1155,7 @@ function UndoRedoData_AutoFilter() {
this.type = null;
this.cellId = null;
this.autoFiltersObject = null;
this.addFormatTableOptionsObj = null;
}
UndoRedoData_AutoFilter.prototype = {
getType : function ()
......@@ -1171,6 +1175,7 @@ UndoRedoData_AutoFilter.prototype = {
case this.Properties.type: return this.type; break;
case this.Properties.cellId: return this.cellId; break;
case this.Properties.autoFiltersObject: return this.autoFiltersObject; break;
case this.Properties.addFormatTableOptionsObj: return this.addFormatTableOptionsObj; break;
}
return null;
......@@ -1184,6 +1189,7 @@ UndoRedoData_AutoFilter.prototype = {
case this.Properties.type: this.type = value;break;
case this.Properties.cellId: this.cellId = value;break;
case this.Properties.autoFiltersObject: this.autoFiltersObject = value;break;
case this.Properties.addFormatTableOptionsObj: return this.addFormatTableOptionsObj = value; break;
}
},
applyCollaborative : function (nSheetId, collaborativeEditing) {
......
......@@ -189,6 +189,11 @@
if ( !(this instanceof AddFormatTableOptions) ) {return new AddFormatTableOptions();};
this.Properties = {
range : 0,
isTitle : 1
};
this.range = null;
this.isTitle = null;
return this;
......@@ -196,6 +201,26 @@
AddFormatTableOptions.prototype = {
constructor: AddFormatTableOptions,
getType : function () {
return UndoRedoDataTypes.AddFormatTableOptions;
},
getProperties : function () {
return this.Properties;
},
getProperty : function (nType) {
switch (nType) {
case this.Properties.range: return this.range; break;
case this.Properties.isTitle: return this.isTitle; break;
}
return null;
},
setProperty : function (nType, value) {
switch (nType) {
case this.Properties.range: this.range = value;break;
case this.Properties.isTitle: this.isTitle = value;break;
}
},
asc_setRange : function(range) { this.range = range;},
asc_setIsTitle : function(isTitle) { this.isTitle = isTitle;},
......@@ -464,7 +489,7 @@
if(addNameColumn)
changesElemHistory.addColumn = true;
t._addHistoryObj(ws, changesElemHistory, historyitem_AutoFilter_Add,
{activeCells: cloneAC, lTable: lTable});
{activeCells: cloneAC, lTable: lTable, addFormatTableOptionsObj: addFormatTableOptionsObj});
if(isInsertButton){
if (bIsActiveSheet)
......@@ -756,8 +781,10 @@
{
Ref: result[0].id + ':' + result[result.length -1].idNext
};
if(addNameColumn && addFormatTableOptionsObj)
addFormatTableOptionsObj.range = ref;
t._addHistoryObj(ws, ref, historyitem_AutoFilter_Add,
{activeCells: activeCells, lTable: lTable});
{activeCells: activeCells, lTable: lTable, addFormatTableOptionsObj: addFormatTableOptionsObj});
if(isInsertButton){
if (bIsActiveSheet)
......@@ -1595,7 +1622,7 @@
History.TurnOff();
switch (type) {
case historyitem_AutoFilter_Add:
this.addAutoFilter(data.worksheet, data.lTable, data.activeCells, /*openFilter*/undefined, true);
this.addAutoFilter(data.worksheet, data.lTable, data.activeCells, /*openFilter*/undefined, true, data.addFormatTableOptionsObj);
break;
case historyitem_AutoFilter_Sort:
this.sortColFilter(data.type, data.cellId, data.worksheet, data.activeCells, true);
......@@ -4755,6 +4782,7 @@
oHistoryObject.type = redoObject.type;
oHistoryObject.cellId = redoObject.cellId;
oHistoryObject.autoFiltersObject = redoObject.autoFiltersObject;
oHistoryObject.addFormatTableOptionsObj = redoObject.addFormatTableOptionsObj;
History.Add(g_oUndoRedoAutoFilters, type, ws.model.getId(), null, oHistoryObject);
},
......
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