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

http://bugzserver/show_bug.cgi?id=26433 - [CoEdit] Не обновляется канва после...

http://bugzserver/show_bug.cgi?id=26433 -  [CoEdit] Не обновляется канва после копирования и вставки форматированной таблицы

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59073 954022d7-b5bf-4e40-9824-e11837661b57
parent 5881defd
......@@ -1594,7 +1594,8 @@ function UndoRedoData_AutoFilter() {
autoFiltersObject : 4,
addFormatTableOptionsObj: 5,
moveFrom : 6,
moveTo : 7
moveTo : 7,
bWithoutFilter : 8
};
this.undo = null;
......@@ -1607,6 +1608,7 @@ function UndoRedoData_AutoFilter() {
this.addFormatTableOptionsObj = null;
this.moveFrom = null;
this.moveTo = null;
this.bWithoutFilter = null;
}
UndoRedoData_AutoFilter.prototype = {
getType : function ()
......@@ -1629,6 +1631,7 @@ UndoRedoData_AutoFilter.prototype = {
case this.Properties.addFormatTableOptionsObj: return this.addFormatTableOptionsObj; break;
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;
}
return null;
......@@ -1645,6 +1648,7 @@ UndoRedoData_AutoFilter.prototype = {
case this.Properties.addFormatTableOptionsObj: return this.addFormatTableOptionsObj = value; break;
case this.Properties.moveFrom: this.moveFrom = value;break;
case this.Properties.moveTo: this.moveTo = value;break;
case this.Properties.bWithoutFilter: this.bWithoutFilter = value;break;
}
return null;
},
......
......@@ -274,7 +274,7 @@ var gUndoInsDelCellsFlag = true;
},
//добавляем кнопки или удаляем (вызывается из меню при нажатии на кнопку добавления фильтра)
addAutoFilter: function (lTable, ar, openFilter, isTurnOffHistory, addFormatTableOptionsObj) {
addAutoFilter: function (lTable, ar, openFilter, isTurnOffHistory, addFormatTableOptionsObj, bWithoutFilter) {
var ws = this.worksheet;
var bIsActiveSheet = this._isActiveSheet();
var bIsOpenFilter = undefined !== openFilter && null !== openFilter;
......@@ -654,7 +654,7 @@ var gUndoInsDelCellsFlag = true;
{
//добавляем структуру нового фильтра
if(openFilter == undefined)
t._addNewFilter(result,tableColumns,aWs,isAll,lTable);
t._addNewFilter(result, tableColumns, aWs, isAll, lTable, bWithoutFilter);
//устанавливаем стиль для таблицы
if(!isAll)
......@@ -695,10 +695,11 @@ var gUndoInsDelCellsFlag = true;
if(addNameColumn && addFormatTableOptionsObj)
addFormatTableOptionsObj.range = ref;
t._addHistoryObj(ref, historyitem_AutoFilter_Add,
{activeCells: activeCells, lTable: lTable, addFormatTableOptionsObj: addFormatTableOptionsObj}, null, ref.Ref);
{activeCells: activeCells, lTable: lTable, addFormatTableOptionsObj: addFormatTableOptionsObj}, null, ref.Ref, bWithoutFilter);
if(isInsertButton){
if(isInsertButton && !bWithoutFilter){
t._addButtonAF(newRes);
}
else if(!t.allButtonAF)
......@@ -1798,7 +1799,7 @@ var gUndoInsDelCellsFlag = true;
History.TurnOff();
switch (type) {
case historyitem_AutoFilter_Add:
this.addAutoFilter(data.lTable, data.activeCells, /*openFilter*/undefined, true, data.addFormatTableOptionsObj);
this.addAutoFilter(data.lTable, data.activeCells, /*openFilter*/undefined, true, data.addFormatTableOptionsObj, data.bWithoutFilter);
break;
case historyitem_AutoFilter_Sort:
this.sortColFilter(data.type, data.cellId, data.activeCells, true);
......@@ -4538,7 +4539,7 @@ var gUndoInsDelCellsFlag = true;
return result;
},
_addNewFilter: function(val,tableColumns,aWs,isAll,style)
_addNewFilter: function(val, tableColumns, aWs, isAll, style, bWithoutFilter)
{
var newFilter, ref;
if(isAll)
......@@ -4585,8 +4586,11 @@ var gUndoInsDelCellsFlag = true;
newFilter.Ref = ref;
newFilter.result = val;
newFilter.AutoFilter = new AutoFilter();
newFilter.AutoFilter.Ref = ref;
if(!bWithoutFilter)
{
newFilter.AutoFilter = new AutoFilter();
newFilter.AutoFilter.Ref = ref;
}
newFilter.DisplayName = aWs.workbook.oNameGenerator.getNextTableName(aWs, ref);
......@@ -6079,7 +6083,7 @@ var gUndoInsDelCellsFlag = true;
},
_addHistoryObj: function (oldObj, type, redoObject, deleteFilterAfterDeleteColRow, activeHistoryRange) {
_addHistoryObj: function (oldObj, type, redoObject, deleteFilterAfterDeleteColRow, activeHistoryRange, bWithoutFilter) {
var ws = this.worksheet;
var oHistoryObject = new UndoRedoData_AutoFilter();
oHistoryObject.undo = oldObj;
......@@ -6094,6 +6098,7 @@ var gUndoInsDelCellsFlag = true;
oHistoryObject.addFormatTableOptionsObj = redoObject.addFormatTableOptionsObj;
oHistoryObject.moveFrom = redoObject.arnFrom;
oHistoryObject.moveTo = redoObject.arnTo;
oHistoryObject.bWithoutFilter = bWithoutFilter ? bWithoutFilter : false;
}
else
{
......
......@@ -8167,9 +8167,12 @@
range = t.model.getRange3(diffRow + selectionRange.r1, diffCol + selectionRange.c1, diffRow + selectionRange.r1 + (tablePartRange.r2 - tablePartRange.r1), diffCol + selectionRange.c1 + (tablePartRange.c2 - tablePartRange.c1));
if(aFilters[aF].style)
range.cleanFormat();
t.autoFilters.addAutoFilter(aFilters[aF].TableStyleInfo.Name, range.bbox, null, null, true);
var bWithoutFilter = false;
if(!aFilters[aF].AutoFilter)
t.autoFilters.addAutoFilter(null, range.bbox, null, null, true);
bWithoutFilter = true;
t.autoFilters.addAutoFilter(aFilters[aF].TableStyleInfo.Name, range.bbox, null, null, true, bWithoutFilter);
}
}
......
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