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

http://bugzserver/show_bug.cgi?id=31052 - [NamedRanges][Undo&Redo]Дублируется...

http://bugzserver/show_bug.cgi?id=31052 -  [NamedRanges][Undo&Redo]Дублируется именованный диапазон форматированной таблицы

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66674 954022d7-b5bf-4e40-9824-e11837661b57
parent cbe92330
......@@ -1694,7 +1694,8 @@ var g_oUndoRedoData_AutoFilterProperties = {
addFormatTableOptionsObj: 5,
moveFrom : 6,
moveTo : 7,
bWithoutFilter : 8
bWithoutFilter : 8,
displayName : 9
};
function UndoRedoData_AutoFilter() {
this.Properties = g_oUndoRedoData_AutoFilterProperties;
......@@ -1710,6 +1711,7 @@ function UndoRedoData_AutoFilter() {
this.moveFrom = null;
this.moveTo = null;
this.bWithoutFilter = null;
this.displayName = null;
}
UndoRedoData_AutoFilter.prototype = {
getType : function ()
......@@ -1733,6 +1735,7 @@ UndoRedoData_AutoFilter.prototype = {
case this.Properties.moveFrom: return new UndoRedoData_BBox(this.moveFrom); break;
case this.Properties.moveTo: return new UndoRedoData_BBox(this.moveTo); break;
case this.Properties.bWithoutFilter: return this.bWithoutFilter; break;
case this.Properties.displayName: return this.displayName; break;
}
return null;
......@@ -1750,6 +1753,7 @@ UndoRedoData_AutoFilter.prototype = {
case this.Properties.moveFrom: this.moveFrom = value;break;
case this.Properties.moveTo: this.moveTo = value;break;
case this.Properties.bWithoutFilter: this.bWithoutFilter = value;break;
case this.Properties.displayName: this.displayName = value;break;
}
return null;
},
......
......@@ -272,7 +272,7 @@ var maxIndividualValues = 10000;
constructor: AutoFilters,
addAutoFilter: function(styleName, activeRange, addFormatTableOptionsObj, offLock, bWithoutFilter)
addAutoFilter: function(styleName, activeRange, addFormatTableOptionsObj, offLock, bWithoutFilter, tablePartDisplayName)
{
var aWs = this._getCurrentWS(), addNameColumn, filterRange, t = this, ws = this.worksheet, cloneFilter;
var isTurnOffHistory = aWs.workbook.bUndoChanges || aWs.workbook.bRedoChanges;
......@@ -345,14 +345,15 @@ var maxIndividualValues = 10000;
}
//add to model
t._addNewFilter(filterRange, styleName, bWithoutFilter);
var newTablePart = t._addNewFilter(filterRange, styleName, bWithoutFilter, tablePartDisplayName);
var newDisplayName = newTablePart && newTablePart.DisplayName ? newTablePart.DisplayName : null;
if(styleName)
t._setColorStyleTable(aWs.TableParts[aWs.TableParts.length - 1].Ref, aWs.TableParts[aWs.TableParts.length - 1], null, true);
//history
t._addHistoryObj({Ref: filterRange}, historyitem_AutoFilter_Add,
{activeCells: filterRange, styleName: styleName, addFormatTableOptionsObj: addFormatTableOptionsObj}, null, filterRange, bWithoutFilter);
{activeCells: filterRange, styleName: styleName, addFormatTableOptionsObj: addFormatTableOptionsObj, displayName: newDisplayName}, null, filterRange, bWithoutFilter);
History.SetSelectionRedo(filterRange);
}
......@@ -1004,7 +1005,7 @@ var maxIndividualValues = 10000;
History.TurnOff();
switch (type) {
case historyitem_AutoFilter_Add:
this.addAutoFilter(data.styleName, data.activeCells, data.addFormatTableOptionsObj, null, data.bWithoutFilter);
this.addAutoFilter(data.styleName, data.activeCells, data.addFormatTableOptionsObj, null, data.bWithoutFilter, data.displayName);
break;
case historyitem_AutoFilter_Delete:
this.deleteAutoFilter(data.activeCells);
......@@ -2401,6 +2402,7 @@ var maxIndividualValues = 10000;
oHistoryObject.moveFrom = redoObject.arnFrom;
oHistoryObject.moveTo = redoObject.arnTo;
oHistoryObject.bWithoutFilter = bWithoutFilter ? bWithoutFilter : false;
oHistoryObject.displayName = redoObject.displayName;
}
else
{
......@@ -3392,7 +3394,7 @@ var maxIndividualValues = 10000;
},
_addNewFilter: function(ref, style, bWithoutFilter)
_addNewFilter: function(ref, style, bWithoutFilter, tablePartDisplayName)
{
var aWs = this._getCurrentWS();
var newFilter;
......@@ -3442,10 +3444,13 @@ var maxIndividualValues = 10000;
newFilter.AutoFilter.Ref = ref;
}
newFilter.DisplayName = aWs.workbook.dependencyFormulas.getNextTableName(aWs, ref);
//для Redo надо выставлять имя которое было, а не генерить новое
//newFilter.DisplayName = aWs.workbook.dependencyFormulas.addTableName(cloneData.DisplayName, aWs, cloneData.Ref);
if(tablePartDisplayName)
{
newFilter.DisplayName = tablePartDisplayName;
aWs.workbook.dependencyFormulas.addTableName(tablePartDisplayName, aWs, ref);
}
else
newFilter.DisplayName = aWs.workbook.dependencyFormulas.getNextTableName(aWs, ref);
newFilter.TableStyleInfo = new TableStyleInfo();
newFilter.TableStyleInfo.Name = style;
......
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