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

+ к rev.62449

изменения во взаимодействии с меню

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62507 954022d7-b5bf-4e40-9824-e11837661b57
parent 473a5269
...@@ -300,6 +300,14 @@ var c_oTargetType = { ...@@ -300,6 +300,14 @@ var c_oTargetType = {
FrozenAnchorV : 15 FrozenAnchorV : 15
}; };
var c_oAscAutoFilterTypes = {
ColorFilter: 0,
CustomFilters: 1,
DynamicFilter: 2,
Top10: 3,
Filters: 4
};
var c_oAscCoAuthoringMeBorderColor = new window.CColor(22, 156, 0); var c_oAscCoAuthoringMeBorderColor = new window.CColor(22, 156, 0);
var c_oAscCoAuthoringOtherBorderColor = new window.CColor(238, 53, 37); var c_oAscCoAuthoringOtherBorderColor = new window.CColor(238, 53, 37);
var c_oAscCoAuthoringLockTablePropertiesBorderColor = new window.CColor(255, 144, 0); var c_oAscCoAuthoringLockTablePropertiesBorderColor = new window.CColor(255, 144, 0);
......
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
prot["asc_getComments"] = prot.asc_getComments; prot["asc_getComments"] = prot.asc_getComments;
prot["asc_getLocked"] = prot.asc_getLocked; prot["asc_getLocked"] = prot.asc_getLocked;
prot["asc_getIsFormatTable"] = prot.asc_getIsFormatTable; prot["asc_getIsFormatTable"] = prot.asc_getIsFormatTable;
prot["asc_tableStyleName"] = prot.asc_tableStyleName; prot["asc_getTableStyleName"] = prot.asc_getTableStyleName;
prot["asc_getStyleName"] = prot.asc_getStyleName; prot["asc_getStyleName"] = prot.asc_getStyleName;
prot["asc_getNumFormatType"] = prot.asc_getNumFormatType; prot["asc_getNumFormatType"] = prot.asc_getNumFormatType;
prot["asc_getAngle"] = prot.asc_getAngle; prot["asc_getAngle"] = prot.asc_getAngle;
......
...@@ -358,6 +358,7 @@ var UndoRedoDataTypes = new function() { ...@@ -358,6 +358,7 @@ var UndoRedoDataTypes = new function() {
this.ClrScheme = 28; this.ClrScheme = 28;
this.AutoFilter = 29; this.AutoFilter = 29;
this.AutoFiltersOptions = 30; this.AutoFiltersOptions = 30;
this.AutoFilterObj = 31;
this.AutoFiltersOptionsElements = 32; this.AutoFiltersOptionsElements = 32;
this.SingleProperty = 33; this.SingleProperty = 33;
...@@ -431,6 +432,7 @@ var UndoRedoDataTypes = new function() { ...@@ -431,6 +432,7 @@ var UndoRedoDataTypes = new function() {
case this.ClrScheme: return new UndoRedoData_ClrScheme();break; case this.ClrScheme: return new UndoRedoData_ClrScheme();break;
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.AutoFilterObj: return new Asc.AutoFilterObj(); 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.AddFormatTableOptions: return new Asc.AddFormatTableOptions(); break;
case this.SingleProperty: return new UndoRedoData_SingleProperty(); break; case this.SingleProperty: return new UndoRedoData_SingleProperty(); break;
...@@ -2991,7 +2993,7 @@ UndoRedoCell.prototype = { ...@@ -2991,7 +2993,7 @@ UndoRedoCell.prototype = {
cell.setValueData(Val); cell.setValueData(Val);
// ToDo Так делать неправильно, нужно поправить (перенести логику в model, а отрисовку отделить) // ToDo Так делать неправильно, нужно поправить (перенести логику в model, а отрисовку отделить)
var worksheetView = this.wb.oApi.wb.getWorksheetById(nSheetId); var worksheetView = this.wb.oApi.wb.getWorksheetById(nSheetId);
worksheetView.autoFilters._renameTableColumn(new Asc.Range(nCol, nRow, nCol, nRow), bUndo); worksheetView.autoFilters.renameTableColumn(new Asc.Range(nCol, nRow, nCol, nRow), bUndo);
} }
else if(historyitem_Cell_SetStyle == Type) else if(historyitem_Cell_SetStyle == Type)
{ {
......
...@@ -4339,6 +4339,7 @@ TablePart.prototype.clone = function(ws) { ...@@ -4339,6 +4339,7 @@ TablePart.prototype.clone = function(ws) {
res.result.push(this.result[i].clone()); res.result.push(this.result[i].clone());
} }
if(ws !== null)
res.recalc(ws); res.recalc(ws);
return res; return res;
}; };
...@@ -4483,12 +4484,14 @@ FilterColumn.prototype.clone = function() { ...@@ -4483,12 +4484,14 @@ FilterColumn.prototype.clone = function() {
res.ShowButton = this.ShowButton; res.ShowButton = this.ShowButton;
return res; return res;
}; };
FilterColumn.prototype.isHideValue = function(val, isDateTimeFormat) { FilterColumn.prototype.isHideValue = function(val, isDateTimeFormat, top10Length) {
var res = false; var res = false;
if(this.Filters) if(this.Filters)
res = this.Filters.isHideValue(val, isDateTimeFormat); res = this.Filters.isHideValue(val, isDateTimeFormat);
else if(this.CustomFiltersObj) else if(this.CustomFiltersObj)
res = this.CustomFiltersObj.isHideValue(val); res = this.CustomFiltersObj.isHideValue(val);
else if(this.Top10)
res = this.Top10.isHideValue(val, top10Length);
return res; return res;
}; };
FilterColumn.prototype.clean = function(val) { FilterColumn.prototype.clean = function(val) {
...@@ -4512,7 +4515,7 @@ FilterColumn.prototype.createFilter = function(obj) { ...@@ -4512,7 +4515,7 @@ FilterColumn.prototype.createFilter = function(obj) {
newFilter = new CustomFilters(); newFilter = new CustomFilters();
this.CustomFiltersObj = newFilter this.CustomFiltersObj = newFilter
} }
allFilterOpenElements = newFilter.create(obj); allFilterOpenElements = newFilter.init(obj);
return allFilterOpenElements; return allFilterOpenElements;
}; };
...@@ -4533,7 +4536,7 @@ Filters.prototype.clone = function() { ...@@ -4533,7 +4536,7 @@ Filters.prototype.clone = function() {
res.Blank = this.Blank; res.Blank = this.Blank;
return res; return res;
}; };
Filters.prototype.create = function(obj) { Filters.prototype.init = function(obj) {
var allFilterOpenElements = true; var allFilterOpenElements = true;
for(var i = 0; i < obj.result.length; i++) for(var i = 0; i < obj.result.length; i++)
{ {
...@@ -4612,6 +4615,7 @@ DateGroupItem.prototype.clone = function() { ...@@ -4612,6 +4615,7 @@ DateGroupItem.prototype.clone = function() {
res.Year = this.Year; res.Year = this.Year;
return res; return res;
}; };
/** @constructor */ /** @constructor */
function CustomFilters() { function CustomFilters() {
this.And = null; this.And = null;
...@@ -4627,7 +4631,7 @@ CustomFilters.prototype.clone = function() { ...@@ -4627,7 +4631,7 @@ CustomFilters.prototype.clone = function() {
} }
return res; return res;
}; };
CustomFilters.prototype.create = function(obj) { CustomFilters.prototype.init = function(obj) {
this.And = !obj.isChecked; this.And = !obj.isChecked;
this.CustomFilters = []; this.CustomFilters = [];
...@@ -4639,11 +4643,19 @@ CustomFilters.prototype.create = function(obj) { ...@@ -4639,11 +4643,19 @@ CustomFilters.prototype.create = function(obj) {
CustomFilters.prototype.isHideValue = function(val){ CustomFilters.prototype.isHideValue = function(val){
var res = false; var res = false;
var filterRes1 = this.CustomFilters[0] ? this.CustomFilters[0].isHideValue(val) : true; var filterRes1 = this.CustomFilters[0] ? this.CustomFilters[0].isHideValue(val) : null;
var filterRes2 = this.CustomFilters[1] ? this.CustomFilters[1].isHideValue(val) : true; var filterRes2 = this.CustomFilters[1] ? this.CustomFilters[1].isHideValue(val) : null;
if(this.And && ((filterRes1 === null && filterRes2 === true || filterRes1 === true && filterRes2 === null || filterRes1 === true && filterRes2 === true)))
res = true;
if(!this.And && ((filterRes1 === true || filterRes2 === true)))
res = true;
return this.And ? (filterRes1 && filterRes2) : (filterRes1 || filterRes2); return res;
}; };
CustomFilters.prototype.asc_getAnd = function () { return this.And; }
CustomFilters.prototype.asc_setAnd = function (val) { this.And = val; }
/** @constructor */ /** @constructor */
function CustomFilter(operator, val) { function CustomFilter(operator, val) {
this.Operator = operator != undefined ? operator : null; this.Operator = operator != undefined ? operator : null;
...@@ -4655,7 +4667,7 @@ CustomFilter.prototype.clone = function() { ...@@ -4655,7 +4667,7 @@ CustomFilter.prototype.clone = function() {
res.Val = this.Val; res.Val = this.Val;
return res; return res;
}; };
CustomFilter.prototype.create = function(operator, val) { CustomFilter.prototype.init = function(operator, val) {
this.Operator = operator; this.Operator = operator;
this.Val = val; this.Val = val;
}; };
...@@ -4664,7 +4676,7 @@ CustomFilter.prototype.isHideValue = function(val) { ...@@ -4664,7 +4676,7 @@ CustomFilter.prototype.isHideValue = function(val) {
var result = false; var result = false;
var checkComplexSymbols = null; var checkComplexSymbols = null;
var filterVal; var filterVal, position;
if(checkComplexSymbols != null) if(checkComplexSymbols != null)
result = checkComplexSymbols; result = checkComplexSymbols;
else else
...@@ -4772,6 +4784,13 @@ CustomFilter.prototype.isHideValue = function(val) { ...@@ -4772,6 +4784,13 @@ CustomFilter.prototype.isHideValue = function(val) {
return !result; return !result;
}; };
CustomFilter.prototype.asc_getOperator = function () { return this.Operator; };
CustomFilter.prototype.asc_getVal = function () { return this.Val; };
CustomFilter.prototype.asc_setOperator = function (val) { this.Operator = val; };
CustomFilter.prototype.asc_setVal = function (val) { this.Val = val; };
/** @constructor */ /** @constructor */
function DynamicFilter() { function DynamicFilter() {
this.Type = null; this.Type = null;
...@@ -4785,6 +4804,15 @@ DynamicFilter.prototype.clone = function() { ...@@ -4785,6 +4804,15 @@ DynamicFilter.prototype.clone = function() {
res.MaxVal = this.MaxVal; res.MaxVal = this.MaxVal;
return res; return res;
}; };
DynamicFilter.prototype.asc_getType = function () { return this.Type; };
DynamicFilter.prototype.asc_getVal = function () { return this.Val; };
DynamicFilter.prototype.asc_getMaxVal = function () { return this.MaxVal; };
DynamicFilter.prototype.asc_setType = function (val) { this.Type = val; };
DynamicFilter.prototype.asc_setVal = function (val) { this.Val = val; };
DynamicFilter.prototype.asc_setMaxVal = function (val) { this.MaxVal = val; };
/** @constructor */ /** @constructor */
function ColorFilter() { function ColorFilter() {
this.CellColor = null; this.CellColor = null;
...@@ -4798,6 +4826,13 @@ ColorFilter.prototype.clone = function() { ...@@ -4798,6 +4826,13 @@ ColorFilter.prototype.clone = function() {
} }
return res; return res;
}; };
ColorFilter.prototype.asc_getCellColor = function () { return this.CellColor; };
ColorFilter.prototype.asc_getDxf = function () { return this.dxf; };
ColorFilter.prototype.asc_setCellColor = function (val) { this.CellColor = val; };
ColorFilter.prototype.asc_setDxf = function (val) { this.dxf = val; };
/** @constructor */ /** @constructor */
function Top10() { function Top10() {
this.FilterVal = null; this.FilterVal = null;
...@@ -4813,6 +4848,20 @@ Top10.prototype.clone = function() { ...@@ -4813,6 +4848,20 @@ Top10.prototype.clone = function() {
res.Val = this.Val; res.Val = this.Val;
return res; return res;
}; };
Top10.prototype.isHideValue = function(val, top10Length) {
return;
};
Top10.prototype.asc_getFilterVal = function () { return this.FilterVal; };
Top10.prototype.asc_getPercent = function () { return this.Percent; };
Top10.prototype.asc_getTop = function () { return this.Top; };
Top10.prototype.asc_getVal = function () { return this.Val; };
Top10.prototype.asc_setFilterVal = function (val) { this.FilterVal = val; };
Top10.prototype.asc_setPercent = function (val) { this.Percent = val; };
Top10.prototype.asc_setTop = function (val) { this.Top = val; };
Top10.prototype.asc_setVal = function (val) { this.Val = val; };
/** @constructor */ /** @constructor */
function SortCondition() { function SortCondition() {
this.Ref = null; this.Ref = null;
...@@ -4843,3 +4892,49 @@ dateElem.prototype.clone = function() { ...@@ -4843,3 +4892,49 @@ dateElem.prototype.clone = function() {
return res; return res;
}; };
window["Asc"]["CustomFilters"] = window["Asc"].CustomFilters = CustomFilters;
prot = CustomFilters.prototype;
prot["asc_getAnd"] = prot.asc_getAnd;
prot["asc_setAnd"] = prot.asc_setAnd;
window["Asc"]["CustomFilter"] = window["Asc"].CustomFilter = CustomFilter;
prot = CustomFilter.prototype;
prot["asc_getOperator"] = prot.asc_getOperator;
prot["asc_getVal"] = prot.asc_getVal;
prot["asc_setOperator"] = prot.asc_setOperator;
prot["asc_setVal"] = prot.asc_setVal;
window["Asc"]["CustomFilter"] = window["Asc"].CustomFilter = CustomFilter;
prot = CustomFilter.prototype;
prot["asc_getOperator"] = prot.asc_getOperator;
prot["asc_getVal"] = prot.asc_getVal;
prot["asc_setOperator"] = prot.asc_setOperator;
prot["asc_setVal"] = prot.asc_setVal;
window["Asc"]["DynamicFilter"] = window["Asc"].DynamicFilter = DynamicFilter;
prot = DynamicFilter.prototype;
prot["asc_getType"] = prot.asc_getType;
prot["asc_getVal"] = prot.asc_getVal;
prot["asc_getMaxVal"] = prot.asc_getMaxVal;
prot["asc_setType"] = prot.asc_setType;
prot["asc_setVal"] = prot.asc_setVal;
prot["asc_setMaxVal"] = prot.asc_setMaxVal;
window["Asc"]["ColorFilter"] = window["Asc"].ColorFilter = ColorFilter;
prot = ColorFilter.prototype;
prot["asc_getCellColor"] = prot.asc_getType;
prot["asc_getDxf"] = prot.asc_getVal;
prot["asc_setCellColor"] = prot.asc_setType;
prot["asc_setDxf"] = prot.asc_setVal;
window["Asc"]["Top10"] = window["Asc"].Top10 = Top10;
prot = Top10.prototype;
prot["asc_getFilterVal"] = prot.asc_getFilterVal;
prot["asc_getPercent"] = prot.asc_getPercent;
prot["asc_getTop"] = prot.asc_getTop;
prot["asc_getVal"] = prot.asc_getVal;
prot["asc_setFilterVal"] = prot.asc_setFilterVal;
prot["asc_setPercent"] = prot.asc_setPercent;
prot["asc_setTop"] = prot.asc_setTop;
prot["asc_setVal"] = prot.asc_setVal;
\ No newline at end of file
...@@ -16,23 +16,23 @@ var maxIndividualValues = 10000; ...@@ -16,23 +16,23 @@ var maxIndividualValues = 10000;
* ----------------------------------------------------------------------------- * -----------------------------------------------------------------------------
*/ */
var prot; var prot;
var startRedo = false;
var g_oAutoFiltersOptionsElementsProperties = { var g_oAutoFiltersOptionsElementsProperties = {
val : 0, val : 0,
visible : 1 visible : 1,
text : 2,
isDateFormat: 3
}; };
function AutoFiltersOptionsElements (val, visible) { function AutoFiltersOptionsElements () {
if ( !(this instanceof AutoFiltersOptionsElements) ) {return new AutoFiltersOptionsElements(val, visible);} if ( !(this instanceof AutoFiltersOptionsElements) ) {return new AutoFiltersOptionsElements();}
this.Properties = g_oAutoFiltersOptionsElementsProperties; this.Properties = g_oAutoFiltersOptionsElementsProperties;
this.val = val; this.val = null;
this.val2 = null; this.text = null;
this.visible = visible; this.visible = null;
this.rep = null; this.isDateFormat = null;
} }
AutoFiltersOptionsElements.prototype = { AutoFiltersOptionsElements.prototype = {
constructor: AutoFiltersOptionsElements, constructor: AutoFiltersOptionsElements,
...@@ -46,6 +46,8 @@ var maxIndividualValues = 10000; ...@@ -46,6 +46,8 @@ var maxIndividualValues = 10000;
switch (nType) { switch (nType) {
case this.Properties.val: return this.val; break; case this.Properties.val: return this.val; break;
case this.Properties.visible: return this.visible; break; case this.Properties.visible: return this.visible; break;
case this.Properties.text: return this.text; break;
case this.Properties.isDateFormat: return this.isDateFormat; break;
} }
return null; return null;
...@@ -54,6 +56,8 @@ var maxIndividualValues = 10000; ...@@ -54,6 +56,8 @@ var maxIndividualValues = 10000;
switch (nType) { switch (nType) {
case this.Properties.val: this.val = value;break; case this.Properties.val: this.val = value;break;
case this.Properties.visible: this.visible = value;break; case this.Properties.visible: this.visible = value;break;
case this.Properties.text: this.text = value;break;
case this.Properties.isDateFormat: this.isDateFormat = value;break;
} }
}, },
...@@ -62,10 +66,9 @@ var maxIndividualValues = 10000; ...@@ -62,10 +66,9 @@ var maxIndividualValues = 10000;
var res = new AutoFiltersOptionsElements(); var res = new AutoFiltersOptionsElements();
res.val = this.val; res.val = this.val;
res.val2 = this.val2; res.text = this.text;
res.visible = this.visible; res.visible = this.visible;
res.rep = this.rep; res.isDateFormat = this.isDateFormat;
res.And = this.And;
res.Properties = this.Properties; res.Properties = this.Properties;
return res; return res;
...@@ -73,8 +76,13 @@ var maxIndividualValues = 10000; ...@@ -73,8 +76,13 @@ var maxIndividualValues = 10000;
asc_getVal: function () { return this.val; }, asc_getVal: function () { return this.val; },
asc_getVisible: function () { return this.visible; }, asc_getVisible: function () { return this.visible; },
asc_getText: function () { return this.text; },
asc_getIsDateFormat: function () { return this.isDateFormat; },
asc_setVal: function (val) { this.val = val; }, asc_setVal: function (val) { this.val = val; },
asc_setVisible: function (val) { this.visible = val; } asc_setVisible: function (val) { this.visible = val; },
asc_setText: function (val) { this.text = val; },
asc_setIsDateFormat: function (val) { this.isDateFormat = val; }
}; };
/** @constructor */ /** @constructor */
...@@ -86,7 +94,6 @@ var maxIndividualValues = 10000; ...@@ -86,7 +94,6 @@ var maxIndividualValues = 10000;
this.type = options.type; this.type = options.type;
this.image = options.image; this.image = options.image;
} }
formatTablePictures.prototype = { formatTablePictures.prototype = {
constructor: formatTablePictures, constructor: formatTablePictures,
...@@ -95,21 +102,11 @@ var maxIndividualValues = 10000; ...@@ -95,21 +102,11 @@ var maxIndividualValues = 10000;
asc_getType: function () { return this.type; }, asc_getType: function () { return this.type; },
asc_getImage: function () { return this.image; } asc_getImage: function () { return this.image; }
}; };
var g_oAutoFiltersOptionsProperties = { var g_oAutoFiltersOptionsProperties = {
cellId : 0, cellId : 0,
result : 1, values : 1,
filter1 : 2, filter : 2
filter2 : 3,
valFilter1 : 4,
valFilter2 : 5,
isChecked : 6,
left : 7,
top : 8,
sortVal : 9,
width : 10,
height : 11,
isCustomFilter: 12,
dates: 13
}; };
function AutoFiltersOptions () { function AutoFiltersOptions () {
...@@ -118,22 +115,12 @@ var maxIndividualValues = 10000; ...@@ -118,22 +115,12 @@ var maxIndividualValues = 10000;
this.Properties = g_oAutoFiltersOptionsProperties; this.Properties = g_oAutoFiltersOptionsProperties;
this.cellId = null; this.cellId = null;
this.result = null; this.values = null;
this.dates = null; this.filter = null;
this.isCustomFilter = null;
this.filter1 = null;
this.filter2 = null;
this.valFilter1 = null;
this.valFilter2 = null;
this.isChecked = null;
this.left = null;
this.top = null;
this.sortVal = null; this.sortVal = null;
this.width = null;
this.height = null;
return this; return this;
} }
AutoFiltersOptions.prototype = { AutoFiltersOptions.prototype = {
constructor: AutoFiltersOptions, constructor: AutoFiltersOptions,
...@@ -146,19 +133,8 @@ var maxIndividualValues = 10000; ...@@ -146,19 +133,8 @@ var maxIndividualValues = 10000;
getProperty : function (nType) { getProperty : function (nType) {
switch (nType) { switch (nType) {
case this.Properties.cellId: return this.cellId; break; case this.Properties.cellId: return this.cellId; break;
case this.Properties.result: return this.result; break; case this.Properties.values: return this.values; break;
case this.Properties.dates: return this.dates; break; case this.Properties.filter: return this.filter; break;
case this.Properties.filter1: return this.filter1; break;
case this.Properties.filter2: return this.filter2; break;
case this.Properties.valFilter1: return this.valFilter1; break;
case this.Properties.valFilter2: return this.valFilter2; break;
case this.Properties.isChecked: return this.isChecked; break;
case this.Properties.left: return this.left; break;
case this.Properties.top: return this.top; break;
case this.Properties.sortVal: return this.sortVal; break;
case this.Properties.width: return this.width; break;
case this.Properties.height: return this.height; break;
case this.Properties.isCustomFilter: return this.isCustomFilter; break;
} }
return null; return null;
...@@ -166,52 +142,68 @@ var maxIndividualValues = 10000; ...@@ -166,52 +142,68 @@ var maxIndividualValues = 10000;
setProperty : function (nType, value) { setProperty : function (nType, value) {
switch (nType) { switch (nType) {
case this.Properties.cellId: this.cellId = value;break; case this.Properties.cellId: this.cellId = value;break;
case this.Properties.result: this.result = value;break; case this.Properties.values: this.values = value;break;
case this.Properties.dates: this.dates = value;break; case this.Properties.filter: this.filter = value;break;
case this.Properties.filter1: this.filter1 = value;break;
case this.Properties.filter2: this.filter2 = value;break;
case this.Properties.valFilter1: this.valFilter1 = value;break;
case this.Properties.valFilter2: this.valFilter2 = value;break;
case this.Properties.isChecked: this.isChecked = value;break;
case this.Properties.left: this.left = value;break;
case this.Properties.top: this.top = value;break;
case this.Properties.sortVal: this.sortVal = value;break;
case this.Properties.width: this.width = value;break;
case this.Properties.height: this.height = value;break;
case this.Properties.isCustomFilter: this.isCustomFilter = value;break;
} }
}, },
asc_setCellId : function(cellId) { this.cellId = cellId;}, asc_setCellId : function(cellId) { this.cellId = cellId;},
asc_setResult : function(result) { this.result = result; }, asc_setValues : function(values) { this.values = values; },
asc_setDates : function(dates) { this.dates = dates; }, asc_setFilter : function(filter) { this.filter = filter; },
asc_setIsCustomFilter: function(isCustomFilter){this.isCustomFilter = isCustomFilter},
asc_setFilter1 : function(filter1) { this.filter1 = filter1; },
asc_setFilter2 : function(filter2) { this.filter2 = filter2; },
asc_setValFilter1 : function(valFilter1) { this.valFilter1 = valFilter1; },
asc_setValFilter2 : function(valFilter2) { this.valFilter2 = valFilter2; },
asc_setIsChecked : function(isChecked) { this.isChecked = isChecked; },
asc_setY : function(top) { this.top = top; },
asc_setX : function(left) { this.left = left; },
asc_setWidth : function(width) { this.width = width; },
asc_setHeight : function(height) { this.height = height; },
asc_setSortState : function(sortVal) { this.sortVal = sortVal; }, asc_setSortState : function(sortVal) { this.sortVal = sortVal; },
asc_getCellId : function() { return this.cellId; }, asc_getCellId : function() { return this.cellId; },
asc_getY : function() { return this.top; }, asc_getValues : function() { return this.values; },
asc_getX : function() { return this.left; }, asc_getFilter : function() { return this.filter; },
asc_getWidth : function() { return this.width; },
asc_getHeight : function() { return this.height; },
asc_getResult : function() { return this.result; },
asc_getDates : function() { return this.dates; },
asc_getIsCustomFilter : function() { return this.isCustomFilter; },
asc_getFilter1 : function() { return this.filter1; },
asc_getFilter2 : function() { return this.filter2; },
asc_getValFilter1 : function() { return this.valFilter1; },
asc_getValFilter2 : function() { return this.valFilter2; },
asc_getIsChecked : function() { return this.isChecked; },
asc_getSortState : function() { return this.sortVal; } asc_getSortState : function() { return this.sortVal; }
}; };
var g_oAutoFilterObj = {
type : 0,
filter : 1
};
function AutoFilterObj () {
if ( !(this instanceof AutoFilterObj) ) {return new AutoFilterObj();}
this.Properties = g_oAutoFilterObj;
this.type = null;
this.filter = null;
return this;
}
AutoFilterObj.prototype = {
constructor: AutoFilterObj,
getType : function () {
return UndoRedoDataTypes.AutoFilterObj;
},
getProperties : function () {
return this.Properties;
},
getProperty : function (nType) {
switch (nType) {
case this.Properties.type: return this.type; break;
case this.Properties.filter: return this.filter; break;
}
return null;
},
setProperty : function (nType, value) {
switch (nType) {
case this.Properties.type: this.type = value;break;
case this.Properties.filter: this.filter = value;break;
}
},
asc_setType : function(type) { this.type = type;},
asc_setFilter : function(filter) { this.filter = filter;},
asc_getType : function() { return this.type; },
asc_getFilter : function() { return this.filter; }
};
var g_oAddFormatTableOptionsProperties = { var g_oAddFormatTableOptionsProperties = {
range : 0, range : 0,
isTitle : 1 isTitle : 1
...@@ -226,7 +218,6 @@ var maxIndividualValues = 10000; ...@@ -226,7 +218,6 @@ var maxIndividualValues = 10000;
this.isTitle = null; this.isTitle = null;
return this; return this;
} }
AddFormatTableOptions.prototype = { AddFormatTableOptions.prototype = {
constructor: AddFormatTableOptions, constructor: AddFormatTableOptions,
getType : function () { getType : function () {
...@@ -278,10 +269,10 @@ var maxIndividualValues = 10000; ...@@ -278,10 +269,10 @@ var maxIndividualValues = 10000;
constructor: AutoFilters, constructor: AutoFilters,
addAutoFilter: function(lTable, activeRange, addFormatTableOptionsObj) addAutoFilter: function(styleName, activeRange, addFormatTableOptionsObj, offLock)
{ {
var aWs = this._getCurrentWS(), addNameColumn, filterRange, t = this, ws = this.worksheet, cloneFilter; var aWs = this._getCurrentWS(), addNameColumn, filterRange, t = this, ws = this.worksheet, cloneFilter;
var isTurnOffHistory = aWs.workbook.bUndoChanges || aWs.workbook.bRedoChanges ? true : false; var isTurnOffHistory = aWs.workbook.bUndoChanges || aWs.workbook.bRedoChanges;
var bWithoutFilter = false;//TODO изменить переменную var bWithoutFilter = false;//TODO изменить переменную
...@@ -290,7 +281,7 @@ var maxIndividualValues = 10000; ...@@ -290,7 +281,7 @@ var maxIndividualValues = 10000;
var tempRange = new Asc.Range(activeRange.c1, activeRange.r1, activeRange.c2, activeRange.r2); var tempRange = new Asc.Range(activeRange.c1, activeRange.r1, activeRange.c2, activeRange.r2);
if(addFormatTableOptionsObj === false) if(addFormatTableOptionsObj === false)
addNameColumn = true; addNameColumn = true;
else if(typeof addFormatTableOptionsObj == 'object') else if(addFormatTableOptionsObj && typeof addFormatTableOptionsObj == 'object')
{ {
tempRange = addFormatTableOptionsObj.asc_getRange(); tempRange = addFormatTableOptionsObj.asc_getRange();
addNameColumn = !addFormatTableOptionsObj.asc_getIsTitle(); addNameColumn = !addFormatTableOptionsObj.asc_getIsTitle();
...@@ -323,51 +314,50 @@ var maxIndividualValues = 10000; ...@@ -323,51 +314,50 @@ var maxIndividualValues = 10000;
if(tablePartsContainsRange) if(tablePartsContainsRange)
{ {
cloneFilter = tablePartsContainsRange.clone(aWs); cloneFilter = tablePartsContainsRange.clone(null);
tablePartsContainsRange.AutoFilter = new AutoFilter(); tablePartsContainsRange.AutoFilter = new AutoFilter();
tablePartsContainsRange.AutoFilter.Ref = tablePartsContainsRange.Ref.clone(); tablePartsContainsRange.AutoFilter.Ref = tablePartsContainsRange.Ref.clone();
//history //history
t._addHistoryObj(cloneFilter, historyitem_AutoFilter_Add, t._addHistoryObj(cloneFilter, historyitem_AutoFilter_Add,
{activeCells: activeRange, lTable: lTable}, null, cloneFilter.Ref); {activeCells: activeRange, styleName: styleName}, null, cloneFilter.Ref);
} }
else else
{ {
if(addNameColumn && !isTurnOffHistory) if(addNameColumn && !isTurnOffHistory)
aWs._moveRange(filterRange, new Asc.Range(filterRange.c1, filterRange.r1 + 1, filterRange.c2, filterRange.r2)); aWs._moveRange(filterRange, new Asc.Range(filterRange.c1, filterRange.r1 + 1, filterRange.c2, filterRange.r2));
if(lTable) if(styleName)
aWs.getRange3(filterRange.r1, filterRange.c1, filterRange.r2, filterRange.c2).unmerge(); aWs.getRange3(filterRange.r1, filterRange.c1, filterRange.r2, filterRange.c2).unmerge();
//add to model //add to model
t._addNewFilter(filterRange, lTable, bWithoutFilter); t._addNewFilter(filterRange, styleName, bWithoutFilter);
if(lTable) if(styleName)
t._setColorStyleTable(aWs.TableParts[aWs.TableParts.length - 1].Ref, aWs.TableParts[aWs.TableParts.length - 1], null, true); t._setColorStyleTable(aWs.TableParts[aWs.TableParts.length - 1].Ref, aWs.TableParts[aWs.TableParts.length - 1], null, true);
//history //history
t._addHistoryObj({Ref: filterRange}, historyitem_AutoFilter_Add, t._addHistoryObj({Ref: filterRange}, historyitem_AutoFilter_Add,
{activeCells: filterRange, lTable: lTable, addFormatTableOptionsObj: addFormatTableOptionsObj}, null, filterRange, bWithoutFilter); {activeCells: filterRange, styleName: styleName, addFormatTableOptionsObj: addFormatTableOptionsObj}, null, filterRange, bWithoutFilter);
} }
//updates //updates
ws._onUpdateFormatTable(filterRange, true, true); ws._onUpdateFormatTable(filterRange, true, true);
//t.drawAutoF(filterRange);
History.EndTransaction(); History.EndTransaction();
} };
//не лочим в случае обыкновенного а/ф //не лочим в случае обыкновенного а/ф
if(isTurnOffHistory || !lTable) if(isTurnOffHistory || !styleName || offLock)
addFilterCallBack(true); addFilterCallBack(true);
else else
ws._isLockedCells(filterRange, /*subType*/null, addFilterCallBack); ws._isLockedCells(filterRange, /*subType*/null, addFilterCallBack);
}, },
deleteAutoFilter: function(activeRange) deleteAutoFilter: function(activeRange, offLock)
{ {
var aWs = this._getCurrentWS(), addNameColumn, filterRange, t = this, ws = this.worksheet, cloneFilter; var aWs = this._getCurrentWS(), filterRange, t = this, ws = this.worksheet, cloneFilter;
var isTurnOffHistory = aWs.workbook.bUndoChanges || aWs.workbook.bRedoChanges ? true : false; var isTurnOffHistory = aWs.workbook.bUndoChanges || aWs.workbook.bRedoChanges;
activeRange = activeRange.clone(); activeRange = activeRange.clone();
//expand range //expand range
...@@ -386,7 +376,7 @@ var maxIndividualValues = 10000; ...@@ -386,7 +376,7 @@ var maxIndividualValues = 10000;
if(tablePartsContainsRange) if(tablePartsContainsRange)
{ {
cloneFilter = tablePartsContainsRange.clone(aWs); cloneFilter = tablePartsContainsRange.clone(null);
t._openHiddenRows(cloneFilter); t._openHiddenRows(cloneFilter);
tablePartsContainsRange.AutoFilter = null; tablePartsContainsRange.AutoFilter = null;
...@@ -408,20 +398,20 @@ var maxIndividualValues = 10000; ...@@ -408,20 +398,20 @@ var maxIndividualValues = 10000;
t.drawAutoF(filterRange); t.drawAutoF(filterRange);
History.EndTransaction(); History.EndTransaction();
} };
//не лочим в случае обыкновенного а/ф //не лочим в случае обыкновенного а/ф
if(isTurnOffHistory) if(isTurnOffHistory || offLock)
addFilterCallBack(true); addFilterCallBack(true);
else else
ws._isLockedCells(filterRange, /*subType*/null, addFilterCallBack); ws._isLockedCells(filterRange, /*subType*/null, addFilterCallBack);
}, },
changeTableStyleInfo: function(lTable, activeRange) changeTableStyleInfo: function(styleName, activeRange)
{ {
var aWs = this._getCurrentWS(), filterRange, t = this, ws = this.worksheet, cloneFilter; var aWs = this._getCurrentWS(), filterRange, t = this, ws = this.worksheet, cloneFilter;
var isTurnOffHistory = aWs.workbook.bUndoChanges || aWs.workbook.bRedoChanges ? true : false; var isTurnOffHistory = aWs.workbook.bUndoChanges || aWs.workbook.bRedoChanges;
activeRange = activeRange.clone(); activeRange = activeRange.clone();
...@@ -436,38 +426,57 @@ var maxIndividualValues = 10000; ...@@ -436,38 +426,57 @@ var maxIndividualValues = 10000;
History.Create_NewPoint(); History.Create_NewPoint();
History.StartTransaction(); History.StartTransaction();
cloneFilter = isTablePartsContainsRange.clone(aWs); cloneFilter = isTablePartsContainsRange.clone(null);
isTablePartsContainsRange.TableStyleInfo.Name = lTable; isTablePartsContainsRange.TableStyleInfo.Name = styleName;
t._setColorStyleTable(isTablePartsContainsRange.Ref, isTablePartsContainsRange); t._setColorStyleTable(isTablePartsContainsRange.Ref, isTablePartsContainsRange);
ws._onUpdateFormatTable(isTablePartsContainsRange.Ref, true, true); ws._onUpdateFormatTable(isTablePartsContainsRange.Ref, true, true);
//history //history
t._addHistoryObj(cloneFilter, historyitem_AutoFilter_ChangeTableStyle, t._addHistoryObj(cloneFilter, historyitem_AutoFilter_ChangeTableStyle,
{activeCells: activeRange, lTable: lTable}, null, filterRange); {activeCells: activeRange, styleName: styleName}, null, filterRange);
History.EndTransaction(); History.EndTransaction();
} };
//не лочим в случае обыкновенного а/ф //не лочим в случае обыкновенного а/ф
if(isTurnOffHistory || !lTable) if(isTurnOffHistory || !styleName)
addFilterCallBack(true); addFilterCallBack(true);
else else
ws._isLockedCells(filterRange, /*subType*/null, addFilterCallBack); ws._isLockedCells(filterRange, /*subType*/null, addFilterCallBack);
}, },
changeAutoFilterToTablePart: function(lTable, ar, addFormatTableOptionsObj) changeAutoFilterToTablePart: function(styleName, ar, addFormatTableOptionsObj)
{
var ws = this.worksheet;
var aWs = this._getCurrentWS();
var filterRange = aWs.AutoFilter.Ref.clone();
var t = this;
var addNameColumn = false;
if(addFormatTableOptionsObj === false)
addNameColumn = true;
else if(typeof addFormatTableOptionsObj == 'object')
addNameColumn = !addFormatTableOptionsObj.asc_getIsTitle();
if(addNameColumn)
filterRange.r2 = filterRange.r2 + 1;
var addFilterCallBack = function()
{ {
History.Create_NewPoint(); History.Create_NewPoint();
History.StartTransaction(); History.StartTransaction();
this.deleteAutoFilter(ar); t.deleteAutoFilter(ar, true);
this.addAutoFilter(lTable, ar, addFormatTableOptionsObj); t.addAutoFilter(styleName, ar, addFormatTableOptionsObj, true);
History.EndTransaction(); History.EndTransaction();
};
ws._isLockedCells(filterRange, /*subType*/null, addFilterCallBack);
}, },
applyAutoFilter: function (autoFiltersObject, ar) { applyAutoFilter: function (autoFiltersObject, ar) {
...@@ -481,11 +490,10 @@ var maxIndividualValues = 10000; ...@@ -481,11 +490,10 @@ var maxIndividualValues = 10000;
var currentFilter = filterObj.filter; var currentFilter = filterObj.filter;
//for history //for history
var oldFilter = filterObj.filter.clone(aWs); var oldFilter = filterObj.filter.clone(null);
History.Create_NewPoint(); History.Create_NewPoint();
History.StartTransaction(); History.StartTransaction();
//change model //change model
var autoFilter = filterObj.filter; var autoFilter = filterObj.filter;
if(filterObj.filter.TableStyleInfo !== undefined) if(filterObj.filter.TableStyleInfo !== undefined)
...@@ -513,7 +521,7 @@ var maxIndividualValues = 10000; ...@@ -513,7 +521,7 @@ var maxIndividualValues = 10000;
{ {
var isHidden = false; var isHidden = false;
if(currentFilter.FilterColumns && currentFilter.FilterColumns.length) if(currentFilter.FilterColumns && currentFilter.FilterColumns.length)
isHidden = this._hiddenAnotherFilter(currentFilter.FilterColumns, filterObj.ColId, i, currentFilter.Ref.c1) isHidden = this._hiddenAnotherFilter(currentFilter.FilterColumns, filterObj.ColId, i, currentFilter.Ref.c1);
if(!isHidden) if(!isHidden)
{ {
...@@ -540,14 +548,14 @@ var maxIndividualValues = 10000; ...@@ -540,14 +548,14 @@ var maxIndividualValues = 10000;
console.timeEnd("_applyMainFilter2"); console.timeEnd("_applyMainFilter2");
}, },
checkAddAutoFilter: function(activeRange, lTable) checkAddAutoFilter: function(activeRange, styleName)
{ {
//write error, if not add autoFilter and return false //write error, if not add autoFilter and return false
var result = true; var result = true;
var aWs = this._getCurrentWS(); var aWs = this._getCurrentWS();
var filter = aWs.AutoFilter; var filter = aWs.AutoFilter;
if(filter && lTable && filter.Ref.isIntersect(activeRange) && !(filter.Ref.containsRange(activeRange) && (activeRange.isOneCell() || (filter.Ref.isEqual(activeRange))))) if(filter && styleName && filter.Ref.isIntersect(activeRange) && !(filter.Ref.containsRange(activeRange) && (activeRange.isOneCell() || (filter.Ref.isEqual(activeRange)))))
{ {
aWs.workbook.handlers.trigger("asc_onError", c_oAscError.ID.AutoFilterDataRangeError, c_oAscError.Level.NoCritical); aWs.workbook.handlers.trigger("asc_onError", c_oAscError.ID.AutoFilterDataRangeError, c_oAscError.Level.NoCritical);
result = false; result = false;
...@@ -559,8 +567,6 @@ var maxIndividualValues = 10000; ...@@ -559,8 +567,6 @@ var maxIndividualValues = 10000;
checkCursor: function (x, y, offsetX, offsetY, frozenObj, r, c) { checkCursor: function (x, y, offsetX, offsetY, frozenObj, r, c) {
var ws = this.worksheet; var ws = this.worksheet;
var aWs = this._getCurrentWS(); var aWs = this._getCurrentWS();
var width = 11.25;
var height = 11.25;
var result = false; var result = false;
var checkFrozenArea = this._checkClickFrozenArea(x, y, offsetX, offsetY, frozenObj); var checkFrozenArea = this._checkClickFrozenArea(x, y, offsetX, offsetY, frozenObj);
...@@ -600,7 +606,7 @@ var maxIndividualValues = 10000; ...@@ -600,7 +606,7 @@ var maxIndividualValues = 10000;
} }
} }
} }
} };
if(aWs.AutoFilter && aWs.AutoFilter.Ref) if(aWs.AutoFilter && aWs.AutoFilter.Ref)
...@@ -675,7 +681,7 @@ var maxIndividualValues = 10000; ...@@ -675,7 +681,7 @@ var maxIndividualValues = 10000;
isSetFilter: isSetFilter, isSetFilter: isSetFilter,
row: row, row: row,
col: col col: col
} };
var width = 13; var width = 13;
var height = 13; var height = 13;
var rowHeight = ws.rows[row].height; var rowHeight = ws.rows[row].height;
...@@ -691,7 +697,7 @@ var maxIndividualValues = 10000; ...@@ -691,7 +697,7 @@ var maxIndividualValues = 10000;
} }
} }
} }
} };
if(aWs.AutoFilter) if(aWs.AutoFilter)
{ {
...@@ -736,7 +742,7 @@ var maxIndividualValues = 10000; ...@@ -736,7 +742,7 @@ var maxIndividualValues = 10000;
displayName: customStyles[i].displayName, displayName: customStyles[i].displayName,
type: 'custom', type: 'custom',
image: this._drawSmallIconTable(canvas, customStyles[i], fmgrGraphics, oFont) image: this._drawSmallIconTable(canvas, customStyles[i], fmgrGraphics, oFont)
} };
result[n] = new formatTablePictures(options); result[n] = new formatTablePictures(options);
n++; n++;
} }
...@@ -755,7 +761,7 @@ var maxIndividualValues = 10000; ...@@ -755,7 +761,7 @@ var maxIndividualValues = 10000;
displayName: defaultStyles[i].displayName, displayName: defaultStyles[i].displayName,
type: 'default', type: 'default',
image: this._drawSmallIconTable(canvas, defaultStyles[i], fmgrGraphics, oFont) image: this._drawSmallIconTable(canvas, defaultStyles[i], fmgrGraphics, oFont)
} };
result[n] = new formatTablePictures(options); result[n] = new formatTablePictures(options);
n++; n++;
} }
...@@ -785,8 +791,6 @@ var maxIndividualValues = 10000; ...@@ -785,8 +791,6 @@ var maxIndividualValues = 10000;
{ {
var aWs = this._getCurrentWS(); var aWs = this._getCurrentWS();
var containRangeId = -1, tableRange; var containRangeId = -1, tableRange;
var tableParts = aWs.TableParts;
if(tableParts) if(tableParts)
{ {
for(var i = 0; i < tableParts.length; ++i) for(var i = 0; i < tableParts.length; ++i)
...@@ -801,6 +805,8 @@ var maxIndividualValues = 10000; ...@@ -801,6 +805,8 @@ var maxIndividualValues = 10000;
} }
} }
var tableParts = aWs.TableParts;
//если выделена часть форматир. таблицы, то отправляем -2 //если выделена часть форматир. таблицы, то отправляем -2
//если форматировання таблица содержит данный диапазон, то id //если форматировання таблица содержит данный диапазон, то id
//если диапазон не затрагивает форматированную таблицу, то -1 //если диапазон не затрагивает форматированную таблицу, то -1
...@@ -924,17 +930,16 @@ var maxIndividualValues = 10000; ...@@ -924,17 +930,16 @@ var maxIndividualValues = 10000;
// Redo // Redo
Redo: function (type, data) { Redo: function (type, data) {
startRedo = true;
History.TurnOff(); History.TurnOff();
switch (type) { switch (type) {
case historyitem_AutoFilter_Add: case historyitem_AutoFilter_Add:
this.addAutoFilter(data.lTable, data.activeCells, data.addFormatTableOptionsObj, data.bWithoutFilter); this.addAutoFilter(data.styleName, data.activeCells, data.addFormatTableOptionsObj, data.bWithoutFilter);
break; break;
case historyitem_AutoFilter_Delete: case historyitem_AutoFilter_Delete:
this.deleteAutoFilter(data.activeCells); this.deleteAutoFilter(data.activeCells);
break; break;
case historyitem_AutoFilter_ChangeTableStyle: case historyitem_AutoFilter_ChangeTableStyle:
this.changeTableStyleInfo(data.lTable, data.activeCells); this.changeTableStyleInfo(data.styleName, data.activeCells);
break; break;
case historyitem_AutoFilter_Sort: case historyitem_AutoFilter_Sort:
this.sortColFilter(data.type, data.cellId, data.activeCells, true); this.sortColFilter(data.type, data.cellId, data.activeCells, true);
...@@ -952,7 +957,6 @@ var maxIndividualValues = 10000; ...@@ -952,7 +957,6 @@ var maxIndividualValues = 10000;
this.isApplyAutoFilterInCell(data.activeCells, true); this.isApplyAutoFilterInCell(data.activeCells, true);
break; break;
} }
startRedo = false;
History.TurnOn(); History.TurnOn();
}, },
...@@ -962,7 +966,7 @@ var maxIndividualValues = 10000; ...@@ -962,7 +966,7 @@ var maxIndividualValues = 10000;
data = data.undo; data = data.undo;
var cloneData; var cloneData;
if(data.clone) if(data.clone)
cloneData = data.clone(aWs); cloneData = data.clone(null);
else else
cloneData = data; cloneData = data;
...@@ -1044,7 +1048,7 @@ var maxIndividualValues = 10000; ...@@ -1044,7 +1048,7 @@ var maxIndividualValues = 10000;
{ {
if(aWs.AutoFilter && cloneData.newFilterRef && cloneData.newFilterRef.isEqual(aWs.AutoFilter.Ref)) if(aWs.AutoFilter && cloneData.newFilterRef && cloneData.newFilterRef.isEqual(aWs.AutoFilter.Ref))
{ {
aWs.AutoFilter = cloneData.oldFilter.clone(aWs); aWs.AutoFilter = cloneData.oldFilter.clone(null);
} }
else if(aWs.TableParts) else if(aWs.TableParts)
{ {
...@@ -1054,7 +1058,7 @@ var maxIndividualValues = 10000; ...@@ -1054,7 +1058,7 @@ var maxIndividualValues = 10000;
{ {
var isIntersectionTableParts = this._isIntersectionTableParts(aWs.TableParts[l].Ref); var isIntersectionTableParts = this._isIntersectionTableParts(aWs.TableParts[l].Ref);
aWs.TableParts[l] = cloneData.oldFilter.clone(aWs); aWs.TableParts[l] = cloneData.oldFilter.clone(null);
var splitRange = cloneData.oldFilter.Ref; var splitRange = cloneData.oldFilter.Ref;
...@@ -1196,7 +1200,7 @@ var maxIndividualValues = 10000; ...@@ -1196,7 +1200,7 @@ var maxIndividualValues = 10000;
var k = 0; var k = 0;
for(var i = 0; i < aWs.TableParts.length; i++) for(var i = 0; i < aWs.TableParts.length; i++)
{ {
var oCurFilter = aWs.TableParts[i].clone(aWs); var oCurFilter = aWs.TableParts[i].clone(null);
var oRange = Range.prototype.createFromBBox(aWs, oCurFilter.Ref); var oRange = Range.prototype.createFromBBox(aWs, oCurFilter.Ref);
if(insCells) if(insCells)
oCurFilter.insCells = true; oCurFilter.insCells = true;
...@@ -1317,13 +1321,13 @@ var maxIndividualValues = 10000; ...@@ -1317,13 +1321,13 @@ var maxIndividualValues = 10000;
{ {
if(activeRange.c1 <= ref.c1)//until if(activeRange.c1 <= ref.c1)//until
{ {
oldFilter = aWs.AutoFilter.clone(aWs); oldFilter = aWs.AutoFilter.clone(null);
aWs.AutoFilter.Ref = new Asc.Range(ref.c1 + diff, ref.r1, ref.c2 + diff, ref.r2); aWs.AutoFilter.Ref = new Asc.Range(ref.c1 + diff, ref.r1, ref.c2 + diff, ref.r2);
} }
else if(activeRange.c1 > ref.c1 && activeRange.c1 <= ref.c2)//inside else if(activeRange.c1 > ref.c1 && activeRange.c1 <= ref.c2)//inside
{ {
oldFilter = aWs.AutoFilter.clone(aWs); oldFilter = aWs.AutoFilter.clone(null);
aWs.AutoFilter.Ref = new Asc.Range(ref.c1, ref.r1, ref.c2 + diff, ref.r2); aWs.AutoFilter.Ref = new Asc.Range(ref.c1, ref.r1, ref.c2 + diff, ref.r2);
} }
...@@ -1345,7 +1349,7 @@ var maxIndividualValues = 10000; ...@@ -1345,7 +1349,7 @@ var maxIndividualValues = 10000;
{ {
oldFilter: oldFilter, oldFilter: oldFilter,
newFilterRef: aWs.AutoFilter.Ref.clone() newFilterRef: aWs.AutoFilter.Ref.clone()
} };
this._addHistoryObj(changeElement, null, null, true, oldFilter.Ref, null, true); this._addHistoryObj(changeElement, null, null, true, oldFilter.Ref, null, true);
} }
} }
...@@ -1359,7 +1363,7 @@ var maxIndividualValues = 10000; ...@@ -1359,7 +1363,7 @@ var maxIndividualValues = 10000;
{ {
if(activeRange.c1 <= ref.c1)//until if(activeRange.c1 <= ref.c1)//until
{ {
oldFilter = tableParts[i].clone(aWs); oldFilter = tableParts[i].clone(null);
tableParts[i].Ref = new Asc.Range(ref.c1 + diff, ref.r1, ref.c2 + diff, ref.r2); tableParts[i].Ref = new Asc.Range(ref.c1 + diff, ref.r1, ref.c2 + diff, ref.r2);
if(tableParts[i].AutoFilter) if(tableParts[i].AutoFilter)
...@@ -1367,7 +1371,7 @@ var maxIndividualValues = 10000; ...@@ -1367,7 +1371,7 @@ var maxIndividualValues = 10000;
} }
else if(activeRange.c1 > ref.c1 && activeRange.c1 <= ref.c2)//inside else if(activeRange.c1 > ref.c1 && activeRange.c1 <= ref.c2)//inside
{ {
oldFilter = tableParts[i].clone(aWs); oldFilter = tableParts[i].clone(null);
tableParts[i].Ref = new Asc.Range(ref.c1, ref.r1, ref.c2 + diff, ref.r2); tableParts[i].Ref = new Asc.Range(ref.c1, ref.r1, ref.c2 + diff, ref.r2);
if(tableParts[i].AutoFilter) if(tableParts[i].AutoFilter)
...@@ -1425,7 +1429,7 @@ var maxIndividualValues = 10000; ...@@ -1425,7 +1429,7 @@ var maxIndividualValues = 10000;
{ {
oldFilter: oldFilter, oldFilter: oldFilter,
newFilterRef: tableParts[i].Ref.clone() newFilterRef: tableParts[i].Ref.clone()
} };
this._addHistoryObj(changeElement, null, null, true, oldFilter.Ref, null, true); this._addHistoryObj(changeElement, null, null, true, oldFilter.Ref, null, true);
} }
} }
...@@ -1454,20 +1458,21 @@ var maxIndividualValues = 10000; ...@@ -1454,20 +1458,21 @@ var maxIndividualValues = 10000;
this.isEmptyAutoFilters(activeRange); this.isEmptyAutoFilters(activeRange);
//change autoFilter //change autoFilter
var ref, changeElement;
if(aWs.AutoFilter) if(aWs.AutoFilter)
{ {
var ref = aWs.AutoFilter.Ref; ref = aWs.AutoFilter.Ref;
if(activeRange.c1 <= ref.c1 && activeRange.c2 >= ref.c2) if(activeRange.c1 <= ref.c1 && activeRange.c2 >= ref.c2)
{ {
if(activeRange.r1 <= ref.r1)//until if(activeRange.r1 <= ref.r1)//until
{ {
oldFilter = aWs.AutoFilter.clone(aWs); oldFilter = aWs.AutoFilter.clone(null);
aWs.AutoFilter.Ref = new Asc.Range(ref.c1, ref.r1 + diff, ref.c2, ref.r2 + diff); aWs.AutoFilter.Ref = new Asc.Range(ref.c1, ref.r1 + diff, ref.c2, ref.r2 + diff);
} }
else if(activeRange.r1 > ref.r1 && activeRange.r1 <= ref.r2)//inside else if(activeRange.r1 > ref.r1 && activeRange.r1 <= ref.r2)//inside
{ {
oldFilter = aWs.AutoFilter.clone(aWs); oldFilter = aWs.AutoFilter.clone(null);
aWs.AutoFilter.Ref = new Asc.Range(ref.c1, ref.r1, ref.c2, ref.r2 + diff); aWs.AutoFilter.Ref = new Asc.Range(ref.c1, ref.r1, ref.c2, ref.r2 + diff);
} }
...@@ -1475,11 +1480,11 @@ var maxIndividualValues = 10000; ...@@ -1475,11 +1480,11 @@ var maxIndividualValues = 10000;
if(!bUndoChanges && !bRedoChanges /*&& !notAddToHistory*/ && oldFilter) if(!bUndoChanges && !bRedoChanges /*&& !notAddToHistory*/ && oldFilter)
{ {
var changeElement = changeElement =
{ {
oldFilter: oldFilter, oldFilter: oldFilter,
newFilterRef: aWs.AutoFilter.Ref.clone() newFilterRef: aWs.AutoFilter.Ref.clone()
} };
this._addHistoryObj(changeElement, null, null, true, oldFilter.Ref, null, true); this._addHistoryObj(changeElement, null, null, true, oldFilter.Ref, null, true);
} }
} }
...@@ -1488,12 +1493,12 @@ var maxIndividualValues = 10000; ...@@ -1488,12 +1493,12 @@ var maxIndividualValues = 10000;
var tableParts = aWs.TableParts; var tableParts = aWs.TableParts;
for(var i = 0; i < tableParts.length; i++) for(var i = 0; i < tableParts.length; i++)
{ {
var ref = tableParts[i].Ref; ref = tableParts[i].Ref;
if(activeRange.c1 <= ref.c1 && activeRange.c2 >= ref.c2) if(activeRange.c1 <= ref.c1 && activeRange.c2 >= ref.c2)
{ {
if(activeRange.r1 <= ref.r1)//until if(activeRange.r1 <= ref.r1)//until
{ {
oldFilter = tableParts[i].clone(aWs); oldFilter = tableParts[i].clone(null);
tableParts[i].Ref = new Asc.Range(ref.c1, ref.r1 + diff, ref.c2, ref.r2 + diff); tableParts[i].Ref = new Asc.Range(ref.c1, ref.r1 + diff, ref.c2, ref.r2 + diff);
if(tableParts[i].AutoFilter) if(tableParts[i].AutoFilter)
...@@ -1501,7 +1506,7 @@ var maxIndividualValues = 10000; ...@@ -1501,7 +1506,7 @@ var maxIndividualValues = 10000;
} }
else if(activeRange.r1 > ref.r1 && activeRange.r1 <= ref.r2)//inside else if(activeRange.r1 > ref.r1 && activeRange.r1 <= ref.r2)//inside
{ {
oldFilter = tableParts[i].clone(aWs); oldFilter = tableParts[i].clone(null);
tableParts[i].Ref = new Asc.Range(ref.c1, ref.r1, ref.c2, ref.r2 + diff); tableParts[i].Ref = new Asc.Range(ref.c1, ref.r1, ref.c2, ref.r2 + diff);
if(tableParts[i].AutoFilter) if(tableParts[i].AutoFilter)
...@@ -1514,11 +1519,11 @@ var maxIndividualValues = 10000; ...@@ -1514,11 +1519,11 @@ var maxIndividualValues = 10000;
if(!bUndoChanges && !bRedoChanges /*&& !notAddToHistory*/ && oldFilter) if(!bUndoChanges && !bRedoChanges /*&& !notAddToHistory*/ && oldFilter)
{ {
var changeElement = changeElement =
{ {
oldFilter: oldFilter, oldFilter: oldFilter,
newFilterRef: tableParts[i].Ref.clone() newFilterRef: tableParts[i].Ref.clone()
} };
this._addHistoryObj(changeElement, null, null, true, oldFilter.Ref, null, true); this._addHistoryObj(changeElement, null, null, true, oldFilter.Ref, null, true);
} }
} }
...@@ -1545,7 +1550,7 @@ var maxIndividualValues = 10000; ...@@ -1545,7 +1550,7 @@ var maxIndividualValues = 10000;
History.Create_NewPoint(); History.Create_NewPoint();
History.StartTransaction(); History.StartTransaction();
var oldFilter = curFilter.clone(aWs); var oldFilter = curFilter.clone(null);
//изменяем содержимое фильтра //изменяем содержимое фильтра
if(!curFilter.SortState) if(!curFilter.SortState)
...@@ -1581,15 +1586,12 @@ var maxIndividualValues = 10000; ...@@ -1581,15 +1586,12 @@ var maxIndividualValues = 10000;
if(isTurnOffHistory) if(isTurnOffHistory)
History.TurnOn(); History.TurnOn();
} }
} };
if(cellId) if(cellId)
activeRange = t._idToRange(cellId); activeRange = t._idToRange(cellId);
if(type == 'ascending') type = type == 'ascending';
type = true;
else
type = false;
var filter = t.searchRangeInTableParts(activeRange); var filter = t.searchRangeInTableParts(activeRange);
if(filter === -2)//если захвачена часть ф/т if(filter === -2)//если захвачена часть ф/т
...@@ -1712,7 +1714,7 @@ var maxIndividualValues = 10000; ...@@ -1712,7 +1714,7 @@ var maxIndividualValues = 10000;
{ {
if(!oCurFilter) if(!oCurFilter)
oCurFilter = []; oCurFilter = [];
oCurFilter[i] = findFilters[i].clone(aWs); oCurFilter[i] = findFilters[i].clone(null);
ref = findFilters[i].Ref; ref = findFilters[i].Ref;
range = ref; range = ref;
newRange = Asc.Range(range.c1 + diffCol, range.r1 + diffRow, range.c2 + diffCol, range.r2 + diffRow); newRange = Asc.Range(range.c1 + diffCol, range.r1 + diffRow, range.c2 + diffCol, range.r2 + diffRow);
...@@ -1776,19 +1778,21 @@ var maxIndividualValues = 10000; ...@@ -1776,19 +1778,21 @@ var maxIndividualValues = 10000;
//if active range intersect even a part tablePart(for insert(delete) cells) //if active range intersect even a part tablePart(for insert(delete) cells)
isActiveCellsCrossHalfFTable: function(activeCells, val, prop) isActiveCellsCrossHalfFTable: function(activeCells, val, prop)
{ {
var InsertCellsAndShiftDown = (val == c_oAscInsertOptions.InsertCellsAndShiftDown && prop == 'insCell') ? true : false; var InsertCellsAndShiftDown = val == c_oAscInsertOptions.InsertCellsAndShiftDown && prop == 'insCell';
var InsertCellsAndShiftRight = (val == c_oAscInsertOptions.InsertCellsAndShiftRight && prop == 'insCell') ? true : false; var InsertCellsAndShiftRight = val == c_oAscInsertOptions.InsertCellsAndShiftRight && prop == 'insCell';
var DeleteCellsAndShiftLeft = (val == c_oAscDeleteOptions.DeleteCellsAndShiftLeft && prop == 'delCell') ? true : false; var DeleteCellsAndShiftLeft = val == c_oAscDeleteOptions.DeleteCellsAndShiftLeft && prop == 'delCell';
var DeleteCellsAndShiftTop = (val == c_oAscDeleteOptions.DeleteCellsAndShiftTop && prop == 'delCell') ? true : false; var DeleteCellsAndShiftTop = val == c_oAscDeleteOptions.DeleteCellsAndShiftTop && prop == 'delCell';
var DeleteColumns = (val == c_oAscDeleteOptions.DeleteColumns && prop == 'delCell') ? true : false; var DeleteColumns = val == c_oAscDeleteOptions.DeleteColumns && prop == 'delCell';
var DeleteRows = (val == c_oAscDeleteOptions.DeleteRows && prop == 'delCell') ? true : false; var DeleteRows = val == c_oAscDeleteOptions.DeleteRows && prop == 'delCell';
var aWs = this._getCurrentWS(); var aWs = this._getCurrentWS();
var tableParts = aWs.TableParts; var tableParts = aWs.TableParts;
var autoFilter = aWs.AutoFilter; var autoFilter = aWs.AutoFilter;
var result = null; var result = null;
var tableRange;
var isExp;
if(DeleteColumns || DeleteRows) if(DeleteColumns || DeleteRows)
{ {
//меняем активную область //меняем активную область
...@@ -1804,8 +1808,7 @@ var maxIndividualValues = 10000; ...@@ -1804,8 +1808,7 @@ var maxIndividualValues = 10000;
//если активной областью захвачена полнотью форматированная таблица(или её часть) + часть форматированной таблицы - выдаём ошибку //если активной областью захвачена полнотью форматированная таблица(или её часть) + часть форматированной таблицы - выдаём ошибку
if(tableParts) if(tableParts)
{ {
var tableRange; isExp = false;
var isExp = false;
var isPart = false; var isPart = false;
for(var i = 0; i < tableParts.length; i++ ) for(var i = 0; i < tableParts.length; i++ )
{ {
...@@ -1866,8 +1869,6 @@ var maxIndividualValues = 10000; ...@@ -1866,8 +1869,6 @@ var maxIndividualValues = 10000;
//проверка на то, что захвачен кусок форматированной таблицы //проверка на то, что захвачен кусок форматированной таблицы
if(tableParts)//при удалении в MS Excel ошибка может возникать только в случае форматированных таблиц if(tableParts)//при удалении в MS Excel ошибка может возникать только в случае форматированных таблиц
{ {
var tableRange;
var isExp;
for(var i = 0; i < tableParts.length; i++ ) for(var i = 0; i < tableParts.length; i++ )
{ {
tableRange = tableParts[i].Ref; tableRange = tableParts[i].Ref;
...@@ -2093,7 +2094,7 @@ var maxIndividualValues = 10000; ...@@ -2093,7 +2094,7 @@ var maxIndividualValues = 10000;
if(redoObject) if(redoObject)
{ {
oHistoryObject.activeCells = redoObject.activeCells.clone(); // ToDo Слишком много клонирования, это долгая операция oHistoryObject.activeCells = redoObject.activeCells.clone(); // ToDo Слишком много клонирования, это долгая операция
oHistoryObject.lTable = redoObject.lTable; oHistoryObject.styleName = redoObject.styleName;
oHistoryObject.type = redoObject.type; oHistoryObject.type = redoObject.type;
oHistoryObject.cellId = redoObject.cellId; oHistoryObject.cellId = redoObject.cellId;
oHistoryObject.autoFiltersObject = redoObject.autoFiltersObject; oHistoryObject.autoFiltersObject = redoObject.autoFiltersObject;
...@@ -2180,6 +2181,7 @@ var maxIndividualValues = 10000; ...@@ -2180,6 +2181,7 @@ var maxIndividualValues = 10000;
else else
defaultColorBackground = whiteColor; defaultColorBackground = whiteColor;
var color;
if(styleOptions != undefined) if(styleOptions != undefined)
{ {
if(styleOptions.wholeTable && styleOptions.wholeTable.dxf.fill && null != styleOptions.wholeTable.dxf.fill.bg) if(styleOptions.wholeTable && styleOptions.wholeTable.dxf.fill && null != styleOptions.wholeTable.dxf.fill.bg)
...@@ -2196,7 +2198,7 @@ var maxIndividualValues = 10000; ...@@ -2196,7 +2198,7 @@ var maxIndividualValues = 10000;
{ {
for(k = 0; k < 6; k++) for(k = 0; k < 6; k++)
{ {
var color = defaultColorBackground; color = defaultColorBackground;
if((k)%2 == 0) if((k)%2 == 0)
{ {
if(styleOptions.firstColumnStripe && styleOptions.firstColumnStripe.dxf.fill && null != styleOptions.firstColumnStripe.dxf.fill.bg) if(styleOptions.firstColumnStripe && styleOptions.firstColumnStripe.dxf.fill && null != styleOptions.firstColumnStripe.dxf.fill.bg)
...@@ -2220,7 +2222,7 @@ var maxIndividualValues = 10000; ...@@ -2220,7 +2222,7 @@ var maxIndividualValues = 10000;
{ {
for(k = 0; k < 6; k++) for(k = 0; k < 6; k++)
{ {
var color = null; color = null;
if(styleOptions)//styleOptions.headerRow if(styleOptions)//styleOptions.headerRow
{ {
if(k ==0) if(k ==0)
...@@ -2254,7 +2256,7 @@ var maxIndividualValues = 10000; ...@@ -2254,7 +2256,7 @@ var maxIndividualValues = 10000;
} }
else else
{ {
var color = null; color = null;
if((k+1)%2 != 0) if((k+1)%2 != 0)
{ {
if(styleOptions.firstRowStripe && styleOptions.firstRowStripe.dxf.fill && null != styleOptions.firstRowStripe.dxf.fill.bg) if(styleOptions.firstRowStripe && styleOptions.firstRowStripe.dxf.fill && null != styleOptions.firstRowStripe.dxf.fill.bg)
...@@ -2288,7 +2290,7 @@ var maxIndividualValues = 10000; ...@@ -2288,7 +2290,7 @@ var maxIndividualValues = 10000;
} }
if(styleInfo.ShowLastColumn)//last column if(styleInfo.ShowLastColumn)//last column
{ {
var color = null; color = null;
if(styleOptions.lastColumn && styleOptions.lastColumn.dxf.fill && null != styleOptions.lastColumn.dxf.fill.bg) if(styleOptions.lastColumn && styleOptions.lastColumn.dxf.fill && null != styleOptions.lastColumn.dxf.fill.bg)
color =styleOptions.lastColumn.dxf.fill.bg; color =styleOptions.lastColumn.dxf.fill.bg;
...@@ -2314,7 +2316,7 @@ var maxIndividualValues = 10000; ...@@ -2314,7 +2316,7 @@ var maxIndividualValues = 10000;
} }
if(styleInfo.TotalsRowCount)//total row if(styleInfo.TotalsRowCount)//total row
{ {
var color = null; color = null;
if(styleOptions.totalRow && styleOptions.totalRow.dxf.fill && null != styleOptions.totalRow.dxf.fill.bg) if(styleOptions.totalRow && styleOptions.totalRow.dxf.fill && null != styleOptions.totalRow.dxf.fill.bg)
color = styleOptions.totalRow.dxf.fill.bg; color = styleOptions.totalRow.dxf.fill.bg;
else else
...@@ -2419,9 +2421,9 @@ var maxIndividualValues = 10000; ...@@ -2419,9 +2421,9 @@ var maxIndividualValues = 10000;
} }
var border;
if(styleInfo.ShowRowStripes) if(styleInfo.ShowRowStripes)
{ {
var border;
if(styleOptions.firstRowStripe && styleOptions.firstRowStripe.dxf.border) if(styleOptions.firstRowStripe && styleOptions.firstRowStripe.dxf.border)
border = styleOptions.firstRowStripe.dxf.border; border = styleOptions.firstRowStripe.dxf.border;
else if(styleOptions.secondRowStripe && styleOptions.secondRowStripe.dxf.border) else if(styleOptions.secondRowStripe && styleOptions.secondRowStripe.dxf.border)
...@@ -2438,7 +2440,7 @@ var maxIndividualValues = 10000; ...@@ -2438,7 +2440,7 @@ var maxIndividualValues = 10000;
} }
if(styleOptions.totalRow && styleInfo.TotalsRowCount && styleOptions.totalRow.dxf.border) if(styleOptions.totalRow && styleInfo.TotalsRowCount && styleOptions.totalRow.dxf.border)
{ {
var border = styleOptions.totalRow.dxf.border; border = styleOptions.totalRow.dxf.border;
if(border.t.s !== c_oAscBorderStyles.None) if(border.t.s !== c_oAscBorderStyles.None)
{ {
ctx.setStrokeStyle(border.t.c); ctx.setStrokeStyle(border.t.c);
...@@ -2447,7 +2449,7 @@ var maxIndividualValues = 10000; ...@@ -2447,7 +2449,7 @@ var maxIndividualValues = 10000;
} }
if(styleOptions.headerRow && styleOptions.headerRow.dxf.border)//header row if(styleOptions.headerRow && styleOptions.headerRow.dxf.border)//header row
{ {
var border = styleOptions.headerRow.dxf.border; border = styleOptions.headerRow.dxf.border;
if(border.t.s !== c_oAscBorderStyles.None) if(border.t.s !== c_oAscBorderStyles.None)
{ {
ctx.setStrokeStyle(border.t.c); ctx.setStrokeStyle(border.t.c);
...@@ -2472,7 +2474,7 @@ var maxIndividualValues = 10000; ...@@ -2472,7 +2474,7 @@ var maxIndividualValues = 10000;
for(var n = 1; n < 6; n++) for(var n = 1; n < 6; n++)
{ {
ctx.beginPath(); ctx.beginPath();
var color = null; color = null;
if(n == 1 && styleOptions && styleOptions.headerRow && styleOptions.headerRow.dxf.font) if(n == 1 && styleOptions && styleOptions.headerRow && styleOptions.headerRow.dxf.font)
color = styleOptions.headerRow.dxf.font.c; color = styleOptions.headerRow.dxf.font.c;
else if(n == 5 && styleOptions && styleOptions.totalRow && styleOptions.totalRow.dxf.font) else if(n == 5 && styleOptions && styleOptions.totalRow && styleOptions.totalRow.dxf.font)
...@@ -2544,8 +2546,7 @@ var maxIndividualValues = 10000; ...@@ -2544,8 +2546,7 @@ var maxIndividualValues = 10000;
return result; return result;
}, },
//TODO не приватная функия! проверить и переименовать renameTableColumn: function(range, bUndo)
_renameTableColumn: function(range, bUndo)
{ {
var aWs = this._getCurrentWS(); var aWs = this._getCurrentWS();
var val; var val;
...@@ -2614,7 +2615,7 @@ var maxIndividualValues = 10000; ...@@ -2614,7 +2615,7 @@ var maxIndividualValues = 10000;
return result; return result;
}, },
_getAdjacentCellsAF2: function(ar,aWs) _getAdjacentCellsAF: function(ar, aWs)
{ {
var ws = this.worksheet; var ws = this.worksheet;
var cloneActiveRange = ar.clone(true); // ToDo слишком много клонирования var cloneActiveRange = ar.clone(true); // ToDo слишком много клонирования
...@@ -2851,7 +2852,7 @@ var maxIndividualValues = 10000; ...@@ -2851,7 +2852,7 @@ var maxIndividualValues = 10000;
}, },
_getAdjacentCellsAF: function(ar, aWs) _getAdjacentCellsAF2: function(ar, aWs)
{ {
var ws = this.worksheet; var ws = this.worksheet;
var cloneActiveRange = ar.clone(true); // ToDo слишком много клонирования var cloneActiveRange = ar.clone(true); // ToDo слишком много клонирования
...@@ -3281,10 +3282,10 @@ var maxIndividualValues = 10000; ...@@ -3281,10 +3282,10 @@ var maxIndividualValues = 10000;
}, },
_showAutoFilterDialog: function(filterProp) { _showAutoFilterDialog: function(filterProp) {
var kF = 96 / 72;
var ws = this.worksheet; var ws = this.worksheet;
var aWs = this._getCurrentWS(); var aWs = this._getCurrentWS();
//get filter
var filter, autoFilter; var filter, autoFilter;
if(filterProp.id === null) if(filterProp.id === null)
{ {
...@@ -3297,60 +3298,40 @@ var maxIndividualValues = 10000; ...@@ -3297,60 +3298,40 @@ var maxIndividualValues = 10000;
filter = aWs.TableParts[filterProp.id]; filter = aWs.TableParts[filterProp.id];
} }
//get values
var colId = filterProp.colId; var colId = filterProp.colId;
var values = this._getOpenAndClosedValues(autoFilter, colId);
var elements = this._getOpenAndClosedValues(autoFilter, colId); var filters = this._getFilterColumn(autoFilter, colId);
if(!elements)
return;
//сортируем для массива
var values = this._sortArrayMinMax(elements.values);
var filters;
if(autoFilter && autoFilter.FilterColumns)
{
filters = autoFilter.FilterColumns;
for(var k= 0; k < filters.length; k++)
{
if(filters[k].ColId == colId)
{
filters = filters[k];
break;
}
}
}
var rangeButton = Asc.Range(autoFilter.Ref.c1 + colId, autoFilter.Ref.r1, autoFilter.Ref.c1 + colId, autoFilter.Ref.r1); var rangeButton = Asc.Range(autoFilter.Ref.c1 + colId, autoFilter.Ref.r1, autoFilter.Ref.c1 + colId, autoFilter.Ref.r1);
var cellId = this._rangeToId(rangeButton); var cellId = this._rangeToId(rangeButton);
var autoFilterObject = new Asc.AutoFiltersOptions(); //get filter object
var filterObj = new Asc.AutoFilterObj();
if(filters && filters.CustomFiltersObj && filters.CustomFiltersObj.CustomFilters) if(filters && filters.ColorFilter)
{ {
var customFilter = filters.CustomFiltersObj.CustomFilters; filterObj.type = c_oAscAutoFilterTypes.ColorFilter;
var val1; filterObj.filter = filters.ColorFilter;
var val2; }
var filter1; else if(filters && filters.CustomFiltersObj && filters.CustomFiltersObj.CustomFilters)
var filter2;
var isCheked = filters.CustomFiltersObj.And;
if(customFilter[0])
{ {
filter1 = customFilter[0].Operator; filterObj.type = c_oAscAutoFilterTypes.CustomFilters;
val1 = customFilter[0].Val; filterObj.filter = filters.CustomFiltersObj;
} }
if(customFilter[1]) else if(filters && filters.DynamicFilter)
{ {
filter2 = customFilter[1].Operator; filterObj.type = c_oAscAutoFilterTypes.DynamicFilter;
val2 = customFilter[1].Val; filterObj.filter = filters.DynamicFilter;
} }
autoFilterObject.asc_setValFilter1(val1); else if(filters && filters.Top10)
autoFilterObject.asc_setValFilter2(val2); {
autoFilterObject.asc_setFilter1(filter1); filterObj.type = c_oAscAutoFilterTypes.Top10;
autoFilterObject.asc_setFilter2(filter2); filterObj.filter = filters.Top10;
autoFilterObject.asc_setIsChecked(isCheked);
} }
else
filterObj.type = c_oAscAutoFilterTypes.Filters;
//get sort
var sortVal = false; var sortVal = false;
if(filter && filter.SortState && filter.SortState.SortConditions && filter.SortState.SortConditions[0]) if(filter && filter.SortState && filter.SortState.SortConditions && filter.SortState.SortConditions[0])
{ {
...@@ -3362,18 +3343,15 @@ var maxIndividualValues = 10000; ...@@ -3362,18 +3343,15 @@ var maxIndividualValues = 10000;
sortVal = 'ascending'; sortVal = 'ascending';
} }
} }
var isCustomFilter = false;
if(elements.dF) //set menu object
isCustomFilter = true; var autoFilterObject = new Asc.AutoFiltersOptions();
autoFilterObject.asc_setSortState(sortVal); autoFilterObject.asc_setSortState(sortVal);
autoFilterObject.asc_setCellId(cellId); autoFilterObject.asc_setCellId(cellId);
autoFilterObject.asc_setResult(values); autoFilterObject.asc_setValues(values);
autoFilterObject.asc_setDates(elements.dates); autoFilterObject.asc_setFilter(filterObj);
autoFilterObject.asc_setIsCustomFilter(isCustomFilter);
/*autoFilterObject.asc_setY(cell.y1 * kF);
autoFilterObject.asc_setX(cell.x1 *kF);
autoFilterObject.asc_setWidth(cell.width * kF);
autoFilterObject.asc_setHeight(cell.height * kF);*/
ws.handlers.trigger("setAutoFiltersDialog", autoFilterObject); ws.handlers.trigger("setAutoFiltersDialog", autoFilterObject);
}, },
...@@ -3623,7 +3601,7 @@ var maxIndividualValues = 10000; ...@@ -3623,7 +3601,7 @@ var maxIndividualValues = 10000;
} }
} }
} }
var tempPosition; var tempPosition = 0;
for(var k = 0; k < splitQuestion.length; k++) for(var k = 0; k < splitQuestion.length; k++)
{ {
/*if(((k != 0 && k != splitQuestion.length - 1) || (k != splitQuestion.length - 1)) && splitQuestion[k] != '' ) /*if(((k != 0 && k != splitQuestion.length - 1) || (k != splitQuestion.length - 1)) && splitQuestion[k] != '' )
...@@ -3855,7 +3833,6 @@ var maxIndividualValues = 10000; ...@@ -3855,7 +3833,6 @@ var maxIndividualValues = 10000;
_getOpenAndClosedValues: function(filter, cellId) _getOpenAndClosedValues: function(filter, cellId)
{ {
console.time("new"); console.time("new");
var aWs = this._getCurrentWS();
var ref = filter.Ref; var ref = filter.Ref;
var filterColumns = filter.FilterColumns; var filterColumns = filter.FilterColumns;
...@@ -3898,14 +3875,16 @@ var maxIndividualValues = 10000; ...@@ -3898,14 +3875,16 @@ var maxIndividualValues = 10000;
} }
else else
result.values[count] = tempResult; result.values[count] = tempResult;
} };
result.values = []; result.values = [];
result.dates = {}; result.dates = {};
if(currentElemArray === null || (filterColumns[currentElemArray] && filterColumns[currentElemArray].Filters))//all filter var individualCount, count;
if(currentElemArray === null || (filterColumns[currentElemArray] && (filterColumns[currentElemArray].Filters || filterColumns[currentElemArray].Top10)))//all filter
{ {
var individualCount = 0, count = 0; individualCount = 0;
count = 0;
for(var i = ref.r1 + 1; i <= ref.r2; i++) for(var i = ref.r1 + 1; i <= ref.r2; i++)
{ {
//max strings //max strings
...@@ -3919,7 +3898,6 @@ var maxIndividualValues = 10000; ...@@ -3919,7 +3898,6 @@ var maxIndividualValues = 10000;
continue; continue;
} }
//value in current column //value in current column
var cell = aWs.getCell3(i, cellId + ref.c1); var cell = aWs.getCell3(i, cellId + ref.c1);
var currentVal = cell.getValueWithFormat(); var currentVal = cell.getValueWithFormat();
...@@ -3941,7 +3919,7 @@ var maxIndividualValues = 10000; ...@@ -3941,7 +3919,7 @@ var maxIndividualValues = 10000;
var tempResult = new AutoFiltersOptionsElements(); var tempResult = new AutoFiltersOptionsElements();
tempResult.visible = true; tempResult.visible = true;
tempResult.val = currentVal; tempResult.val = currentVal;
tempResult.val2 = currentVal; tempResult.text = val;
temp[currentVal] = 1; temp[currentVal] = 1;
...@@ -3957,11 +3935,14 @@ var maxIndividualValues = 10000; ...@@ -3957,11 +3935,14 @@ var maxIndividualValues = 10000;
//filter current button //filter current button
if(tempResult.visible !== null) if(tempResult.visible !== null)
{ {
if(!filterColumns[currentElemArray].isHideValue(val, isDateTimeFormat)) if(!filterColumns[currentElemArray].Top10 && !filterColumns[currentElemArray].isHideValue(val, isDateTimeFormat))
tempResult.visible = true; tempResult.visible = true;
else else
tempResult.visible = false; tempResult.visible = false;
//TODO пока не разделяем фильтр по дате и общий
isDateTimeFormat = false;
addValueToMenuObj(tempResult, count); addValueToMenuObj(tempResult, count);
if(!isDateTimeFormat) if(!isDateTimeFormat)
...@@ -3975,6 +3956,9 @@ var maxIndividualValues = 10000; ...@@ -3975,6 +3956,9 @@ var maxIndividualValues = 10000;
} }
else else
{ {
//TODO пока не разделяем фильтр по дате и общий
isDateTimeFormat = false;
addValueToMenuObj(tempResult, count); addValueToMenuObj(tempResult, count);
if(!isDateTimeFormat) if(!isDateTimeFormat)
...@@ -3986,7 +3970,8 @@ var maxIndividualValues = 10000; ...@@ -3986,7 +3970,8 @@ var maxIndividualValues = 10000;
} }
else if(filterColumns[currentElemArray] && filterColumns[currentElemArray].CustomFiltersObj && filterColumns[currentElemArray].CustomFiltersObj.CustomFilters)//custom filter else if(filterColumns[currentElemArray] && filterColumns[currentElemArray].CustomFiltersObj && filterColumns[currentElemArray].CustomFiltersObj.CustomFilters)//custom filter
{ {
var individualCount = 0, count = 0; individualCount = 0;
count = 0;
for(var i = ref.r1 + 1; i <= ref.r2; i++) for(var i = ref.r1 + 1; i <= ref.r2; i++)
{ {
//max strings //max strings
...@@ -4006,7 +3991,7 @@ var maxIndividualValues = 10000; ...@@ -4006,7 +3991,7 @@ var maxIndividualValues = 10000;
result.values[count] = new AutoFiltersOptionsElements(); result.values[count] = new AutoFiltersOptionsElements();
result.values[count].visible = false; result.values[count].visible = false;
result.values[count].val = currentVal; result.values[count].val = currentVal;
result.values[count].val2 = currentVal; result.values[count].text = currentVal;
temp[currentVal] = 1; temp[currentVal] = 1;
count++; count++;
...@@ -4016,16 +4001,17 @@ var maxIndividualValues = 10000; ...@@ -4016,16 +4001,17 @@ var maxIndividualValues = 10000;
} }
} }
return this._sortArrayMinMax(result.values);
console.timeEnd("new"); console.timeEnd("new");
return result;
}, },
_sortArrayMinMax: function(elements) _sortArrayMinMax: function(elements)
{ {
elements.sort (function sortArr(a, b) elements.sort (function sortArr(a, b)
{ {
return a.val2 - b.val2; return a.val - b.val;
}) });
return elements; return elements;
}, },
...@@ -4319,9 +4305,10 @@ var maxIndividualValues = 10000; ...@@ -4319,9 +4305,10 @@ var maxIndividualValues = 10000;
if(nameStart && nameStart[1] && nameEnd && nameEnd[1] && !isNaN(parseInt(nameStart[1])) && !isNaN(parseInt(nameEnd[1])) && ((parseInt(nameStart[1]) + 1) == parseInt(nameEnd[1]))) if(nameStart && nameStart[1] && nameEnd && nameEnd[1] && !isNaN(parseInt(nameStart[1])) && !isNaN(parseInt(nameEnd[1])) && ((parseInt(nameStart[1]) + 1) == parseInt(nameEnd[1])))
isSequence = true; isSequence = true;
} }
var name;
if(indexInsertColumn == undefined || !isSequence) if(indexInsertColumn == undefined || !isSequence)
{ {
var name;
for(var i = 0; i < tableColumns.length; i++) for(var i = 0; i < tableColumns.length; i++)
{ {
if(tableColumns[i].Name) if(tableColumns[i].Name)
...@@ -4336,7 +4323,6 @@ var maxIndividualValues = 10000; ...@@ -4336,7 +4323,6 @@ var maxIndividualValues = 10000;
} }
else else
{ {
var name;
if(tableColumns[indexInsertColumn] && tableColumns[indexInsertColumn].Name) if(tableColumns[indexInsertColumn] && tableColumns[indexInsertColumn].Name)
name = tableColumns[indexInsertColumn].Name.split("Column"); name = tableColumns[indexInsertColumn].Name.split("Column");
if(name && name[1] && !isNaN(parseFloat(name[1]))) if(name && name[1] && !isNaN(parseFloat(name[1])))
...@@ -4502,7 +4488,7 @@ var maxIndividualValues = 10000; ...@@ -4502,7 +4488,7 @@ var maxIndividualValues = 10000;
//если затрагиваем форматированной таблицей часть а/ф //если затрагиваем форматированной таблицей часть а/ф
if(aWs.AutoFilter && aWs.AutoFilter.Ref && newRange.intersection(aWs.AutoFilter.Ref) && aWs.AutoFilter !== findFilters[i]) if(aWs.AutoFilter && aWs.AutoFilter.Ref && newRange.intersection(aWs.AutoFilter.Ref) && aWs.AutoFilter !== findFilters[i])
{ {
this._deleteAutoFilter(); this.deleteAutoFilter(aWs.AutoFilter.Ref);
} }
//если область вставки содержит форматированную таблицу, которая пересекается с вставляемой форматированной таблицей //если область вставки содержит форматированную таблицу, которая пересекается с вставляемой форматированной таблицей
...@@ -4527,11 +4513,7 @@ var maxIndividualValues = 10000; ...@@ -4527,11 +4513,7 @@ var maxIndividualValues = 10000;
var ref = findFiltersTo[i].Ref; var ref = findFiltersTo[i].Ref;
//если переносим просто данные, причём шапки совпадают, то фильтр не очищаем //если переносим просто данные, причём шапки совпадают, то фильтр не очищаем
if(arnTo.r1 === ref.r1 && arnTo.c1 === ref.c1) if(!(arnTo.r1 === ref.r1 && arnTo.c1 === ref.c1))
{
continue;
}
else
this.isEmptyAutoFilters(ref, null, null, null, findFilters); this.isEmptyAutoFilters(ref, null, null, null, findFilters);
} }
applyStyleByCells = false; applyStyleByCells = false;
...@@ -4605,9 +4587,8 @@ var maxIndividualValues = 10000; ...@@ -4605,9 +4587,8 @@ var maxIndividualValues = 10000;
isOut = true; isOut = true;
} }
} }
if(isIn && isOut)
return true; return isIn && isOut;
return false;
}, },
_intersectionRangeWithTableParts: function(range, aWs, exceptionRange)//находим фильтры, находящиеся в данном range _intersectionRangeWithTableParts: function(range, aWs, exceptionRange)//находим фильтры, находящиеся в данном range
...@@ -4654,7 +4635,7 @@ var maxIndividualValues = 10000; ...@@ -4654,7 +4635,7 @@ var maxIndividualValues = 10000;
{ {
ref = findFilters[i].Ref; ref = findFilters[i].Ref;
newRange = Asc.Range(ref.c1 + diffCol, ref.r1 + diffRow, ref.c2 + diffCol, ref.r2 + diffRow); newRange = Asc.Range(ref.c1 + diffCol, ref.r1 + diffRow, ref.c2 + diffCol, ref.r2 + diffRow);
bWithoutFilter = findFilters[i].AutoFilter === null ? true : false; bWithoutFilter = findFilters[i].AutoFilter === null;
if(!ref.intersection(newRange) && !this._intersectionRangeWithTableParts(newRange, aWs, arnFrom)) if(!ref.intersection(newRange) && !this._intersectionRangeWithTableParts(newRange, aWs, arnFrom))
this.addAutoFilter(findFilters[i].TableStyleInfo.Name, newRange, null, null, true, bWithoutFilter); this.addAutoFilter(findFilters[i].TableStyleInfo.Name, newRange, null, null, true, bWithoutFilter);
...@@ -4676,6 +4657,120 @@ var maxIndividualValues = 10000; ...@@ -4676,6 +4657,120 @@ var maxIndividualValues = 10000;
return true; return true;
} }
return false; return false;
},
_cleanFilterColumnsAndSortState: function(autoFilterElement, activeCells)
{
var ws = this.worksheet;
var aWs = this._getCurrentWS();
var oldFilter = autoFilterElement.clone(aWs);
if(autoFilterElement.SortState)
autoFilterElement.SortState = null;
aWs.setRowHidden(false, autoFilterElement.Ref.r1, autoFilterElement.Ref.r2);
if(autoFilterElement.AutoFilter && autoFilterElement.AutoFilter.FilterColumns)
{
autoFilterElement.AutoFilter.FilterColumns = null;
}
else if(autoFilterElement.FilterColumns)
{
autoFilterElement.FilterColumns = null;
}
this._addHistoryObj(oldFilter, historyitem_AutoFilter_CleanAutoFilter, {activeCells: activeCells}, null, activeCells);
this._reDrawFilters();
if(!aWs.workbook.bUndoChanges && !aWs.workbook.bRedoChanges)
ws._onUpdateFormatTable(oldFilter.Ref, false, true);
},
_checkValueInCells: function(n, k, cloneActiveRange)
{
var aWs = this._getCurrentWS();
var cell = aWs.getRange3(n, k, n, k);
var isEmptyCell = cell.isEmptyText();
var isEnd = true, range, merged, valueMerg;
//если мерженная ячейка
if(isEmptyCell)
{
merged = cell.hasMerged();
valueMerg = null;
if(merged)
{
valueMerg = aWs.getRange3(merged.r1, merged.c1, merged.r2, merged.c2).getValue();
if(valueMerg != null && valueMerg != "")
{
if(merged.r1 < cloneActiveRange.r1)
{
cloneActiveRange.r1 = merged.r1;
n = cloneActiveRange.r1 - 1; isEnd = false
}
if(merged.r2 > cloneActiveRange.r2)
{
cloneActiveRange.r2 = merged.r2;
n = cloneActiveRange.r2 - 1; isEnd = false
}
if(merged.c1 < cloneActiveRange.c1)
{
cloneActiveRange.c1 = merged.c1;
k = cloneActiveRange.c1 - 1; isEnd = false
}
if(merged.c2 > cloneActiveRange.c2)
{
cloneActiveRange.c2 = merged.c2;
k = cloneActiveRange.c2 - 1; isEnd = false
}
if(n < 0)
n = 0;
if(k < 0)
k = 0;
}
}
}
if(!isEmptyCell || (valueMerg != null && valueMerg != ""))
{
if(k < cloneActiveRange.c1)
{
cloneActiveRange.c1 = k; isEnd = false;
}
else if(k > cloneActiveRange.c2)
{
cloneActiveRange.c2 = k; isEnd = false;
}
if(n < cloneActiveRange.r1)
{
cloneActiveRange.r1 = n; isEnd = false;
}
else if(n > cloneActiveRange.r2)
{
cloneActiveRange.r2 = n; isEnd = false;
}
}
return {isEmptyCell: isEmptyCell, isEnd: isEnd, cloneActiveRange: cloneActiveRange};
},
_getFilterColumn: function(autoFilter, colId)
{
var filters;
if(autoFilter && autoFilter.FilterColumns)
{
filters = autoFilter.FilterColumns;
for(var k= 0; k < filters.length; k++)
{
if(filters[k].ColId == colId)
{
filters = filters[k];
break;
}
}
}
return filters;
} }
}; };
...@@ -4689,40 +4784,16 @@ var maxIndividualValues = 10000; ...@@ -4689,40 +4784,16 @@ var maxIndividualValues = 10000;
window["Asc"]["AutoFiltersOptions"] = window["Asc"].AutoFiltersOptions = AutoFiltersOptions; window["Asc"]["AutoFiltersOptions"] = window["Asc"].AutoFiltersOptions = AutoFiltersOptions;
prot = AutoFiltersOptions.prototype; prot = AutoFiltersOptions.prototype;
prot["asc_setCellId"] = prot.asc_setCellId;
prot["asc_setResult"] = prot.asc_setResult;
prot["asc_setDates"] = prot.asc_setDates;
prot["asc_setIsCustomFilter"] = prot.asc_setIsCustomFilter;
prot["asc_setFilter1"] = prot.asc_setFilter1;
prot["asc_setFilter2"] = prot.asc_setFilter2;
prot["asc_setValFilter1"] = prot.asc_setValFilter1;
prot["asc_setValFilter2"] = prot.asc_setValFilter2;
prot["asc_setIsChecked"] = prot.asc_setIsChecked;
prot["asc_setSortState"] = prot.asc_setSortState; prot["asc_setSortState"] = prot.asc_setSortState;
prot["asc_setY"] = prot.asc_setY;
prot["asc_setX"] = prot.asc_setX;
prot["asc_setWidth"] = prot.asc_setWidth;
prot["asc_setHeight"] = prot.asc_setHeight;
prot["asc_getCellId"] = prot.asc_getCellId;
prot["asc_getY"] = prot.asc_getY;
prot["asc_getX"] = prot.asc_getX;
prot["asc_getHeight"] = prot.asc_getHeight;
prot["asc_getWidth"] = prot.asc_getWidth;
prot["asc_getResult"] = prot.asc_getResult;
prot["asc_getIsCustomFilter"] = prot.asc_getIsCustomFilter;
prot["asc_getFilter1"] = prot.asc_getFilter1;
prot["asc_getFilter2"] = prot.asc_getFilter2;
prot["asc_getValFilter1"] = prot.asc_getValFilter1;
prot["asc_getValFilter2"] = prot.asc_getValFilter2;
prot["asc_getIsChecked"] = prot.asc_getIsChecked;
prot["asc_getSortState"] = prot.asc_getSortState; prot["asc_getSortState"] = prot.asc_getSortState;
window["Asc"]["AutoFilterObj"] = window["Asc"].AutoFilterObj = AutoFilterObj;
prot = AutoFilterObj.prototype;
window["Asc"]["AutoFiltersOptionsElements"] = window["Asc"].AutoFiltersOptionsElements = AutoFiltersOptionsElements; window["Asc"]["AutoFiltersOptionsElements"] = window["Asc"].AutoFiltersOptionsElements = AutoFiltersOptionsElements;
prot = AutoFiltersOptionsElements.prototype; prot = AutoFiltersOptionsElements.prototype;
prot["asc_getVal"] = prot.asc_getVal; prot["asc_getText"] = prot.asc_getText;
prot["asc_getVisible"] = prot.asc_getVisible; prot["asc_getVisible"] = prot.asc_getVisible;
prot["asc_setVal"] = prot.asc_setVal;
prot["asc_setVisible"] = prot.asc_setVisible; prot["asc_setVisible"] = prot.asc_setVisible;
window["Asc"]["AddFormatTableOptions"] = window["Asc"].AddFormatTableOptions = AddFormatTableOptions; window["Asc"]["AddFormatTableOptions"] = window["Asc"].AddFormatTableOptions = AddFormatTableOptions;
......
...@@ -7597,7 +7597,7 @@ ...@@ -7597,7 +7597,7 @@
// Автозаполняем ячейки // Автозаполняем ячейки
if (range.promote(/*bCtrl*/ctrlPress, /*bVertical*/(1 === t.fillHandleDirection), nIndex)) { if (range.promote(/*bCtrl*/ctrlPress, /*bVertical*/(1 === t.fillHandleDirection), nIndex)) {
// Вызываем функцию пересчета для заголовков форматированной таблицы // Вызываем функцию пересчета для заголовков форматированной таблицы
t.autoFilters._renameTableColumn(arn); t.autoFilters.renameTableColumn(arn);
} else { } else {
t.handlers.trigger("onErrorEvent", c_oAscError.ID.CannotFillRange, c_oAscError.Level.NoCritical); t.handlers.trigger("onErrorEvent", c_oAscError.ID.CannotFillRange, c_oAscError.Level.NoCritical);
t.activeRange.assign2(range.bbox); t.activeRange.assign2(range.bbox);
...@@ -7941,8 +7941,8 @@ ...@@ -7941,8 +7941,8 @@
t.autoFilters._moveAutoFilters(arnTo, arnFrom, null, copyRange); t.autoFilters._moveAutoFilters(arnTo, arnFrom, null, copyRange);
// Вызываем функцию пересчета для заголовков форматированной таблицы // Вызываем функцию пересчета для заголовков форматированной таблицы
t.autoFilters._renameTableColumn(arnFrom); t.autoFilters.renameTableColumn(arnFrom);
t.autoFilters._renameTableColumn(arnTo); t.autoFilters.renameTableColumn(arnTo);
t.autoFilters.reDrawFilter(arnFrom); t.autoFilters.reDrawFilter(arnFrom);
History.EndTransaction(); History.EndTransaction();
...@@ -8117,7 +8117,7 @@ ...@@ -8117,7 +8117,7 @@
range.cleanHyperlinks(); range.cleanHyperlinks();
// Вызываем функцию пересчета для заголовков форматированной таблицы // Вызываем функцию пересчета для заголовков форматированной таблицы
t.autoFilters._renameTableColumn(arn); t.autoFilters.renameTableColumn(arn);
/* возвращаем отрисовку. и перерисовываем ячейки с предварительным пересчетом */ /* возвращаем отрисовку. и перерисовываем ячейки с предварительным пересчетом */
buildRecalc(t.model.workbook); buildRecalc(t.model.workbook);
...@@ -8169,7 +8169,7 @@ ...@@ -8169,7 +8169,7 @@
if (null !== val.asc_getText()) { if (null !== val.asc_getText()) {
t.model.getRange3(r, c, r, c).setValue(val.asc_getText()); t.model.getRange3(r, c, r, c).setValue(val.asc_getText());
// Вызываем функцию пересчета для заголовков форматированной таблицы // Вызываем функцию пересчета для заголовков форматированной таблицы
t.autoFilters._renameTableColumn(arn); t.autoFilters.renameTableColumn(arn);
} }
break; break;
} else { } else {
...@@ -8220,7 +8220,7 @@ ...@@ -8220,7 +8220,7 @@
else else
selectData = t._setInfoAfterPaste(val,onlyActive); selectData = t._setInfoAfterPaste(val,onlyActive);
t.autoFilters._renameTableColumn(t.activeRange); t.autoFilters.renameTableColumn(t.activeRange);
if (!selectData) { if (!selectData) {
bIsUpdate = false; bIsUpdate = false;
...@@ -10380,7 +10380,7 @@ ...@@ -10380,7 +10380,7 @@
} else { } else {
c.setValue2(val); c.setValue2(val);
// Вызываем функцию пересчета для заголовков форматированной таблицы // Вызываем функцию пересчета для заголовков форматированной таблицы
t.autoFilters._renameTableColumn(oCellEdit); t.autoFilters.renameTableColumn(oCellEdit);
} }
if (!isFormula) { if (!isFormula) {
......
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