From 0e68fbe525e5edb3fcdb2ec279aaecfdf02255a3 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 21 Mar 2018 15:28:09 +0300 Subject: [PATCH] [SSE] Show previouse settings for between autofilter (don't change "and/or" option). --- apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js b/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js index 81f59af99..9623612f6 100644 --- a/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js +++ b/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js @@ -850,14 +850,16 @@ define([ newCustomFilter.asc_setCustomFilters((item.value == -2) ? [new Asc.CustomFilter(), new Asc.CustomFilter()]: [new Asc.CustomFilter()]); var newCustomFilters = newCustomFilter.asc_getCustomFilters(); - newCustomFilter.asc_setAnd(true); newCustomFilters[0].asc_setOperator((item.value == -2) ? Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo : item.value); if (item.value == -2) { - newCustomFilters[0].asc_setVal((cond1 == Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo && cond2 == Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo) ? value1 : ''); + var isBetween = (cond1 == Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo && cond2 == Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo); + newCustomFilter.asc_setAnd(isBetween ? isAnd : true); + newCustomFilters[0].asc_setVal(isBetween ? value1 : ''); newCustomFilters[1].asc_setOperator(Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo); - newCustomFilters[1].asc_setVal((cond1 == Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo && cond2 == Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo) ? value2 : ''); + newCustomFilters[1].asc_setVal(isBetween ? value2 : ''); } else { + newCustomFilter.asc_setAnd(true); newCustomFilters[0].asc_setVal((item.value == cond1) ? value1 : ''); }