Commit 08ab6f04 authored by GoshaZotov's avatar GoshaZotov

Bug #32289 - [Copy&Paste] Сбрасываются настройки в Table Settings при...

Bug #32289 -  [Copy&Paste] Сбрасываются настройки в Table Settings при копировании форматированной таблицы
parent 740a2073
...@@ -1731,7 +1731,13 @@ var g_oUndoRedoData_AutoFilterProperties = { ...@@ -1731,7 +1731,13 @@ var g_oUndoRedoData_AutoFilterProperties = {
moveTo : 7, moveTo : 7,
bWithoutFilter : 8, bWithoutFilter : 8,
displayName : 9, displayName : 9,
val : 10 val : 10,
ShowColumnStripes : 11,
ShowFirstColumn : 12,
ShowLastColumn : 13,
ShowRowStripes : 14,
HeaderRowCount : 15,
TotalsRowCount : 16
}; };
function UndoRedoData_AutoFilter() { function UndoRedoData_AutoFilter() {
this.Properties = g_oUndoRedoData_AutoFilterProperties; this.Properties = g_oUndoRedoData_AutoFilterProperties;
...@@ -1749,6 +1755,14 @@ function UndoRedoData_AutoFilter() { ...@@ -1749,6 +1755,14 @@ function UndoRedoData_AutoFilter() {
this.bWithoutFilter = null; this.bWithoutFilter = null;
this.displayName = null; this.displayName = null;
this.val = null; this.val = null;
this.ShowColumnStripes = null;
this.ShowFirstColumn = null;
this.ShowLastColumn = null;
this.ShowRowStripes = null;
this.HeaderRowCount = null;
this.TotalsRowCount = null;
} }
UndoRedoData_AutoFilter.prototype = { UndoRedoData_AutoFilter.prototype = {
getType : function () getType : function ()
...@@ -1774,6 +1788,12 @@ UndoRedoData_AutoFilter.prototype = { ...@@ -1774,6 +1788,12 @@ UndoRedoData_AutoFilter.prototype = {
case this.Properties.bWithoutFilter: return this.bWithoutFilter; break; case this.Properties.bWithoutFilter: return this.bWithoutFilter; break;
case this.Properties.displayName: return this.displayName; break; case this.Properties.displayName: return this.displayName; break;
case this.Properties.val: return this.val; break; case this.Properties.val: return this.val; break;
case this.Properties.ShowColumnStripes: return this.ShowColumnStripes; break;
case this.Properties.ShowFirstColumn: return this.ShowFirstColumn; break;
case this.Properties.ShowLastColumn: return this.ShowLastColumn; break;
case this.Properties.ShowRowStripes: return this.ShowRowStripes; break;
case this.Properties.HeaderRowCount: return this.HeaderRowCount; break;
case this.Properties.TotalsRowCount: return this.TotalsRowCount; break;
} }
return null; return null;
...@@ -1793,6 +1813,12 @@ UndoRedoData_AutoFilter.prototype = { ...@@ -1793,6 +1813,12 @@ UndoRedoData_AutoFilter.prototype = {
case this.Properties.bWithoutFilter: this.bWithoutFilter = value;break; case this.Properties.bWithoutFilter: this.bWithoutFilter = value;break;
case this.Properties.displayName: this.displayName = value;break; case this.Properties.displayName: this.displayName = value;break;
case this.Properties.val: this.val = value;break; case this.Properties.val: this.val = value;break;
case this.Properties.ShowColumnStripes: this.ShowColumnStripes = value;break;
case this.Properties.ShowFirstColumn: this.ShowFirstColumn = value;break;
case this.Properties.ShowLastColumn: this.ShowLastColumn = value;break;
case this.Properties.ShowRowStripes: this.ShowRowStripes = value;break;
case this.Properties.HeaderRowCount: this.HeaderRowCount = value;break;
case this.Properties.TotalsRowCount: this.TotalsRowCount = value;break;
} }
return null; return null;
}, },
......
...@@ -305,7 +305,7 @@ ...@@ -305,7 +305,7 @@
constructor: AutoFilters, constructor: AutoFilters,
addAutoFilter: function(styleName, activeRange, addFormatTableOptionsObj, offLock, bWithoutFilter, tablePartDisplayName) addAutoFilter: function(styleName, activeRange, addFormatTableOptionsObj, offLock, bWithoutFilter, tablePartDisplayName, pasteStyleObj)
{ {
var worksheet = this.worksheet, t = this, cloneFilter; var worksheet = this.worksheet, t = this, cloneFilter;
var isTurnOffHistory = worksheet.workbook.bUndoChanges || worksheet.workbook.bRedoChanges; var isTurnOffHistory = worksheet.workbook.bUndoChanges || worksheet.workbook.bRedoChanges;
...@@ -356,7 +356,7 @@ ...@@ -356,7 +356,7 @@
} }
//add to model //add to model
var newTablePart = t._addNewFilter(filterRange, styleName, bWithoutFilter, tablePartDisplayName); var newTablePart = t._addNewFilter(filterRange, styleName, bWithoutFilter, tablePartDisplayName, pasteStyleObj);
var newDisplayName = newTablePart && newTablePart.DisplayName ? newTablePart.DisplayName : null; var newDisplayName = newTablePart && newTablePart.DisplayName ? newTablePart.DisplayName : null;
if(styleName) if(styleName)
...@@ -364,7 +364,7 @@ ...@@ -364,7 +364,7 @@
//history //history
t._addHistoryObj({Ref: filterRange}, AscCH.historyitem_AutoFilter_Add, t._addHistoryObj({Ref: filterRange}, AscCH.historyitem_AutoFilter_Add,
{activeCells: filterRange, styleName: styleName, addFormatTableOptionsObj: addFormatTableOptionsObj, displayName: newDisplayName}, null, filterRange, bWithoutFilter); {activeCells: filterRange, styleName: styleName, addFormatTableOptionsObj: addFormatTableOptionsObj, displayName: newDisplayName, pasteStyleObj: pasteStyleObj}, null, filterRange, bWithoutFilter);
History.SetSelectionRedo(filterRange); History.SetSelectionRedo(filterRange);
} }
...@@ -711,7 +711,7 @@ ...@@ -711,7 +711,7 @@
History.TurnOff(); History.TurnOff();
switch (type) { switch (type) {
case AscCH.historyitem_AutoFilter_Add: case AscCH.historyitem_AutoFilter_Add:
this.addAutoFilter(data.styleName, data.activeCells, data.addFormatTableOptionsObj, null, data.bWithoutFilter, data.displayName); this.addAutoFilter(data.styleName, data.activeCells, data.addFormatTableOptionsObj, null, data.bWithoutFilter, data.displayName, data);
break; break;
case AscCH.historyitem_AutoFilter_Delete: case AscCH.historyitem_AutoFilter_Delete:
this.deleteAutoFilter(data.activeCells); this.deleteAutoFilter(data.activeCells);
...@@ -2451,6 +2451,17 @@ ...@@ -2451,6 +2451,17 @@
oHistoryObject.bWithoutFilter = bWithoutFilter ? bWithoutFilter : false; oHistoryObject.bWithoutFilter = bWithoutFilter ? bWithoutFilter : false;
oHistoryObject.displayName = redoObject.displayName; oHistoryObject.displayName = redoObject.displayName;
oHistoryObject.val = redoObject.val; oHistoryObject.val = redoObject.val;
if(redoObject.pasteStyleObj)
{
oHistoryObject.ShowColumnStripes = redoObject.pasteStyleObj.ShowColumnStripes;
oHistoryObject.ShowFirstColumn = redoObject.pasteStyleObj.ShowFirstColumn;
oHistoryObject.ShowLastColumn = redoObject.pasteStyleObj.ShowLastColumn;
oHistoryObject.ShowRowStripes = redoObject.pasteStyleObj.ShowRowStripes;
oHistoryObject.HeaderRowCount = redoObject.pasteStyleObj.HeaderRowCount;
oHistoryObject.TotalsRowCount = redoObject.pasteStyleObj.TotalsRowCount;
}
} }
else else
{ {
...@@ -3018,7 +3029,7 @@ ...@@ -3018,7 +3029,7 @@
return ar; return ar;
}, },
_addNewFilter: function(ref, style, bWithoutFilter, tablePartDisplayName) _addNewFilter: function(ref, style, bWithoutFilter, tablePartDisplayName, pasteTablePartObj)
{ {
var worksheet = this.worksheet; var worksheet = this.worksheet;
var newFilter; var newFilter;
...@@ -3076,12 +3087,28 @@ ...@@ -3076,12 +3087,28 @@
else else
newFilter.DisplayName = worksheet.workbook.dependencyFormulas.getNextTableName(worksheet, ref); newFilter.DisplayName = worksheet.workbook.dependencyFormulas.getNextTableName(worksheet, ref);
newFilter.TableStyleInfo = new TableStyleInfo(); newFilter.TableStyleInfo = new TableStyleInfo();
newFilter.TableStyleInfo.Name = style; newFilter.TableStyleInfo.Name = style;
newFilter.TableStyleInfo.ShowColumnStripes = false;
newFilter.TableStyleInfo.ShowFirstColumn = false; if(pasteTablePartObj && pasteTablePartObj.ShowColumnStripes !== null && pasteTablePartObj.ShowColumnStripes !== undefined)
newFilter.TableStyleInfo.ShowLastColumn = false; {
newFilter.TableStyleInfo.ShowRowStripes = true; newFilter.TableStyleInfo.ShowColumnStripes = pasteTablePartObj.ShowColumnStripes;
newFilter.TableStyleInfo.ShowFirstColumn = pasteTablePartObj.ShowFirstColumn;
newFilter.TableStyleInfo.ShowLastColumn = pasteTablePartObj.ShowLastColumn;
newFilter.TableStyleInfo.ShowRowStripes = pasteTablePartObj.ShowRowStripes;
newFilter.HeaderRowCount = pasteTablePartObj.HeaderRowCount;
newFilter.TotalsRowCount = pasteTablePartObj.TotalsRowCount;
}
else
{
newFilter.TableStyleInfo.ShowColumnStripes = false;
newFilter.TableStyleInfo.ShowFirstColumn = false;
newFilter.TableStyleInfo.ShowLastColumn = false;
newFilter.TableStyleInfo.ShowRowStripes = true;
}
newFilter.TableColumns = tableColumns; newFilter.TableColumns = tableColumns;
......
...@@ -9290,8 +9290,19 @@ ...@@ -9290,8 +9290,19 @@
if ( !aFilters[aF].AutoFilter ) { if ( !aFilters[aF].AutoFilter ) {
bWithoutFilter = true; bWithoutFilter = true;
} }
t.model.autoFilters.addAutoFilter( aFilters[aF].TableStyleInfo.Name, range.bbox, true, true, bWithoutFilter ); var stylePasteObj =
{
ShowColumnStripes : aFilters[aF].TableStyleInfo.ShowColumnStripes,
ShowFirstColumn : aFilters[aF].TableStyleInfo.ShowFirstColumn,
ShowLastColumn : aFilters[aF].TableStyleInfo.ShowLastColumn,
ShowRowStripes : aFilters[aF].TableStyleInfo.ShowRowStripes,
HeaderRowCount : aFilters[aF].HeaderRowCount,
TotalsRowCount : aFilters[aF].TotalsRowCount
};
t.model.autoFilters.addAutoFilter( aFilters[aF].TableStyleInfo.Name, range.bbox, true, true, bWithoutFilter, null, stylePasteObj );
} }
} }
......
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