From e5c35c772e9fb6add0a449b313d8a3c607124757 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 18 Mar 2020 10:08:47 +0300 Subject: [PATCH] [SSE] Fix print titles --- .../main/app/controller/Print.js | 6 ++--- .../main/app/controller/Toolbar.js | 1 - .../main/app/view/PrintTitlesDialog.js | 24 ++++++++++--------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Print.js b/apps/spreadsheeteditor/main/app/controller/Print.js index 3fd6012ca6..3a3231343c 100644 --- a/apps/spreadsheeteditor/main/app/controller/Print.js +++ b/apps/spreadsheeteditor/main/app/controller/Print.js @@ -428,14 +428,14 @@ define([ if (_.isEmpty(value)) { return true; } - var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, value, false); + var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.None, value, false); return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; }; panel.txtRangeLeft.validation = function(value) { if (_.isEmpty(value)) { return true; } - var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, value, false); + var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.None, value, false); return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; }; var data = ((selectdata) ? [{caption: this.textSelectRange, value: 'select'}] : []).concat([ @@ -491,7 +491,7 @@ define([ win.setSettings({ api : me.api, range : (!_.isEmpty(txtRange.getValue()) && (txtRange.checkValidate()==true)) ? txtRange.getValue() : ((type=='top') ? panel.dataRangeTop : panel.dataRangeLeft), - type : Asc.c_oAscSelectionDialogType.Chart + type : Asc.c_oAscSelectionDialogType.None }); } } else { diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index d9233389dd..87b54ceb21 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -3471,7 +3471,6 @@ define([ } }); win.show(); - win.setSettings(me.api.asc_getPageOptions(me.api.asc_getActiveWorksheetIndex())); Common.component.Analytics.trackEvent('ToolBar', 'Print Titles'); } diff --git a/apps/spreadsheeteditor/main/app/view/PrintTitlesDialog.js b/apps/spreadsheeteditor/main/app/view/PrintTitlesDialog.js index c9e61df6e8..ccc5034f99 100644 --- a/apps/spreadsheeteditor/main/app/view/PrintTitlesDialog.js +++ b/apps/spreadsheeteditor/main/app/view/PrintTitlesDialog.js @@ -129,7 +129,7 @@ define([ if (_.isEmpty(value)) { return true; } - var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, value, false); + var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.None, value, false); return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; } }); @@ -163,7 +163,7 @@ define([ if (_.isEmpty(value)) { return true; } - var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, value, false); + var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.None, value, false); return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; } }); @@ -191,6 +191,8 @@ define([ var $window = this.getChild(); $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); $window.find('input').on('keypress', _.bind(this.onKeyPress, this)); + + this.setSettings(); }, _handleInput: function(state) { @@ -211,14 +213,14 @@ define([ }, setSettings: function (props) { - if (props) { - // var value = props.asc_getPrintTitlesWidth(); - // this.txtRangeTop.setValue((value) ? value : ''); - // this.dataRangeTop = value; - // - // value = props.asc_getPrintTitlesHeight(); - // this.txtRangeLeft.setValue((value) ? value : ''); - // this.dataRangeLeft = value; + if (this.api) { + var value = this.api.asc_getPrintTitlesRange(Asc.c_oAscPrintTitlesRangeType.current, false, this.sheet); + this.txtRangeTop.setValue((value) ? value : ''); + this.dataRangeTop = value; + + value = this.api.asc_getPrintTitlesRange(Asc.c_oAscPrintTitlesRangeType.current, true, this.sheet); + this.txtRangeLeft.setValue((value) ? value : ''); + this.dataRangeLeft = value; } }, @@ -255,7 +257,7 @@ define([ win.setSettings({ api : me.api, range : (!_.isEmpty(txtRange.getValue()) && (txtRange.checkValidate()==true)) ? txtRange.getValue() : ((type=='top') ? me.dataRangeTop : me.dataRangeLeft), - type : Asc.c_oAscSelectionDialogType.Chart + type : Asc.c_oAscSelectionDialogType.None }); } } else {