Commit e13742c5 authored by GoshaZotov's avatar GoshaZotov

Bug #31908 - Значения в фильтрованном списке отображаются с учетом регистра

parent 78336013
...@@ -5131,7 +5131,10 @@ FilterColumn.prototype.clone = function() { ...@@ -5131,7 +5131,10 @@ FilterColumn.prototype.clone = function() {
FilterColumn.prototype.isHideValue = function(val, isDateTimeFormat, top10Length) { 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); {
this.Filters._initLowerCaseValues();
res = this.Filters.isHideValue(val.toLowerCase(), isDateTimeFormat);
}
else if(this.CustomFiltersObj) else if(this.CustomFiltersObj)
res = this.CustomFiltersObj.isHideValue(val); res = this.CustomFiltersObj.isHideValue(val);
else if(this.Top10) else if(this.Top10)
...@@ -5197,6 +5200,8 @@ function Filters() { ...@@ -5197,6 +5200,8 @@ function Filters() {
this.Values = {}; this.Values = {};
this.Dates = []; this.Dates = [];
this.Blank = null; this.Blank = null;
this.lowerCaseValues = null;
} }
Filters.prototype.clone = function() { Filters.prototype.clone = function() {
var i, res = new Filters(); var i, res = new Filters();
...@@ -5236,6 +5241,7 @@ Filters.prototype.init = function(obj) { ...@@ -5236,6 +5241,7 @@ Filters.prototype.init = function(obj) {
allFilterOpenElements = false; allFilterOpenElements = false;
} }
this._sortDate(); this._sortDate();
this._initLowerCaseValues();
return allFilterOpenElements; return allFilterOpenElements;
}; };
...@@ -5251,7 +5257,7 @@ Filters.prototype.isHideValue = function(val, isDateTimeFormat) { ...@@ -5251,7 +5257,7 @@ Filters.prototype.isHideValue = function(val, isDateTimeFormat) {
res = !this.Blank ? true : false; res = !this.Blank ? true : false;
} }
else else
res = !this.Values[val] ? true : false; res = !this.lowerCaseValues[val] ? true : false;
} }
return res; return res;
...@@ -5288,6 +5294,16 @@ Filters.prototype.linearSearch = function(val, array) { ...@@ -5288,6 +5294,16 @@ Filters.prototype.linearSearch = function(val, array) {
else else
return -1; return -1;
}; };
Filters.prototype._initLowerCaseValues = function() {
if(this.lowerCaseValues === null)
{
this.lowerCaseValues = {};
for(var i in this.Values)
{
this.lowerCaseValues[i.toLowerCase()] = true;
}
}
};
Filters.prototype._sortDate = function() Filters.prototype._sortDate = function()
{ {
if(this.Dates && this.Dates.length) if(this.Dates && this.Dates.length)
......
...@@ -3399,13 +3399,15 @@ ...@@ -3399,13 +3399,15 @@
var cell = worksheet.getCell3(i, colId + ref.c1); var cell = worksheet.getCell3(i, colId + ref.c1);
var text = cell.getValueWithFormat(); var text = cell.getValueWithFormat();
var val = cell.getValueWithoutFormat(); var val = cell.getValueWithoutFormat();
var textLowerCase = text.toLowerCase();
isDateTimeFormat = cell.getNumFormat().isDateTimeFormat(); isDateTimeFormat = cell.getNumFormat().isDateTimeFormat();
//if(isDateTimeFormat) //if(isDateTimeFormat)
//dataValue = NumFormat.prototype.parseDate(val); //dataValue = NumFormat.prototype.parseDate(val);
//check duplicate value //check duplicate value
if(temp.hasOwnProperty(text)) if(temp.hasOwnProperty(textLowerCase))
continue; continue;
//apply filter by current button //apply filter by current button
...@@ -3437,7 +3439,7 @@ ...@@ -3437,7 +3439,7 @@
addValueToMenuObj(tempResult, count); addValueToMenuObj(tempResult, count);
temp[text] = 1; temp[textLowerCase] = 1;
count++; count++;
} }
} }
...@@ -3453,7 +3455,7 @@ ...@@ -3453,7 +3455,7 @@
worksheet.setRowHidden(false, i, i); worksheet.setRowHidden(false, i, i);
addValueToMenuObj(tempResult, count); addValueToMenuObj(tempResult, count);
temp[text] = 1; temp[textLowerCase] = 1;
count++; count++;
} }
......
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