diff --git a/apps/documenteditor/main/app/view/ParagraphSettingsAdvanced.js b/apps/documenteditor/main/app/view/ParagraphSettingsAdvanced.js index 2fd57511c7..dc40fff780 100644 --- a/apps/documenteditor/main/app/view/ParagraphSettingsAdvanced.js +++ b/apps/documenteditor/main/app/view/ParagraphSettingsAdvanced.js @@ -243,7 +243,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem menuStyle : 'min-width: 85px;', takeFocusOnClose: true }); - this.cmbLineRule.setValue(this.CurLineRuleIdx); + this.cmbLineRule.setValue(''); this.cmbLineRule.on('selected', _.bind(this.onLineRuleSelect, this)); this.numLineHeight = new Common.UI.MetricSpinner({ @@ -855,7 +855,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem this.numSpacingAfter.setValue((value !== null) ? (value<0 ? value : Common.Utils.Metric.fnRecalcFromMM(value)) : '', true); var linerule = props.get_Spacing().get_LineRule(); - this.cmbLineRule.setValue((linerule !== null) ? linerule : '', true); + this.cmbLineRule.setValue((linerule !== null) ? linerule : ''); if(props.get_Spacing() !== null && props.get_Spacing().get_Line() !== null) { this.numLineHeight.setValue((linerule==c_paragraphLinerule.LINERULE_AUTO) ? props.get_Spacing().get_Line() : Common.Utils.Metric.fnRecalcFromMM(props.get_Spacing().get_Line()), true); @@ -995,8 +995,9 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem this._arrLineRule[2].minValue = this._arrLineRule[0].minValue = parseFloat(Common.Utils.Metric.fnRecalcFromMM(0.3).toFixed(2)); this._arrLineRule[2].step = this._arrLineRule[0].step = (Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt) ? 1 : 0.01; if (this.CurLineRuleIdx !== null) { - this.numLineHeight.setDefaultUnit(this._arrLineRule[this.CurLineRuleIdx].defaultUnit); - this.numLineHeight.setStep(this._arrLineRule[this.CurLineRuleIdx].step); + var rec = this._arrLineRule[this.CurLineRuleIdx !== -1 ? this.CurLineRuleIdx : 0]; + this.numLineHeight.setDefaultUnit(rec.defaultUnit); + this.numLineHeight.setStep(rec.step); } }, diff --git a/apps/presentationeditor/main/app/view/ParagraphSettingsAdvanced.js b/apps/presentationeditor/main/app/view/ParagraphSettingsAdvanced.js index 57d45949b3..f1a992b5ba 100644 --- a/apps/presentationeditor/main/app/view/ParagraphSettingsAdvanced.js +++ b/apps/presentationeditor/main/app/view/ParagraphSettingsAdvanced.js @@ -247,7 +247,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced menuStyle : 'min-width: 85px;', takeFocusOnClose: true }); - this.cmbLineRule.setValue(this.CurLineRuleIdx); + this.cmbLineRule.setValue(''); this.cmbLineRule.on('selected', _.bind(this.onLineRuleSelect, this)); this.numLineHeight = new Common.UI.MetricSpinner({ @@ -481,7 +481,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced this.numSpacingAfter.setValue((value !== null) ? (value<0 ? value : Common.Utils.Metric.fnRecalcFromMM(value)) : '', true); var linerule = props.get_Spacing().get_LineRule(); - this.cmbLineRule.setValue((linerule !== null) ? linerule : '', true); + this.cmbLineRule.setValue((linerule !== null) ? linerule : ''); if(props.get_Spacing() !== null && props.get_Spacing().get_Line() !== null) { this.numLineHeight.setValue((linerule==c_paragraphLinerule.LINERULE_AUTO) ? props.get_Spacing().get_Line() : Common.Utils.Metric.fnRecalcFromMM(props.get_Spacing().get_Line()), true); @@ -546,8 +546,9 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced this._arrLineRule[1].minValue = parseFloat(Common.Utils.Metric.fnRecalcFromMM(0.3).toFixed(2)); this._arrLineRule[1].step = (Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt) ? 1 : 0.01; if (this.CurLineRuleIdx !== null) { - this.numLineHeight.setDefaultUnit(this._arrLineRule[this.CurLineRuleIdx].defaultUnit); - this.numLineHeight.setStep(this._arrLineRule[this.CurLineRuleIdx].step); + var rec = this._arrLineRule[this.CurLineRuleIdx !== -1 ? this.CurLineRuleIdx : 0]; + this.numLineHeight.setDefaultUnit(rec.defaultUnit); + this.numLineHeight.setStep(rec.step); } }, diff --git a/apps/spreadsheeteditor/main/app/view/ParagraphSettingsAdvanced.js b/apps/spreadsheeteditor/main/app/view/ParagraphSettingsAdvanced.js index ebe91e7170..9c76cfbdd1 100644 --- a/apps/spreadsheeteditor/main/app/view/ParagraphSettingsAdvanced.js +++ b/apps/spreadsheeteditor/main/app/view/ParagraphSettingsAdvanced.js @@ -245,7 +245,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced. menuStyle : 'min-width: 85px;', takeFocusOnClose: true }); - this.cmbLineRule.setValue(this.CurLineRuleIdx); + this.cmbLineRule.setValue(''); this.cmbLineRule.on('selected', _.bind(this.onLineRuleSelect, this)); this.numLineHeight = new Common.UI.MetricSpinner({ @@ -477,7 +477,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced. this.numSpacingAfter.setValue((props.asc_getSpacing() !== null && props.asc_getSpacing().asc_getAfter() !== null) ? Common.Utils.Metric.fnRecalcFromMM(props.asc_getSpacing().asc_getAfter()) : '', true); var linerule = props.asc_getSpacing().asc_getLineRule(); - this.cmbLineRule.setValue((linerule !== null) ? linerule : '', true); + this.cmbLineRule.setValue((linerule !== null) ? linerule : ''); if(props.asc_getSpacing() !== null && props.asc_getSpacing().asc_getLine() !== null) { this.numLineHeight.setValue((linerule==c_paragraphLinerule.LINERULE_AUTO) ? props.asc_getSpacing().asc_getLine() : Common.Utils.Metric.fnRecalcFromMM(props.asc_getSpacing().asc_getLine()), true); @@ -541,8 +541,9 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced. this._arrLineRule[1].minValue = parseFloat(Common.Utils.Metric.fnRecalcFromMM(0.3).toFixed(2)); this._arrLineRule[1].step = (Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt) ? 1 : 0.01; if (this.CurLineRuleIdx !== null) { - this.numLineHeight.setDefaultUnit(this._arrLineRule[this.CurLineRuleIdx].defaultUnit); - this.numLineHeight.setStep(this._arrLineRule[this.CurLineRuleIdx].step); + var rec = this._arrLineRule[this.CurLineRuleIdx !== -1 ? this.CurLineRuleIdx : 0]; + this.numLineHeight.setDefaultUnit(rec.defaultUnit); + this.numLineHeight.setStep(rec.step); } },