diff --git a/apps/spreadsheeteditor/main/app/controller/WBProtection.js b/apps/spreadsheeteditor/main/app/controller/WBProtection.js index 2e143e4c4..f11880bc8 100644 --- a/apps/spreadsheeteditor/main/app/controller/WBProtection.js +++ b/apps/spreadsheeteditor/main/app/controller/WBProtection.js @@ -254,8 +254,14 @@ define([ this.api.asc_setCellLocked(value=='checked'); break; case 1: // shape + var props = new Asc.asc_CImgProperty(); + props.asc_putProtectionLocked(value=='checked'); + this.api.asc_setGraphicObjectProps(props); break; case 2: // text + var props = new Asc.asc_CImgProperty(); + props.asc_putProtectionLockText(value=='checked'); + this.api.asc_setGraphicObjectProps(props); break; case 3: // formula break; @@ -323,6 +329,24 @@ define([ var xfs = info.asc_getXfs(); this.view.chLockedCell.setValue(!!xfs.asc_getLocked(), true); this.view.chHiddenFormula.setValue(!!xfs.asc_getHidden(), true); + + if (selectionType === Asc.c_oAscSelectionType.RangeSlicer || selectionType === Asc.c_oAscSelectionType.RangeImage || + selectionType === Asc.c_oAscSelectionType.RangeShape || selectionType === Asc.c_oAscSelectionType.RangeShapeText || + selectionType === Asc.c_oAscSelectionType.RangeChart || selectionType === Asc.c_oAscSelectionType.RangeChartText) { + var selectedObjects = this.api.asc_getGraphicObjectProps(); + for (var i = 0; i < selectedObjects.length; i++) { + if (selectedObjects[i].asc_getObjectType() == Asc.c_oAscTypeSelectElement.Image) { + var elValue = selectedObjects[i].asc_getObjectValue(); + var locktext = elValue.asc_getProtectionLockText(), + lock = elValue.asc_getProtectionLocked(); + this.view.chLockedText.setValue(locktext!==undefined ? !!locktext : 'indeterminate', true); + this.view.chLockedShape.setValue(lock!==undefined ? !!lock : 'indeterminate', true); + Common.Utils.lockControls(SSE.enumLock.wsLockText, locktext===null, { array: [this.view.chLockedText]}); + Common.Utils.lockControls(SSE.enumLock.wsLockShape, lock===null, { array: [this.view.chLockedShape]}); + break; + } + } + } }, onCoAuthoringDisconnect: function() { diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index c57d8529f..a11b5d399 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -101,7 +101,9 @@ define([ sheetView: 'sheet-view', wbLock: 'workbook-lock', wsLock: 'worksheet-lock', - itemsDisabled: 'all-items-disabled' + itemsDisabled: 'all-items-disabled', + wsLockText: 'worksheet-lock-text', + wsLockShape: 'worksheet-lock-shape' }; SSE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend({ diff --git a/apps/spreadsheeteditor/main/app/view/WBProtection.js b/apps/spreadsheeteditor/main/app/view/WBProtection.js index da36a529a..3bcc55f71 100644 --- a/apps/spreadsheeteditor/main/app/view/WBProtection.js +++ b/apps/spreadsheeteditor/main/app/view/WBProtection.js @@ -145,13 +145,13 @@ define([ this.chLockedShape = new Common.UI.CheckBox({ labelText: this.txtLockedShape, - lock : [_set.selRange, _set.selRangeEdit, _set.wbLock, _set.lostConnect, _set.coAuth, _set['Objects']] + lock : [_set.selRange, _set.selRangeEdit, _set.wbLock, _set.lostConnect, _set.coAuth, _set['Objects'], _set.wsLockShape] }); this.lockedControls.push(this.chLockedShape); this.chLockedText = new Common.UI.CheckBox({ labelText: this.txtLockedText, - lock : [_set.selRange, _set.selRangeEdit, _set.selRangeEdit, _set.selImage, _set.selSlicer, _set.wbLock, _set.lostConnect, _set.coAuth, _set['Objects']] + lock : [_set.selRange, _set.selRangeEdit, _set.selRangeEdit, _set.selImage, _set.selSlicer, _set.wbLock, _set.lostConnect, _set.coAuth, _set['Objects'], _set.wsLockText] }); this.lockedControls.push(this.chLockedText);