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