Commit bb64b214 authored by GoshaZotov's avatar GoshaZotov

fix bug 32526 - Добавленная к форматированной таблице строка итогов попадает в...

fix bug 32526 - Добавленная к форматированной таблице строка итогов попадает в фильтрованный диапазон
parent 82074258
...@@ -555,6 +555,12 @@ ...@@ -555,6 +555,12 @@
var startRow = autoFilter && autoFilter.Ref ? autoFilter.Ref.r1 + 1 : currentFilter.Ref.r1 + 1; var startRow = autoFilter && autoFilter.Ref ? autoFilter.Ref.r1 + 1 : currentFilter.Ref.r1 + 1;
var endRow = autoFilter && autoFilter.Ref ? autoFilter.Ref.r2 : currentFilter.Ref.r2; var endRow = autoFilter && autoFilter.Ref ? autoFilter.Ref.r2 : currentFilter.Ref.r2;
if(currentFilter && !currentFilter.isAutoFilter() && currentFilter.TotalsRowCount)
{
endRow--;
}
for(var i = startRow; i <= endRow; i++) for(var i = startRow; i <= endRow; i++)
{ {
var isHidden = false; var isHidden = false;
...@@ -3582,13 +3588,17 @@ ...@@ -3582,13 +3588,17 @@
_getOpenAndClosedValues: function(filter, colId, isOpenHiddenRows) _getOpenAndClosedValues: function(filter, colId, isOpenHiddenRows)
{ {
//filter - TablePart or AutoFilter
//autoFilter - only autoFilter
var isTablePart = !filter.isAutoFilter();
var autoFilter = isTablePart ? filter.AutoFilter : filter;
var ref = filter.Ref; var ref = filter.Ref;
var filterColumns = filter.FilterColumns; var filterColumns = autoFilter.FilterColumns;
var worksheet = this.worksheet, temp = {}, isDateTimeFormat, /*dataValue,*/ values = []; var worksheet = this.worksheet, temp = {}, isDateTimeFormat, /*dataValue,*/ values = [];
colId = this._getTrueColId(filter, colId); colId = this._getTrueColId(autoFilter, colId);
var currentFilterColumn = this._getFilterColumn(filter, colId); var currentFilterColumn = this._getFilterColumn(autoFilter, colId);
var addValueToMenuObj = function(tempResult, count) var addValueToMenuObj = function(tempResult, count)
{ {
...@@ -3618,7 +3628,8 @@ ...@@ -3618,7 +3628,8 @@
var maxFilterRow = ref.r2; var maxFilterRow = ref.r2;
var automaticRowCount = null; var automaticRowCount = null;
if(filter.isAutoFilter() && filter.isApplyAutoFilter() === false)//нужно подхватить нижние ячейки в случае, если это не применен а/ф
if(!isTablePart && filter.isApplyAutoFilter() === false)//нужно подхватить нижние ячейки в случае, если это не применен а/ф
{ {
var automaticRange = this._getAdjacentCellsAF(filter.Ref, true); var automaticRange = this._getAdjacentCellsAF(filter.Ref, true);
automaticRowCount = automaticRange.r2; automaticRowCount = automaticRange.r2;
...@@ -3627,6 +3638,10 @@ ...@@ -3627,6 +3638,10 @@
maxFilterRow = automaticRowCount; maxFilterRow = automaticRowCount;
} }
if(isTablePart && filter.TotalsRowCount)
{
maxFilterRow--;
}
var individualCount = 0, count = 0, tempResult; var individualCount = 0, count = 0, tempResult;
for(var i = ref.r1 + 1; i <= maxFilterRow; i++) for(var i = ref.r1 + 1; i <= maxFilterRow; i++)
......
...@@ -12837,7 +12837,7 @@ ...@@ -12837,7 +12837,7 @@
//get values //get values
var colId = filterProp.colId; var colId = filterProp.colId;
var openAndClosedValues = ws.autoFilters._getOpenAndClosedValues(autoFilter, colId); var openAndClosedValues = ws.autoFilters._getOpenAndClosedValues(filter, colId);
var values = openAndClosedValues.values; var values = openAndClosedValues.values;
var automaticRowCount = openAndClosedValues.automaticRowCount; var automaticRowCount = openAndClosedValues.automaticRowCount;
var filters = ws.autoFilters._getFilterColumn(autoFilter, colId); var filters = ws.autoFilters._getFilterColumn(autoFilter, colId);
......
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