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

http://bugzserver/show_bug.cgi?id=30432 - Не происходит очистки формата...

http://bugzserver/show_bug.cgi?id=30432 - Не происходит очистки формата форматированной таблицы после Clear Format

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@65034 954022d7-b5bf-4e40-9824-e11837661b57
parent 57a3123b
......@@ -102,6 +102,7 @@ var historyitem_AutoFilter_CleanAutoFilter = 7;
var historyitem_AutoFilter_Delete = 8;
var historyitem_AutoFilter_ChangeTableStyle = 9;
var historyitem_AutoFilter_Change = 10;
var historyitem_AutoFilter_CleanFormat = 11;
function CHistory(workbook)
......
......@@ -1024,6 +1024,9 @@ var maxIndividualValues = 10000;
case historyitem_AutoFilter_CleanAutoFilter:
this.isApplyAutoFilterInCell(data.activeCells, true);
break;
case historyitem_AutoFilter_CleanFormat:
this.cleanFormat(data.activeCells, true);
break;
}
History.TurnOn();
},
......@@ -1106,6 +1109,23 @@ var maxIndividualValues = 10000;
}
}
}
else if(type === historyitem_AutoFilter_CleanFormat)
{
if(aWs.TableParts)
{
for(var l = 0; l < aWs.TableParts.length; l++)
{
//TODO сравниваю не по DisplayName по следующей причине: делаем undo всему, затем redo, и форматированная таблицы добавляется с новым именем
//если передавать в redo displaName -> конфликт при совместном ред.(1- ый добавляет ф/т + undo, 2-ой добавляет ф/т, первый делает redo->2 одинаковых имени)
if(cloneData.Ref.isEqual(aWs.TableParts[l].Ref))
{
aWs.TableParts[l] = cloneData.clone(null);
this._setColorStyleTable(cloneData.Ref, cloneData, null, true);
break;
}
}
}
}
else if(cloneData.FilterColumns || cloneData.AutoFilter || cloneData.TableColumns || (cloneData.Ref && (cloneData instanceof AutoFilter || cloneData instanceof TablePart)))//add
{
if(cloneData.Ref)
......@@ -1283,9 +1303,35 @@ var maxIndividualValues = 10000;
cleanFormat: function(range)
{
var aWs = this._getCurrentWS();
var t = this, selectedTableParts;
//if first row AF in ActiveRange - delete AF
if(aWs.AutoFilter && aWs.AutoFilter.Ref && range.containsFirstLineRange(aWs.AutoFilter.Ref))
this.isEmptyAutoFilters(aWs.AutoFilter.Ref);
else
{
//*****callBack on delete filter
var deleteFormatCallBack = function()
{
History.Create_NewPoint();
History.StartTransaction();
for(var i = 0; i < selectedTableParts.length; i++)
{
var cloneFilter = selectedTableParts[i].clone(null);
selectedTableParts[i].TableStyleInfo.Name = null;
t._cleanStyleTable(selectedTableParts[i].Ref);
t._addHistoryObj(cloneFilter, historyitem_AutoFilter_CleanFormat, {activeCells: range});
}
History.EndTransaction();
};
selectedTableParts = this._searchFiltersInRange(range, true);
if(selectedTableParts && selectedTableParts.length)
deleteFormatCallBack();
}
},
isCheckMoveRange: function(arnFrom)
......
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