[SSE] Fix print titles

This commit is contained in:
Julia Radzhabova 2020-03-18 15:09:39 +03:00
parent d8e79bded7
commit 2f2d38d22a
2 changed files with 17 additions and 17 deletions

View file

@ -111,7 +111,7 @@ define([
}, },
comboSheetsChange: function(panel, combo, record) { comboSheetsChange: function(panel, combo, record) {
this.fillPageOptions(panel, this._changedProps[record.value] ? this._changedProps[record.value] : this.api.asc_getPageOptions(record.value), record.value); this.fillPageOptions(panel, this._changedProps[record.value] ? this._changedProps[record.value] : this.api.asc_getPageOptions(record.value, true), record.value);
}, },
fillPageOptions: function(panel, props, sheet) { fillPageOptions: function(panel, props, sheet) {
@ -159,12 +159,12 @@ define([
panel.chPrintGrid.setValue(props.asc_getGridLines(), true); panel.chPrintGrid.setValue(props.asc_getGridLines(), true);
panel.chPrintRows.setValue(props.asc_getHeadings(), true); panel.chPrintRows.setValue(props.asc_getHeadings(), true);
var value = props.asc_getPrintTitlesWidth(); var value = props.asc_getPrintTitlesHeight();
panel.txtRangeTop.setValue((value) ? value : ''); panel.txtRangeTop.setValue((value) ? value : '');
panel.txtRangeTop.checkValidate(); panel.txtRangeTop.checkValidate();
panel.dataRangeTop = value; panel.dataRangeTop = value;
value = props.asc_getPrintTitlesHeight(); value = props.asc_getPrintTitlesWidth();
panel.txtRangeLeft.setValue((value) ? value : ''); panel.txtRangeLeft.setValue((value) ? value : '');
panel.txtRangeLeft.checkValidate(); panel.txtRangeLeft.checkValidate();
panel.dataRangeLeft = value; panel.dataRangeLeft = value;
@ -228,11 +228,11 @@ define([
props.asc_setPageMargins(opt); props.asc_setPageMargins(opt);
var check = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.None, panel.txtRangeTop.getValue(), false) !== Asc.c_oAscError.ID.DataRangeError; var check = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PrintTitles, panel.txtRangeTop.getValue(), false) !== Asc.c_oAscError.ID.DataRangeError;
props.asc_setPrintTitlesWidth(check ? panel.txtRangeTop.getValue() : panel.dataRangeTop); props.asc_setPrintTitlesHeight(check ? panel.txtRangeTop.getValue() : panel.dataRangeTop);
check = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.None, panel.txtRangeLeft.getValue(), false) !== Asc.c_oAscError.ID.DataRangeError; check = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PrintTitles, panel.txtRangeLeft.getValue(), false) !== Asc.c_oAscError.ID.DataRangeError;
props.asc_setPrintTitlesHeight(check ? panel.txtRangeLeft.getValue() : panel.dataRangeLeft); props.asc_setPrintTitlesWidth(check ? panel.txtRangeLeft.getValue() : panel.dataRangeLeft);
return props; return props;
}, },
@ -383,7 +383,7 @@ define([
propertyChange: function(panel, scale, combo, record) { propertyChange: function(panel, scale, combo, record) {
if (scale === 'scale' && record.value === 'customoptions') { if (scale === 'scale' && record.value === 'customoptions') {
var me = this, var me = this,
props = (me._changedProps.length > 0 && me._changedProps[panel.cmbSheet.getValue()]) ? me._changedProps[panel.cmbSheet.getValue()] : me.api.asc_getPageOptions(panel.cmbSheet.getValue()); props = (me._changedProps.length > 0 && me._changedProps[panel.cmbSheet.getValue()]) ? me._changedProps[panel.cmbSheet.getValue()] : me.api.asc_getPageOptions(panel.cmbSheet.getValue(), true);
var win = new SSE.Views.ScaleDialog({ var win = new SSE.Views.ScaleDialog({
api: me.api, api: me.api,
props: props, props: props,
@ -439,7 +439,7 @@ define([
if (_.isEmpty(value)) { if (_.isEmpty(value)) {
return true; return true;
} }
var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.None, value, false); var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PrintTitles, value, false);
return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true;
}; };
panel.txtRangeLeft.validation = function(value) { panel.txtRangeLeft.validation = function(value) {
@ -447,7 +447,7 @@ define([
if (_.isEmpty(value)) { if (_.isEmpty(value)) {
return true; return true;
} }
var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.None, value, false); var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PrintTitles, value, false);
return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true;
}; };
var data = ((selectdata) ? [{caption: this.textSelectRange, value: 'select'}] : []).concat([ var data = ((selectdata) ? [{caption: this.textSelectRange, value: 'select'}] : []).concat([
@ -503,7 +503,7 @@ define([
win.setSettings({ win.setSettings({
api : me.api, api : me.api,
range : (!_.isEmpty(txtRange.getValue()) && (txtRange.checkValidate()==true)) ? txtRange.getValue() : ((type=='top') ? panel.dataRangeTop : panel.dataRangeLeft), range : (!_.isEmpty(txtRange.getValue()) && (txtRange.checkValidate()==true)) ? txtRange.getValue() : ((type=='top') ? panel.dataRangeTop : panel.dataRangeLeft),
type : Asc.c_oAscSelectionDialogType.Chart type : Asc.c_oAscSelectionDialogType.PrintTitles
}); });
} }
} else { } else {

View file

@ -129,7 +129,7 @@ define([
if (_.isEmpty(value)) { if (_.isEmpty(value)) {
return true; return true;
} }
var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.None, value, false); var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PrintTitles, value, false);
return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true;
} }
}); });
@ -164,7 +164,7 @@ define([
if (_.isEmpty(value)) { if (_.isEmpty(value)) {
return true; return true;
} }
var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.None, value, false); var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PrintTitles, value, false);
return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true;
} }
}); });
@ -198,11 +198,11 @@ define([
}, },
isRangeValid: function() { isRangeValid: function() {
if (this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.None, this.txtRangeTop.getValue(), false) == Asc.c_oAscError.ID.DataRangeError) { if (this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PrintTitles, this.txtRangeTop.getValue(), false) == Asc.c_oAscError.ID.DataRangeError) {
this.txtRangeTop.cmpEl.find('input').focus(); this.txtRangeTop.cmpEl.find('input').focus();
return false; return false;
} }
if (this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.None, this.txtRangeLeft.getValue(), false) == Asc.c_oAscError.ID.DataRangeError) { if (this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PrintTitles, this.txtRangeLeft.getValue(), false) == Asc.c_oAscError.ID.DataRangeError) {
this.txtRangeLeft.cmpEl.find('input').focus(); this.txtRangeLeft.cmpEl.find('input').focus();
return false; return false;
} }
@ -244,7 +244,7 @@ define([
}, },
getSettings: function() { getSettings: function() {
return {width: this.txtRangeTop.getValue(), height: this.txtRangeLeft.getValue()}; return {width: this.txtRangeLeft.getValue(), height: this.txtRangeTop.getValue()};
}, },
onPresetSelect: function(type, menu, item) { onPresetSelect: function(type, menu, item) {
@ -276,7 +276,7 @@ define([
win.setSettings({ win.setSettings({
api : me.api, api : me.api,
range : (!_.isEmpty(txtRange.getValue()) && (txtRange.checkValidate()==true)) ? txtRange.getValue() : ((type=='top') ? me.dataRangeTop : me.dataRangeLeft), range : (!_.isEmpty(txtRange.getValue()) && (txtRange.checkValidate()==true)) ? txtRange.getValue() : ((type=='top') ? me.dataRangeTop : me.dataRangeLeft),
type : Asc.c_oAscSelectionDialogType.Chart type : Asc.c_oAscSelectionDialogType.PrintTitles
}); });
} }
} else { } else {