[SSE] Set shape/text protect settings
This commit is contained in:
parent
de3786afae
commit
a256c9413b
|
@ -254,8 +254,14 @@ define([
|
||||||
this.api.asc_setCellLocked(value=='checked');
|
this.api.asc_setCellLocked(value=='checked');
|
||||||
break;
|
break;
|
||||||
case 1: // shape
|
case 1: // shape
|
||||||
|
var props = new Asc.asc_CImgProperty();
|
||||||
|
props.asc_putProtectionLocked(value=='checked');
|
||||||
|
this.api.asc_setGraphicObjectProps(props);
|
||||||
break;
|
break;
|
||||||
case 2: // text
|
case 2: // text
|
||||||
|
var props = new Asc.asc_CImgProperty();
|
||||||
|
props.asc_putProtectionLockText(value=='checked');
|
||||||
|
this.api.asc_setGraphicObjectProps(props);
|
||||||
break;
|
break;
|
||||||
case 3: // formula
|
case 3: // formula
|
||||||
break;
|
break;
|
||||||
|
@ -323,6 +329,24 @@ define([
|
||||||
var xfs = info.asc_getXfs();
|
var xfs = info.asc_getXfs();
|
||||||
this.view.chLockedCell.setValue(!!xfs.asc_getLocked(), true);
|
this.view.chLockedCell.setValue(!!xfs.asc_getLocked(), true);
|
||||||
this.view.chHiddenFormula.setValue(!!xfs.asc_getHidden(), 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() {
|
onCoAuthoringDisconnect: function() {
|
||||||
|
|
|
@ -101,7 +101,9 @@ define([
|
||||||
sheetView: 'sheet-view',
|
sheetView: 'sheet-view',
|
||||||
wbLock: 'workbook-lock',
|
wbLock: 'workbook-lock',
|
||||||
wsLock: 'worksheet-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({
|
SSE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend({
|
||||||
|
|
|
@ -145,13 +145,13 @@ define([
|
||||||
|
|
||||||
this.chLockedShape = new Common.UI.CheckBox({
|
this.chLockedShape = new Common.UI.CheckBox({
|
||||||
labelText: this.txtLockedShape,
|
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.lockedControls.push(this.chLockedShape);
|
||||||
|
|
||||||
this.chLockedText = new Common.UI.CheckBox({
|
this.chLockedText = new Common.UI.CheckBox({
|
||||||
labelText: this.txtLockedText,
|
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);
|
this.lockedControls.push(this.chLockedText);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue