Commit 189ec0f4 authored by GoshaZotov's avatar GoshaZotov

fix bug 32472 - Настройки для числовых фильтров не производят выборку, если...

fix bug 32472 - Настройки для числовых фильтров не производят выборку, если формат Currency, Accounting или Percentage
parent 652ea319
...@@ -5994,7 +5994,7 @@ DynamicFilter.prototype.init = function(range) { ...@@ -5994,7 +5994,7 @@ DynamicFilter.prototype.init = function(range) {
var counter = 0; var counter = 0;
range._foreach2(function(cell){ range._foreach2(function(cell){
var val = parseFloat(cell.getValue()); var val = parseFloat(cell.getValueWithoutFormat());
if(!isNaN(val)) if(!isNaN(val))
{ {
...@@ -6277,7 +6277,7 @@ Top10.prototype.init = function(range, reWrite){ ...@@ -6277,7 +6277,7 @@ Top10.prototype.init = function(range, reWrite){
var alreadyAddValues = {}; var alreadyAddValues = {};
var count = 0; var count = 0;
range._foreach2(function(cell){ range._foreach2(function(cell){
var val = parseFloat(cell.getValue()); var val = parseFloat(cell.getValueWithoutFormat());
if(!isNaN(val) && !alreadyAddValues[val]) if(!isNaN(val) && !alreadyAddValues[val])
{ {
......
...@@ -565,7 +565,13 @@ ...@@ -565,7 +565,13 @@
{ {
var cell = worksheet.getCell3(i, filterObj.ColId + autoFilter.Ref.c1); var cell = worksheet.getCell3(i, filterObj.ColId + autoFilter.Ref.c1);
var isDateTimeFormat = cell.getNumFormat().isDateTimeFormat(); var isDateTimeFormat = cell.getNumFormat().isDateTimeFormat();
var currentValue = isDateTimeFormat ? cell.getValueWithoutFormat() : cell.getValueWithFormat(); var isNumberFilter = false;
if(newFilterColumn.CustomFiltersObj || newFilterColumn.Top10 || newFilterColumn.DynamicFilter)
{
isNumberFilter = true;
}
var currentValue = (isDateTimeFormat || isNumberFilter) ? cell.getValueWithoutFormat() : cell.getValueWithFormat();
var isSetHidden = newFilterColumn.isHideValue(currentValue, isDateTimeFormat, null, cell); var isSetHidden = newFilterColumn.isHideValue(currentValue, isDateTimeFormat, null, cell);
...@@ -2633,7 +2639,14 @@ ...@@ -2633,7 +2639,14 @@
{ {
var cell = worksheet.getCell3(r, colId + c); var cell = worksheet.getCell3(r, colId + c);
var isDateTimeFormat = cell.getNumFormat().isDateTimeFormat(); var isDateTimeFormat = cell.getNumFormat().isDateTimeFormat();
var val = isDateTimeFormat ? cell.getValueWithoutFormat() : cell.getValueWithFormat()
var isNumberFilter = false;
if(newFilterColumn.CustomFiltersObj || newFilterColumn.Top10 || newFilterColumn.DynamicFilter)
{
isNumberFilter = true;
}
var val = (isDateTimeFormat || isNumberFilter) ? cell.getValueWithoutFormat() : cell.getValueWithFormat()
if(filterColumns[j].isHideValue(val, isDateTimeFormat, null, cell)) if(filterColumns[j].isHideValue(val, isDateTimeFormat, null, cell))
{ {
...@@ -3660,7 +3673,7 @@ ...@@ -3660,7 +3673,7 @@
//filter current button //filter current button
var checkValue = isDateTimeFormat ? val : text; var checkValue = isDateTimeFormat ? val : text;
if (!currentFilterColumn.Top10 && !currentFilterColumn.CustomFiltersObj && if (!currentFilterColumn.Top10 && !currentFilterColumn.CustomFiltersObj &&
!currentFilterColumn.ColorFilter && !currentFilterColumn.isHideValue(checkValue, isDateTimeFormat)) !currentFilterColumn.ColorFilter && !currentFilterColumn.DynamicFilter && !currentFilterColumn.isHideValue(checkValue, isDateTimeFormat))
{ {
if(isOpenHiddenRows) if(isOpenHiddenRows)
worksheet.setRowHidden(false, i, i); worksheet.setRowHidden(false, i, i);
......
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