From a298d8f28bf2a9addadb88377f9f259e003ca719 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 8 Sep 2020 15:48:05 +0300 Subject: [PATCH 1/3] [SSE] Fix Bug 46338 --- .../spreadsheeteditor/main/app/view/CellRangeDialog.js | 10 +++++++--- .../main/app/view/TableOptionsDialog.js | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/CellRangeDialog.js b/apps/spreadsheeteditor/main/app/view/CellRangeDialog.js index de07e7116..8bc2fa066 100644 --- a/apps/spreadsheeteditor/main/app/view/CellRangeDialog.js +++ b/apps/spreadsheeteditor/main/app/view/CellRangeDialog.js @@ -111,10 +111,12 @@ define([ if (settings.api) { me.api = settings.api; + me.wrapEvents = { + onApiRangeChanged: _.bind(me.onApiRangeChanged, me) + }; me.api.asc_setSelectionDialogMode(settings.type, settings.range ? settings.range : ''); - me.api.asc_unregisterCallback('asc_onSelectionRangeChanged', _.bind(me.onApiRangeChanged, me)); - me.api.asc_registerCallback('asc_onSelectionRangeChanged', _.bind(me.onApiRangeChanged, me)); + me.api.asc_registerCallback('asc_onSelectionRangeChanged', me.wrapEvents.onApiRangeChanged); Common.NotificationCenter.trigger('cells:range', settings.type); } @@ -177,8 +179,10 @@ define([ }, onClose: function(event) { - if (this.api) + if (this.api) { this.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.None); + this.api.asc_unregisterCallback('asc_onSelectionRangeChanged', this.wrapEvents.onApiRangeChanged); + } Common.NotificationCenter.trigger('cells:range', Asc.c_oAscSelectionDialogType.None); SSE.getController('RightMenu').SetDisabled(false); diff --git a/apps/spreadsheeteditor/main/app/view/TableOptionsDialog.js b/apps/spreadsheeteditor/main/app/view/TableOptionsDialog.js index 7bd19eb9f..72090c8b6 100644 --- a/apps/spreadsheeteditor/main/app/view/TableOptionsDialog.js +++ b/apps/spreadsheeteditor/main/app/view/TableOptionsDialog.js @@ -133,8 +133,10 @@ define([ if (settings.selectionType) me.selectionType = settings.selectionType; - me.api.asc_unregisterCallback('asc_onSelectionRangeChanged', _.bind(me.onApiRangeChanged, me)); - me.api.asc_registerCallback('asc_onSelectionRangeChanged', _.bind(me.onApiRangeChanged, me)); + me.wrapEvents = { + onApiRangeChanged: _.bind(me.onApiRangeChanged, me) + }; + me.api.asc_registerCallback('asc_onSelectionRangeChanged', me.wrapEvents.onApiRangeChanged); Common.NotificationCenter.trigger('cells:range', Asc.c_oAscSelectionDialogType.FormatTable); } @@ -190,8 +192,10 @@ define([ }, onClose: function(event) { - if (this.api) + if (this.api) { this.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.None); + this.api.asc_unregisterCallback('asc_onSelectionRangeChanged', this.wrapEvents.onApiRangeChanged); + } Common.NotificationCenter.trigger('cells:range', Asc.c_oAscSelectionDialogType.None); Common.NotificationCenter.trigger('edit:complete', this); From 4876101c86d76b7c704660501237951d43f36c98 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 8 Sep 2020 17:36:55 +0300 Subject: [PATCH 2/3] [SSE] Bug 45989 --- .../main/app/controller/PivotTable.js | 1 + .../main/app/view/PivotTable.js | 22 +++++++++---------- .../main/app/view/Toolbar.js | 3 ++- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/PivotTable.js b/apps/spreadsheeteditor/main/app/controller/PivotTable.js index b59919c80..88d0a0341 100644 --- a/apps/spreadsheeteditor/main/app/controller/PivotTable.js +++ b/apps/spreadsheeteditor/main/app/controller/PivotTable.js @@ -386,6 +386,7 @@ define([ var pivotInfo = info.asc_getPivotTableInfo(); Common.Utils.lockControls(SSE.enumLock.noPivot, !pivotInfo, {array: this.view.lockedControls}); + Common.Utils.lockControls(SSE.enumLock.pivotLock, pivotInfo && (info.asc_getLockedPivotTable()===true), {array: this.view.lockedControls}); Common.Utils.lockControls(SSE.enumLock.editPivot, !!pivotInfo, {array: [this.view.btnAddPivot]}); if (pivotInfo) diff --git a/apps/spreadsheeteditor/main/app/view/PivotTable.js b/apps/spreadsheeteditor/main/app/view/PivotTable.js index 50dd0d641..ddf52a806 100644 --- a/apps/spreadsheeteditor/main/app/view/PivotTable.js +++ b/apps/spreadsheeteditor/main/app/view/PivotTable.js @@ -156,25 +156,25 @@ define([ this.chRowHeader = new Common.UI.CheckBox({ labelText: this.textRowHeader, - lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit] + lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit, _set.pivotLock] }); this.lockedControls.push(this.chRowHeader); this.chColHeader = new Common.UI.CheckBox({ labelText: this.textColHeader, - lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit] + lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit, _set.pivotLock] }); this.lockedControls.push(this.chColHeader); this.chRowBanded = new Common.UI.CheckBox({ labelText: this.textRowBanded, - lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit] + lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit, _set.pivotLock] }); this.lockedControls.push(this.chRowBanded); this.chColBanded = new Common.UI.CheckBox({ labelText: this.textColBanded, - lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit] + lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit, _set.pivotLock] }); this.lockedControls.push(this.chColBanded); @@ -191,7 +191,7 @@ define([ iconCls : 'toolbar__icon btn-pivot-layout', caption : this.capLayout, disabled : true, - lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit], + lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit, _set.pivotLock], menu : true }); this.lockedControls.push(this.btnPivotLayout); @@ -201,7 +201,7 @@ define([ iconCls : 'toolbar__icon btn-blank-rows', caption : this.capBlankRows, disabled : true, - lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit], + lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit, _set.pivotLock], menu : true }); this.lockedControls.push(this.btnPivotBlankRows); @@ -211,7 +211,7 @@ define([ iconCls : 'toolbar__icon btn-subtotals', caption : this.capSubtotals, disabled : true, - lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit], + lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit, _set.pivotLock], menu : true }); this.lockedControls.push(this.btnPivotSubtotals); @@ -221,7 +221,7 @@ define([ iconCls : 'toolbar__icon btn-grand-totals', caption : this.capGrandTotals, disabled : true, - lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit], + lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit, _set.pivotLock], menu : true }); this.lockedControls.push(this.btnPivotGrandTotals); @@ -231,7 +231,7 @@ define([ iconCls: 'toolbar__icon btn-update', caption: this.txtRefresh, disabled : true, - lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit] + lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit, _set.pivotLock] }); this.lockedControls.push(this.btnRefreshPivot); @@ -239,7 +239,7 @@ define([ cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-select-pivot', caption: this.txtSelect, - lock: [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit] + lock: [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit, _set.pivotLock] }); this.lockedControls.push(this.btnSelectPivot); @@ -249,7 +249,7 @@ define([ itemWidth : 61, itemHeight : 49, menuMaxHeight : 300, - lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit], + lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit, _set.pivotLock], beforeOpenHandler: function(e) { var cmp = this, menu = cmp.openButton.menu; diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 2263ef1ab..dd30b9bfe 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -95,7 +95,8 @@ define([ noSubitems: 'no-subitems', noSlicerSource: 'no-slicer-source', selSlicer: 'sel-slicer', - cantSort: 'cant-sort' + cantSort: 'cant-sort', + pivotLock: 'pivot-lock' }; SSE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend({ From 462fe199f36dc7b6bd1582d8df1255e266bee574 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 8 Sep 2020 17:37:36 +0300 Subject: [PATCH 3/3] [SSE] Bug 45989 --- apps/spreadsheeteditor/main/app/view/PivotTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/main/app/view/PivotTable.js b/apps/spreadsheeteditor/main/app/view/PivotTable.js index ddf52a806..b274d5da8 100644 --- a/apps/spreadsheeteditor/main/app/view/PivotTable.js +++ b/apps/spreadsheeteditor/main/app/view/PivotTable.js @@ -239,7 +239,7 @@ define([ cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-select-pivot', caption: this.txtSelect, - lock: [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit, _set.pivotLock] + lock: [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit] }); this.lockedControls.push(this.btnSelectPivot);