[DE] Fix custom page size

This commit is contained in:
Julia Radzhabova 2021-09-07 20:58:45 +03:00
parent 6eb6cb1db5
commit a7d388b996
3 changed files with 15 additions and 3 deletions

View file

@ -242,6 +242,14 @@ define([
this.options.step = step;
},
getMinValue: function(){
return this.options.minValue;
},
getMaxValue: function(){
return this.options.maxValue;
},
getNumberValue: function(){
return this.checkAutoText(this.value) ? -1 : parseFloat(this.value);
},

View file

@ -1079,7 +1079,7 @@ define([
val = this.api.asc_GetTextFormAutoWidth();
if ( (this._state.WidthPlaceholder!==val) || Math.abs(this._state.WidthPlaceholder-val)>0.01) {
this.spnWidth.setDefaultValue(val!==undefined && val!==null ? Common.Utils.Metric.fnRecalcFromMM((val+1) * 25.4 / 20 / 72.0) : this.spnWidth.options.minValue);
this.spnWidth.setDefaultValue(val!==undefined && val!==null ? Common.Utils.Metric.fnRecalcFromMM((val+1) * 25.4 / 20 / 72.0) : this.spnWidth.getMinValue());
this._state.WidthPlaceholder=val;
}

View file

@ -157,8 +157,12 @@ define([
this._noApply = true;
if (record.value<0) {
} else {
this.spnWidth.setValue(Common.Utils.Metric.fnRecalcFromMM(this.isOrientPortrait ? record.size[0] : record.size[1]), true);
this.spnHeight.setValue(Common.Utils.Metric.fnRecalcFromMM(this.isOrientPortrait ? record.size[1] : record.size[0]), true);
var w = Common.Utils.Metric.fnRecalcFromMM(this.isOrientPortrait ? record.size[0] : record.size[1]),
h = Common.Utils.Metric.fnRecalcFromMM(this.isOrientPortrait ? record.size[1] : record.size[0]);
if (w<this.spnWidth.getMinValue() || h<this.spnHeight.getMinValue())
this.cmbPreset.setValue(-1);
this.spnWidth.setValue(w, true);
this.spnHeight.setValue(h, true);
}
this._noApply = false;
}, this));