[SSE] Lock set/add print-area when named ranges are changed, lock clear print-area when print-area is changed.

This commit is contained in:
Julia Radzhabova 2018-09-13 15:54:29 +03:00
parent 71768e13c4
commit a5990305b6
2 changed files with 10 additions and 2 deletions

View file

@ -1705,6 +1705,7 @@ define([
this.onApiPageMargins(props.asc_getPageMargins());
this.api.asc_isLayoutLocked(currentSheet) ? this.onApiLockDocumentProps(currentSheet) : this.onApiUnLockDocumentProps(currentSheet);
this.toolbar.lockToolbar(SSE.enumLock.printAreaLock, this.api.asc_isPrintAreaLocked(currentSheet), {array: [this.toolbar.btnPrintArea]});
},
onUpdateDocumentProps: function(nIndex) {
@ -3029,6 +3030,9 @@ define([
onLockDefNameManager: function(state) {
this._state.namedrange_locked = (state == Asc.c_oAscDefinedNameReason.LockDefNameManager);
this.toolbar.lockToolbar(SSE.enumLock.printAreaLock, this.api.asc_isPrintAreaLocked(this.api.asc_getActiveWorksheetIndex()), {array: [this.toolbar.btnPrintArea]});
this.toolbar.lockToolbar(SSE.enumLock.namedRangeLock, this._state.namedrange_locked, {array: [this.toolbar.btnPrintArea.menu.items[0], this.toolbar.btnPrintArea.menu.items[2]]});
},
DisableToolbar: function(disable, viewMode) {

View file

@ -84,7 +84,9 @@ define([
cantModifyFilter: 'cant-filter',
cantGroup: 'cant-group',
cantGroupUngroup: 'cant-group-ungroup',
docPropsLock: 'doc-props-lock'
docPropsLock: 'doc-props-lock',
printAreaLock: 'print-area-lock',
namedRangeLock: 'named-range-lock'
};
SSE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend({
@ -1411,12 +1413,13 @@ define([
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'btn-print-area',
caption: me.capBtnPrintArea,
lock : [_set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.editCell, _set.selRangeEdit, _set.docPropsLock, _set.lostConnect, _set.coAuth],
lock : [_set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.editCell, _set.selRangeEdit, _set.printAreaLock, _set.lostConnect, _set.coAuth],
menu: new Common.UI.Menu({
cls: 'ppm-toolbar',
items: [
{
caption: me.textSetPrintArea,
lock: [_set.namedRangeLock],
value: Asc.c_oAscChangePrintAreaType.set
},
{
@ -1425,6 +1428,7 @@ define([
},
{
caption: me.textAddPrintArea,
lock: [_set.namedRangeLock],
value: Asc.c_oAscChangePrintAreaType.add
}
]