From b01e8e59a1bab4ccf02e4a7f97a7cef401dca852 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 16 Mar 2017 17:46:28 +0300 Subject: [PATCH] [SSE] Fix Bug 34315. --- .../main/app/controller/Toolbar.js | 15 +++++++++++---- apps/spreadsheeteditor/main/app/view/Statusbar.js | 6 +++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index ccf5d99d4..60bdb4799 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -87,7 +87,6 @@ define([ underline: undefined, wrap: undefined, merge: undefined, - filter: undefined, angle: undefined, controlsdisabled: { rows: undefined, @@ -97,6 +96,8 @@ define([ filters: undefined }, selection_type: undefined, + filter: undefined, + filterapplied: false, tablestylename: undefined, tablename: undefined, namedrange_locked: false, @@ -1971,11 +1972,17 @@ define([ } } - this._state.tablename = (formatTableInfo) ? formatTableInfo.asc_getTableName() : undefined; - need_disable = this._state.controlsdisabled.filters || !filterInfo || (filterInfo.asc_getIsApplyAutoFilter()!==true); toolbar.lockToolbar(SSE.enumLock.ruleDelFilter, need_disable, {array:[toolbar.btnClearAutofilter,toolbar.mnuitemClearFilter]}); - this.getApplication().getController('Statusbar').onApiFilterInfo(!need_disable); + + var old_name = this._state.tablename; + this._state.tablename = (formatTableInfo) ? formatTableInfo.asc_getTableName() : undefined; + + var old_applied = this._state.filterapplied; + this._state.filterapplied = this._state.filter && filterInfo.asc_getIsApplyAutoFilter(); + + if (this._state.tablename !== old_name || this._state.filterapplied !== old_applied) + this.getApplication().getController('Statusbar').onApiFilterInfo(!need_disable); this._state.multiselect = info.asc_getFlags().asc_getMultiselect(); toolbar.lockToolbar(SSE.enumLock.multiselect, this._state.multiselect, { array: [toolbar.btnTableTemplate, toolbar.btnInsertHyperlink]}); diff --git a/apps/spreadsheeteditor/main/app/view/Statusbar.js b/apps/spreadsheeteditor/main/app/view/Statusbar.js index 2d2bc1859..409b65247 100644 --- a/apps/spreadsheeteditor/main/app/view/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/view/Statusbar.js @@ -437,8 +437,12 @@ define([ } else if (countFilter) {// filter mode if (!this.boxFiltered.is(':visible')) this.boxFiltered.show(); this.labelFiltered.text(this.filteredText); - } else { + } else if (countFilter !== undefined && countFilter !== null){ if (this.boxFiltered.is(':visible')) this.boxFiltered.hide(); + } else { + var filterInfo = this.api.asc_getCellInfo().asc_getAutoFilterInfo(), + need_disable = !filterInfo || (filterInfo.asc_getIsApplyAutoFilter()!==true); + this.setFilteredInfo(!need_disable); } var me = this;