diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index c2870b3e0..1c4513940 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -526,7 +526,11 @@ define([ win.setSettings(rangePr, dateTypes, defRangePr); }, - onClear: function(menu, item) { + onClear: function(menu, item, e) { + Common.NotificationCenter.trigger('protect:check', this.onClearCallback, this, [menu, item]); + }, + + onClearCallback: function(menu, item) { if (this.api) { if (item.value == Asc.c_oAscCleanOptions.Comments) { this.api.asc_RemoveAllComments(!this.permissions.canDeleteComments, true);// 1 param = true if remove only my comments, 2 param - remove current comments diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 8d924eab0..e6dd18175 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -1478,6 +1478,10 @@ define([ }, onClearStyleMenu: function(menu, item, e) { + Common.NotificationCenter.trigger('protect:check', this.onClearStyleMenuCallback, this, [menu, item]); + }, + + onClearStyleMenuCallback: function(menu, item, e) { if (this.api) { if (item.value == Asc.c_oAscCleanOptions.Comments) { this.api.asc_RemoveAllComments(!this.mode.canDeleteComments, true);// 1 param = true if remove only my comments, 2 param - remove current comments diff --git a/apps/spreadsheeteditor/main/app/controller/WBProtection.js b/apps/spreadsheeteditor/main/app/controller/WBProtection.js index e4dffaee0..2e143e4c4 100644 --- a/apps/spreadsheeteditor/main/app/controller/WBProtection.js +++ b/apps/spreadsheeteditor/main/app/controller/WBProtection.js @@ -251,7 +251,7 @@ define([ onLockOptionClick: function(type, value) { switch (type) { case 0: // cell - // this._originalProps.asc_getStyleInfo().asc_setShowRowHeaders(this.api, this._originalProps, value=='checked'); + this.api.asc_setCellLocked(value=='checked'); break; case 1: // shape break; @@ -319,6 +319,10 @@ define([ var need_disable = (selectionType === Asc.c_oAscSelectionType.RangeCells || selectionType === Asc.c_oAscSelectionType.RangeCol || selectionType === Asc.c_oAscSelectionType.RangeRow || selectionType === Asc.c_oAscSelectionType.RangeMax); Common.Utils.lockControls(SSE.enumLock.selRange, need_disable, { array: [this.view.chLockedText, this.view.chLockedShape]}); + + var xfs = info.asc_getXfs(); + this.view.chLockedCell.setValue(!!xfs.asc_getLocked(), true); + this.view.chHiddenFormula.setValue(!!xfs.asc_getHidden(), true); }, onCoAuthoringDisconnect: function() {