Commit e13742c5 authored by GoshaZotov's avatar GoshaZotov

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

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