[SSE] Check clear cell on protected sheet

This commit is contained in:
Julia Radzhabova 2021-07-20 13:03:44 +03:00
parent 0d666fe210
commit de3786afae
3 changed files with 14 additions and 2 deletions

View file

@ -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

View file

@ -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

View file

@ -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() {