Commit b3aa00d7 authored by GoshaZotov's avatar GoshaZotov Committed by Alexander.Trofimov

add in AutoFiltersOptions colorsFill and colorsFont

parent ea26cf6b
...@@ -135,7 +135,8 @@ ...@@ -135,7 +135,8 @@
this.automaticRowCount = null; this.automaticRowCount = null;
this.displayName = null; this.displayName = null;
this.isTextFilter = null; this.isTextFilter = null;
this.colorsFill = null;
this.colorsFont = null;
return this; return this;
} }
...@@ -156,6 +157,8 @@ ...@@ -156,6 +157,8 @@
case this.Properties.automaticRowCount: return this.automaticRowCount; break; case this.Properties.automaticRowCount: return this.automaticRowCount; break;
case this.Properties.displayName: return this.displayName; break; case this.Properties.displayName: return this.displayName; break;
case this.Properties.isTextFilter: return this.isTextFilter; break; case this.Properties.isTextFilter: return this.isTextFilter; break;
case this.Properties.colorsFill: return this.colorsFill; break;
case this.Properties.colorsFont: return this.colorsFont; break;
} }
return null; return null;
...@@ -168,6 +171,8 @@ ...@@ -168,6 +171,8 @@
case this.Properties.automaticRowCount: this.automaticRowCount = value;break; case this.Properties.automaticRowCount: this.automaticRowCount = value;break;
case this.Properties.displayName: this.displayName = value;break; case this.Properties.displayName: this.displayName = value;break;
case this.Properties.isTextFilter: this.IsTextFilter = value;break; case this.Properties.isTextFilter: this.IsTextFilter = value;break;
case this.Properties.colorsFill: this.colorsFill = value;break;
case this.Properties.colorsFont: this.colorsFont = value;break;
} }
}, },
...@@ -180,6 +185,8 @@ ...@@ -180,6 +185,8 @@
asc_setDiplayName : function(val) { this.displayName = val; }, asc_setDiplayName : function(val) { this.displayName = val; },
asc_setIsTextFilter : function(val) { this.isTextFilter = val; }, asc_setIsTextFilter : function(val) { this.isTextFilter = val; },
asc_setColorsFill : function(val) { this.colorsFill = val; },
asc_setColorsFont : function(val) { this.colorsFont = val; },
asc_getCellId : function() { return this.cellId; }, asc_getCellId : function() { return this.cellId; },
asc_getValues : function() { return this.values; }, asc_getValues : function() { return this.values; },
...@@ -188,6 +195,8 @@ ...@@ -188,6 +195,8 @@
asc_getSortState : function() { return this.sortVal; }, asc_getSortState : function() { return this.sortVal; },
asc_getDisplayName : function(val) { return this.displayName; }, asc_getDisplayName : function(val) { return this.displayName; },
asc_getIsTextFilter : function(val) { return this.IsTextFilter; }, asc_getIsTextFilter : function(val) { return this.IsTextFilter; },
asc_getColorsFill : function(val) { return this.colorsFill; },
asc_getColorsFont : function(val) { return this.colorsFont; }
}; };
var g_oAutoFilterObj = { var g_oAutoFilterObj = {
...@@ -4649,6 +4658,8 @@ ...@@ -4649,6 +4658,8 @@
prot["asc_getCellId"] = prot.asc_getCellId; prot["asc_getCellId"] = prot.asc_getCellId;
prot["asc_getDisplayName"] = prot.asc_getDisplayName; prot["asc_getDisplayName"] = prot.asc_getDisplayName;
prot["asc_getIsTextFilter"] = prot.asc_getIsTextFilter; prot["asc_getIsTextFilter"] = prot.asc_getIsTextFilter;
prot["asc_getColorsFill"] = prot.asc_getColorsFill;
prot["asc_getColorsFont"] = prot.asc_getColorsFont;
window["AscCommonExcel"].AutoFilterObj = AutoFilterObj; window["AscCommonExcel"].AutoFilterObj = AutoFilterObj;
prot = AutoFilterObj.prototype; prot = AutoFilterObj.prototype;
......
...@@ -12683,6 +12683,8 @@ ...@@ -12683,6 +12683,8 @@
var filterTypes = this.af_getFilterTypes(columnRange); var filterTypes = this.af_getFilterTypes(columnRange);
autoFilterObject.asc_setIsTextFilter(filterTypes.text); autoFilterObject.asc_setIsTextFilter(filterTypes.text);
autoFilterObject.asc_setColorsFill(filterTypes.colors);
autoFilterObject.asc_setColorsFont(filterTypes.fontColors);
this.handlers.trigger("setAutoFiltersDialog", autoFilterObject); this.handlers.trigger("setAutoFiltersDialog", autoFilterObject);
...@@ -12693,7 +12695,18 @@ ...@@ -12693,7 +12695,18 @@
var t = this; var t = this;
var ws = this.model; var ws = this.model;
var res = {text: true, colors: [], fontColors: []}; var res = {text: true, colors: [], fontColors: []};
var getAscColor = function(color)
{
var ascColor = new Asc.asc_CColor();
ascColor.asc_putR(color.getR());
ascColor.asc_putG(color.getG());
ascColor.asc_putB(color.getB());
ascColor.asc_putA(color.getA());
return ascColor;
};
var tempText = 0, tempDigit = 0; var tempText = 0, tempDigit = 0;
var alreadyAddColors = {}, alreadyAddFontColors = {}; var alreadyAddColors = {}, alreadyAddFontColors = {};
for(var i = columnRange.r1; i <= columnRange.r2; i++) for(var i = columnRange.r1; i <= columnRange.r2; i++)
...@@ -12725,7 +12738,9 @@ ...@@ -12725,7 +12738,9 @@
var fontColor = cell.oValue.multiText[j].format ? cell.oValue.multiText[j].format.c : null; var fontColor = cell.oValue.multiText[j].format ? cell.oValue.multiText[j].format.c : null;
if(fontColor !== null && alreadyAddFontColors[fontColor.rgb] !== true && g_oColorManager.isEqual(fontColor, g_oDefaultFont.c) === false) if(fontColor !== null && alreadyAddFontColors[fontColor.rgb] !== true && g_oColorManager.isEqual(fontColor, g_oDefaultFont.c) === false)
{ {
res.fontColors.push(fontColor); var ascFontColor = getAscColor(fontColor);
res.fontColors.push(ascFontColor);
alreadyAddFontColors[fontColor.rgb] = true; alreadyAddFontColors[fontColor.rgb] = true;
} }
} }
...@@ -12735,7 +12750,9 @@ ...@@ -12735,7 +12750,9 @@
var fontColor = cell.xfs && cell.xfs.font ? cell.xfs.font.c : null; var fontColor = cell.xfs && cell.xfs.font ? cell.xfs.font.c : null;
if(fontColor !== null && alreadyAddFontColors[fontColor.rgb] !== true && g_oColorManager.isEqual(fontColor, g_oDefaultFont.c) === false) if(fontColor !== null && alreadyAddFontColors[fontColor.rgb] !== true && g_oColorManager.isEqual(fontColor, g_oDefaultFont.c) === false)
{ {
res.fontColors.push(fontColor); var ascFontColor = getAscColor(fontColor);
res.fontColors.push(ascFontColor);
alreadyAddFontColors[fontColor.rgb] = true; alreadyAddFontColors[fontColor.rgb] = true;
} }
} }
...@@ -12743,7 +12760,9 @@ ...@@ -12743,7 +12760,9 @@
var color = cell.getStyle(); var color = cell.getStyle();
if(color !== null && color.fill && color.fill.bg && alreadyAddColors[color.fill.bg.rgb] !== true) if(color !== null && color.fill && color.fill.bg && alreadyAddColors[color.fill.bg.rgb] !== true)
{ {
res.colors.push(color.fill); var ascColor = getAscColor(color.fill.bg);
res.colors.push(ascColor);
alreadyAddColors[color.fill.bg.rgb] = true; alreadyAddColors[color.fill.bg.rgb] = true;
} }
} }
......
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