Compare commits
7 commits
master
...
feature/sp
Author | SHA1 | Date | |
---|---|---|---|
88a7d76b9c | |||
d4574ef39c | |||
af6e58fd87 | |||
10b2d8e5b2 | |||
8c8a562637 | |||
8a0ade63f5 | |||
93ba07adeb |
|
@ -379,10 +379,12 @@ var metrics = new(function() {
|
||||||
return me.defaultMetric;
|
return me.defaultMetric;
|
||||||
},
|
},
|
||||||
|
|
||||||
fnRecalcToMM: function(value) {
|
fnRecalcToMM: function(value, unit) {
|
||||||
// value in pt/cm/inch. need to convert to mm
|
// value in pt/cm/inch. need to convert to mm
|
||||||
|
if(unit===undefined)
|
||||||
|
unit=me.currentMetric;
|
||||||
if (value!==null && value!==undefined) {
|
if (value!==null && value!==undefined) {
|
||||||
switch (me.currentMetric) {
|
switch (unit) {
|
||||||
case me.c_MetricUnits.cm:
|
case me.c_MetricUnits.cm:
|
||||||
return value * 10;
|
return value * 10;
|
||||||
case me.c_MetricUnits.pt:
|
case me.c_MetricUnits.pt:
|
||||||
|
@ -394,9 +396,11 @@ var metrics = new(function() {
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
|
|
||||||
fnRecalcFromMM: function(value) {
|
fnRecalcFromMM: function(value, unit) {
|
||||||
// value in mm. need to convert to pt/cm/inch
|
// value in mm. need to convert to pt/cm/inch
|
||||||
switch (me.currentMetric) {
|
if(unit===undefined)
|
||||||
|
unit=me.currentMetric;
|
||||||
|
switch (unit) {
|
||||||
case me.c_MetricUnits.cm:
|
case me.c_MetricUnits.cm:
|
||||||
return parseFloat((value/10.).toFixed(4));
|
return parseFloat((value/10.).toFixed(4));
|
||||||
case me.c_MetricUnits.pt:
|
case me.c_MetricUnits.pt:
|
||||||
|
|
|
@ -89,9 +89,9 @@ define([
|
||||||
this.isChart = false;
|
this.isChart = false;
|
||||||
|
|
||||||
this._arrLineRule = [
|
this._arrLineRule = [
|
||||||
{displayValue: this.textAtLeast,defaultValue: 5, value: c_paragraphLinerule.LINERULE_LEAST, minValue: 0.03, step: 0.01, defaultUnit: 'cm'},
|
{displayValue: this.textAtLeast,defaultValue: 4.24, value: c_paragraphLinerule.LINERULE_LEAST, minValue: 0.03, step: 1, defaultUnit: 'pt'},
|
||||||
{displayValue: this.textAuto, defaultValue: 1, value: c_paragraphLinerule.LINERULE_AUTO, minValue: 0.5, step: 0.01, defaultUnit: ''},
|
{displayValue: this.textAuto, defaultValue: 1, value: c_paragraphLinerule.LINERULE_AUTO, minValue: 0.5, step: 0.01, defaultUnit: ''},
|
||||||
{displayValue: this.textExact, defaultValue: 5, value: c_paragraphLinerule.LINERULE_EXACT, minValue: 0.03, step: 0.01, defaultUnit: 'cm'}
|
{displayValue: this.textExact, defaultValue: 4.24, value: c_paragraphLinerule.LINERULE_EXACT, minValue: 0.03, step: 1, defaultUnit: 'pt'}
|
||||||
];
|
];
|
||||||
|
|
||||||
this._arrSpecial = [
|
this._arrSpecial = [
|
||||||
|
@ -136,11 +136,11 @@ define([
|
||||||
|
|
||||||
this.numSpacingBefore = new Common.UI.MetricSpinner({
|
this.numSpacingBefore = new Common.UI.MetricSpinner({
|
||||||
el: $markup.findById('#paragraph-spin-spacing-before'),
|
el: $markup.findById('#paragraph-spin-spacing-before'),
|
||||||
step: .1,
|
step: 1,
|
||||||
width: 85,
|
width: 85,
|
||||||
value: '',
|
value: '',
|
||||||
defaultUnit : "cm",
|
defaultUnit : "pt",
|
||||||
maxValue: 55.88,
|
maxValue: 1584,
|
||||||
minValue: 0,
|
minValue: 0,
|
||||||
allowAuto : true,
|
allowAuto : true,
|
||||||
autoText : this.txtAutoText,
|
autoText : this.txtAutoText,
|
||||||
|
@ -151,11 +151,11 @@ define([
|
||||||
|
|
||||||
this.numSpacingAfter = new Common.UI.MetricSpinner({
|
this.numSpacingAfter = new Common.UI.MetricSpinner({
|
||||||
el: $markup.findById('#paragraph-spin-spacing-after'),
|
el: $markup.findById('#paragraph-spin-spacing-after'),
|
||||||
step: .1,
|
step: 1,
|
||||||
width: 85,
|
width: 85,
|
||||||
value: '',
|
value: '',
|
||||||
defaultUnit : "cm",
|
defaultUnit : "pt",
|
||||||
maxValue: 55.88,
|
maxValue: 1584,
|
||||||
minValue: 0,
|
minValue: 0,
|
||||||
allowAuto : true,
|
allowAuto : true,
|
||||||
autoText : this.txtAutoText,
|
autoText : this.txtAutoText,
|
||||||
|
@ -273,15 +273,16 @@ define([
|
||||||
onNumLineHeightChange: function(field, newValue, oldValue, eOpts){
|
onNumLineHeightChange: function(field, newValue, oldValue, eOpts){
|
||||||
if ( this.cmbLineRule.getRawValue() === '' )
|
if ( this.cmbLineRule.getRawValue() === '' )
|
||||||
return;
|
return;
|
||||||
var type = c_paragraphLinerule.LINERULE_AUTO;
|
var type = c_paragraphLinerule.LINERULE_AUTO;
|
||||||
if (this.api)
|
if (this.api)
|
||||||
this.api.put_PrLineSpacing(this.cmbLineRule.getValue(), (this.cmbLineRule.getValue()==c_paragraphLinerule.LINERULE_AUTO) ? field.getNumberValue() : Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
|
// this.api.put_PrLineSpacing(this.cmbLineRule.getValue(), (this.cmbLineRule.getValue()==c_paragraphLinerule.LINERULE_AUTO) ? field.getNumberValue() : field.getNumberValue()* 25.4 / 72.0);
|
||||||
|
this.api.put_PrLineSpacing(this.cmbLineRule.getValue(), (this.cmbLineRule.getValue()==c_paragraphLinerule.LINERULE_AUTO) ? field.getNumberValue() : Common.Utils.Metric.fnRecalcToMM(field.getNumberValue(),Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
},
|
},
|
||||||
|
|
||||||
onNumSpacingBeforeChange: function(field, newValue, oldValue, eOpts){
|
onNumSpacingBeforeChange: function(field, newValue, oldValue, eOpts){
|
||||||
if (this.api) {
|
if (this.api) {
|
||||||
var num = field.getNumberValue();
|
var num = field.getNumberValue();
|
||||||
this._state.LineSpacingBefore = (num<0) ? -1 : Common.Utils.Metric.fnRecalcToMM(num);
|
this._state.LineSpacingBefore = (num<0) ? -1 : Common.Utils.Metric.fnRecalcToMM(num,Common.Utils.Metric.c_MetricUnits.pt);
|
||||||
this.api.put_LineSpacingBeforeAfter(0, this._state.LineSpacingBefore);
|
this.api.put_LineSpacingBeforeAfter(0, this._state.LineSpacingBefore);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -289,7 +290,7 @@ define([
|
||||||
onNumSpacingAfterChange: function(field, newValue, oldValue, eOpts){
|
onNumSpacingAfterChange: function(field, newValue, oldValue, eOpts){
|
||||||
if (this.api){
|
if (this.api){
|
||||||
var num = field.getNumberValue();
|
var num = field.getNumberValue();
|
||||||
this._state.LineSpacingAfter = (num<0) ? -1 : Common.Utils.Metric.fnRecalcToMM(num);
|
this._state.LineSpacingAfter = (num<0) ? -1 : Common.Utils.Metric.fnRecalcToMM(num,Common.Utils.Metric.c_MetricUnits.pt);
|
||||||
this.api.put_LineSpacingBeforeAfter(1, this._state.LineSpacingAfter);
|
this.api.put_LineSpacingBeforeAfter(1, this._state.LineSpacingAfter);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -328,7 +329,8 @@ define([
|
||||||
if ( linerule == c_paragraphLinerule.LINERULE_AUTO ) {
|
if ( linerule == c_paragraphLinerule.LINERULE_AUTO ) {
|
||||||
val = line;
|
val = line;
|
||||||
} else if (linerule !== null && line !== null ) {
|
} else if (linerule !== null && line !== null ) {
|
||||||
val = Common.Utils.Metric.fnRecalcFromMM(line);
|
val = Common.Utils.Metric.fnRecalcFromMM(line, Common.Utils.Metric.c_MetricUnits.pt);
|
||||||
|
//val=parseFloat((line * 72.0 / 25.4).toFixed(3));
|
||||||
}
|
}
|
||||||
this.numLineHeight.setValue((val !== null) ? val : '', true);
|
this.numLineHeight.setValue((val !== null) ? val : '', true);
|
||||||
|
|
||||||
|
@ -451,7 +453,7 @@ define([
|
||||||
if ( Spacing.LineRule == c_paragraphLinerule.LINERULE_AUTO ) {
|
if ( Spacing.LineRule == c_paragraphLinerule.LINERULE_AUTO ) {
|
||||||
val = Spacing.Line;
|
val = Spacing.Line;
|
||||||
} else if (Spacing.LineRule !== null && Spacing.Line !== null ) {
|
} else if (Spacing.LineRule !== null && Spacing.Line !== null ) {
|
||||||
val = Common.Utils.Metric.fnRecalcFromMM(Spacing.Line);
|
val = Common.Utils.Metric.fnRecalcFromMM(Spacing.Line, Common.Utils.Metric.c_MetricUnits.pt);
|
||||||
}
|
}
|
||||||
this.numLineHeight.setValue((val !== null) ? val : '', true);
|
this.numLineHeight.setValue((val !== null) ? val : '', true);
|
||||||
|
|
||||||
|
@ -461,14 +463,14 @@ define([
|
||||||
if ( Math.abs(this._state.LineSpacingBefore-Spacing.Before)>0.001 ||
|
if ( Math.abs(this._state.LineSpacingBefore-Spacing.Before)>0.001 ||
|
||||||
(this._state.LineSpacingBefore===null || Spacing.Before===null)&&(this._state.LineSpacingBefore!==Spacing.Before)) {
|
(this._state.LineSpacingBefore===null || Spacing.Before===null)&&(this._state.LineSpacingBefore!==Spacing.Before)) {
|
||||||
|
|
||||||
this.numSpacingBefore.setValue((Spacing.Before !== null) ? ((Spacing.Before<0) ? Spacing.Before : Common.Utils.Metric.fnRecalcFromMM(Spacing.Before) ) : '', true);
|
this.numSpacingBefore.setValue((Spacing.Before !== null) ? ((Spacing.Before<0) ? Spacing.Before : Common.Utils.Metric.fnRecalcFromMM(Spacing.Before, Common.Utils.Metric.c_MetricUnits.pt) ) : '', true);
|
||||||
this._state.LineSpacingBefore=Spacing.Before;
|
this._state.LineSpacingBefore=Spacing.Before;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Math.abs(this._state.LineSpacingAfter-Spacing.After)>0.001 ||
|
if ( Math.abs(this._state.LineSpacingAfter-Spacing.After)>0.001 ||
|
||||||
(this._state.LineSpacingAfter===null || Spacing.After===null)&&(this._state.LineSpacingAfter!==Spacing.After)) {
|
(this._state.LineSpacingAfter===null || Spacing.After===null)&&(this._state.LineSpacingAfter!==Spacing.After)) {
|
||||||
|
|
||||||
this.numSpacingAfter.setValue((Spacing.After !== null) ? ((Spacing.After<0) ? Spacing.After : Common.Utils.Metric.fnRecalcFromMM(Spacing.After) ) : '', true);
|
this.numSpacingAfter.setValue((Spacing.After !== null) ? ((Spacing.After<0) ? Spacing.After : Common.Utils.Metric.fnRecalcFromMM(Spacing.After, Common.Utils.Metric.c_MetricUnits.pt) ) : '', true);
|
||||||
this._state.LineSpacingAfter=Spacing.After;
|
this._state.LineSpacingAfter=Spacing.After;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -486,6 +488,7 @@ define([
|
||||||
(this._state.LeftIndent===null || left===null)&&(this._state.LeftIndent!==left)) {
|
(this._state.LeftIndent===null || left===null)&&(this._state.LeftIndent!==left)) {
|
||||||
this.numIndentsLeft.setValue(left!==null ? Common.Utils.Metric.fnRecalcFromMM(left) : '', true);
|
this.numIndentsLeft.setValue(left!==null ? Common.Utils.Metric.fnRecalcFromMM(left) : '', true);
|
||||||
this._state.LeftIndent=left;
|
this._state.LeftIndent=left;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Math.abs(this._state.FirstLine-first)>0.001 ||
|
if ( Math.abs(this._state.FirstLine-first)>0.001 ||
|
||||||
|
@ -551,16 +554,20 @@ define([
|
||||||
if (this.spinners) {
|
if (this.spinners) {
|
||||||
for (var i=0; i<this.spinners.length; i++) {
|
for (var i=0; i<this.spinners.length; i++) {
|
||||||
var spinner = this.spinners[i];
|
var spinner = this.spinners[i];
|
||||||
spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
|
if(spinner.el.id != 'paragraph-spin-spacing-before' && spinner.el.id != 'paragraph-spin-spacing-after')
|
||||||
if (spinner.el.id == 'paragraphadv-spin-position' || spinner.el.id == 'paragraph-spin-spacing-before' || spinner.el.id == 'paragraph-spin-spacing-after')
|
spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
|
||||||
|
|
||||||
|
if (spinner.el.id == 'paragraphadv-spin-spacing')
|
||||||
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.01);
|
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.01);
|
||||||
|
else if( spinner.el.id == 'paragraph-spin-spacing-before' || spinner.el.id == 'paragraph-spin-spacing-after'){
|
||||||
|
spinner.setStep(1);
|
||||||
|
spinner.setDefaultUnit(Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.1);
|
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this._arrLineRule[2].defaultUnit = this._arrLineRule[0].defaultUnit = Common.Utils.Metric.getCurrentMetricName();
|
|
||||||
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._state.LineRuleIdx !== null) {
|
if (this._state.LineRuleIdx !== null) {
|
||||||
this.numLineHeight.setDefaultUnit(this._arrLineRule[this._state.LineRuleIdx].defaultUnit);
|
this.numLineHeight.setDefaultUnit(this._arrLineRule[this._state.LineRuleIdx].defaultUnit);
|
||||||
this.numLineHeight.setStep(this._arrLineRule[this._state.LineRuleIdx].step);
|
this.numLineHeight.setStep(this._arrLineRule[this._state.LineRuleIdx].step);
|
||||||
|
@ -568,15 +575,16 @@ define([
|
||||||
if ( this._state.LineRuleIdx == c_paragraphLinerule.LINERULE_AUTO ) {
|
if ( this._state.LineRuleIdx == c_paragraphLinerule.LINERULE_AUTO ) {
|
||||||
val = this._state.LineHeight;
|
val = this._state.LineHeight;
|
||||||
} else if (this._state.LineHeight !== null ) {
|
} else if (this._state.LineHeight !== null ) {
|
||||||
val = Common.Utils.Metric.fnRecalcFromMM(this._state.LineHeight);
|
|
||||||
|
val = Common.Utils.Metric.fnRecalcFromMM(this._state.LineHeight,Common.Utils.Metric.c_MetricUnits.pt);
|
||||||
}
|
}
|
||||||
this.numLineHeight && this.numLineHeight.setValue((val !== null) ? val : '', true);
|
this.numLineHeight && this.numLineHeight.setValue((val !== null) ? val : '', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
var val = this._state.LineSpacingBefore;
|
var val = this._state.LineSpacingBefore;
|
||||||
this.numSpacingBefore && this.numSpacingBefore.setValue((val !== null) ? ((val<0) ? val : Common.Utils.Metric.fnRecalcFromMM(val) ) : '', true);
|
this.numSpacingBefore && this.numSpacingBefore.setValue((val !== null) ? ((val<0) ? val : Common.Utils.Metric.fnRecalcFromMM(val, Common.Utils.Metric.c_MetricUnits.pt) ) : '', true);
|
||||||
val = this._state.LineSpacingAfter;
|
val = this._state.LineSpacingAfter;
|
||||||
this.numSpacingAfter && this.numSpacingAfter.setValue((val !== null) ? ((val<0) ? val : Common.Utils.Metric.fnRecalcFromMM(val) ) : '', true);
|
this.numSpacingAfter && this.numSpacingAfter.setValue((val !== null) ? ((val<0) ? val : Common.Utils.Metric.fnRecalcFromMM(val, Common.Utils.Metric.c_MetricUnits.pt) ) : '', true);
|
||||||
},
|
},
|
||||||
|
|
||||||
createDelayedElements: function() {
|
createDelayedElements: function() {
|
||||||
|
|
|
@ -99,9 +99,9 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
|
||||||
this.CurLineRuleIdx = this._originalProps.get_Spacing().get_LineRule();
|
this.CurLineRuleIdx = this._originalProps.get_Spacing().get_LineRule();
|
||||||
|
|
||||||
this._arrLineRule = [
|
this._arrLineRule = [
|
||||||
{displayValue: this.textAtLeast,defaultValue: 5, value: c_paragraphLinerule.LINERULE_LEAST, minValue: 0.03, step: 0.01, defaultUnit: 'cm'},
|
{displayValue: this.textAtLeast,defaultValue: 4.24, value: c_paragraphLinerule.LINERULE_LEAST, minValue: 0.03, step: 1, defaultUnit: 'pt'},
|
||||||
{displayValue: this.textAuto, defaultValue: 1, value: c_paragraphLinerule.LINERULE_AUTO, minValue: 0.5, step: 0.01, defaultUnit: ''},
|
{displayValue: this.textAuto, defaultValue: 1, value: c_paragraphLinerule.LINERULE_AUTO, minValue: 0.5, step: 0.01, defaultUnit: ''},
|
||||||
{displayValue: this.textExact, defaultValue: 5, value: c_paragraphLinerule.LINERULE_EXACT, minValue: 0.03, step: 0.01, defaultUnit: 'cm'}
|
{displayValue: this.textExact, defaultValue: 4.24, value: c_paragraphLinerule.LINERULE_EXACT, minValue: 0.03, step: 1, defaultUnit: 'pt'}
|
||||||
];
|
];
|
||||||
|
|
||||||
this._arrSpecial = [
|
this._arrSpecial = [
|
||||||
|
@ -208,7 +208,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
|
||||||
this.Spacing = properties.get_Spacing();
|
this.Spacing = properties.get_Spacing();
|
||||||
}
|
}
|
||||||
var value = field.getNumberValue();
|
var value = field.getNumberValue();
|
||||||
this.Spacing.put_Before(value<0 ? -1 : Common.Utils.Metric.fnRecalcToMM(value));
|
this.Spacing.put_Before(value<0 ? -1 : Common.Utils.Metric.fnRecalcToMM(value, Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
}, this));
|
}, this));
|
||||||
this.spinners.push(this.numSpacingBefore);
|
this.spinners.push(this.numSpacingBefore);
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
|
||||||
this.Spacing = properties.get_Spacing();
|
this.Spacing = properties.get_Spacing();
|
||||||
}
|
}
|
||||||
var value = field.getNumberValue();
|
var value = field.getNumberValue();
|
||||||
this.Spacing.put_After(value<0 ? -1 : Common.Utils.Metric.fnRecalcToMM(value));
|
this.Spacing.put_After(value<0 ? -1 : Common.Utils.Metric.fnRecalcToMM(value, Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
}, this));
|
}, this));
|
||||||
this.spinners.push(this.numSpacingAfter);
|
this.spinners.push(this.numSpacingAfter);
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
|
||||||
step: .01,
|
step: .01,
|
||||||
width: 85,
|
width: 85,
|
||||||
value: '',
|
value: '',
|
||||||
defaultUnit : "",
|
defaultUnit : "pt",
|
||||||
maxValue: 132,
|
maxValue: 132,
|
||||||
minValue: 0.5
|
minValue: 0.5
|
||||||
});
|
});
|
||||||
|
@ -810,15 +810,15 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
|
||||||
this.numIndentsRight.setValue((props.get_Ind() !== null && props.get_Ind().get_Right() !== null) ? Common.Utils.Metric.fnRecalcFromMM(props.get_Ind().get_Right()) : '', true);
|
this.numIndentsRight.setValue((props.get_Ind() !== null && props.get_Ind().get_Right() !== null) ? Common.Utils.Metric.fnRecalcFromMM(props.get_Ind().get_Right()) : '', true);
|
||||||
|
|
||||||
var value = props.get_Spacing() ? props.get_Spacing().get_Before() : null;
|
var value = props.get_Spacing() ? props.get_Spacing().get_Before() : null;
|
||||||
this.numSpacingBefore.setValue((value !== null) ? (value<0 ? value : Common.Utils.Metric.fnRecalcFromMM(value)) : '', true);
|
this.numSpacingBefore.setValue((value !== null) ? (value<0 ? value : Common.Utils.Metric.fnRecalcFromMM(value, Common.Utils.Metric.c_MetricUnits.pt)) : '', true);
|
||||||
value = props.get_Spacing() ? props.get_Spacing().get_After() : null;
|
value = props.get_Spacing() ? props.get_Spacing().get_After() : null;
|
||||||
this.numSpacingAfter.setValue((value !== null) ? (value<0 ? value : Common.Utils.Metric.fnRecalcFromMM(value)) : '', true);
|
this.numSpacingAfter.setValue((value !== null) ? (value<0 ? value : Common.Utils.Metric.fnRecalcFromMM(value, Common.Utils.Metric.c_MetricUnits.pt)) : '', true);
|
||||||
|
|
||||||
var linerule = props.get_Spacing().get_LineRule();
|
var linerule = props.get_Spacing().get_LineRule();
|
||||||
this.cmbLineRule.setValue((linerule !== null) ? linerule : '', true);
|
this.cmbLineRule.setValue((linerule !== null) ? linerule : '', true);
|
||||||
|
|
||||||
if(props.get_Spacing() !== null && props.get_Spacing().get_Line() !== null) {
|
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);
|
this.numLineHeight.setValue((linerule==c_paragraphLinerule.LINERULE_AUTO) ? props.get_Spacing().get_Line() : Common.Utils.Metric.fnRecalcFromMM(props.get_Spacing().get_Line(), Common.Utils.Metric.c_MetricUnits.pt), true);
|
||||||
} else {
|
} else {
|
||||||
this.numLineHeight.setValue('', true);
|
this.numLineHeight.setValue('', true);
|
||||||
}
|
}
|
||||||
|
@ -943,16 +943,22 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
|
||||||
if (this.spinners) {
|
if (this.spinners) {
|
||||||
for (var i=0; i<this.spinners.length; i++) {
|
for (var i=0; i<this.spinners.length; i++) {
|
||||||
var spinner = this.spinners[i];
|
var spinner = this.spinners[i];
|
||||||
spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
|
if(spinner.el.id != 'paragraphadv-spin-spacing-before' && spinner.el.id != 'paragraphadv-spin-spacing-after')
|
||||||
if (spinner.el.id == 'paragraphadv-spin-spacing' || spinner.el.id == 'paragraphadv-spin-position' || spinner.el.id == 'paragraphadv-spin-spacing-before' || spinner.el.id == 'paragraphadv-spin-spacing-after')
|
spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
|
||||||
|
|
||||||
|
if (spinner.el.id == 'paragraphadv-spin-spacing' || spinner.el.id == 'paragraphadv-spin-position')
|
||||||
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.01);
|
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.01);
|
||||||
|
else if( spinner.el.id == 'paragraphadv-spin-spacing-before' || spinner.el.id == 'paragraphadv-spin-spacing-after'){
|
||||||
|
spinner.setStep(1);
|
||||||
|
spinner.setDefaultUnit(Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.1);
|
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this._arrLineRule[2].defaultUnit = this._arrLineRule[0].defaultUnit = Common.Utils.Metric.getCurrentMetricName();
|
//this._arrLineRule[2].defaultUnit = this._arrLineRule[0].defaultUnit = Common.Utils.Metric.getCurrentMetricName();
|
||||||
this._arrLineRule[2].minValue = this._arrLineRule[0].minValue = parseFloat(Common.Utils.Metric.fnRecalcFromMM(0.3).toFixed(2));
|
//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;
|
//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) {
|
if (this.CurLineRuleIdx !== null) {
|
||||||
this.numLineHeight.setDefaultUnit(this._arrLineRule[this.CurLineRuleIdx].defaultUnit);
|
this.numLineHeight.setDefaultUnit(this._arrLineRule[this.CurLineRuleIdx].defaultUnit);
|
||||||
this.numLineHeight.setStep(this._arrLineRule[this.CurLineRuleIdx].step);
|
this.numLineHeight.setStep(this._arrLineRule[this.CurLineRuleIdx].step);
|
||||||
|
@ -1414,7 +1420,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
|
||||||
if (this.Spacing.get_LineRule() === c_paragraphLinerule.LINERULE_AUTO) {
|
if (this.Spacing.get_LineRule() === c_paragraphLinerule.LINERULE_AUTO) {
|
||||||
this.numLineHeight.setValue(this._arrLineRule[record.value].defaultValue);
|
this.numLineHeight.setValue(this._arrLineRule[record.value].defaultValue);
|
||||||
} else if (this.CurLineRuleIdx === c_paragraphLinerule.LINERULE_AUTO) {
|
} else if (this.CurLineRuleIdx === c_paragraphLinerule.LINERULE_AUTO) {
|
||||||
this.numLineHeight.setValue(Common.Utils.Metric.fnRecalcFromMM(this._arrLineRule[record.value].defaultValue));
|
this.numLineHeight.setValue(Common.Utils.Metric.fnRecalcFromMM(this._arrLineRule[record.value].defaultValue, Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
} else {
|
} else {
|
||||||
this.numLineHeight.setValue(value);
|
this.numLineHeight.setValue(value);
|
||||||
}
|
}
|
||||||
|
@ -1429,7 +1435,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
|
||||||
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
|
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
|
||||||
this.Spacing = properties.get_Spacing();
|
this.Spacing = properties.get_Spacing();
|
||||||
}
|
}
|
||||||
this.Spacing.put_Line((this.cmbLineRule.getValue()==c_paragraphLinerule.LINERULE_AUTO) ? field.getNumberValue() : Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
|
this.Spacing.put_Line((this.cmbLineRule.getValue()==c_paragraphLinerule.LINERULE_AUTO) ? field.getNumberValue() : Common.Utils.Metric.fnRecalcToMM(field.getNumberValue(), Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
},
|
},
|
||||||
|
|
||||||
onSpecialSelect: function(combo, record) {
|
onSpecialSelect: function(combo, record) {
|
||||||
|
|
|
@ -100,7 +100,7 @@ define([
|
||||||
if ( this.cmbLineRule.getRawValue() === '' )
|
if ( this.cmbLineRule.getRawValue() === '' )
|
||||||
return;
|
return;
|
||||||
if (this.api)
|
if (this.api)
|
||||||
this.api.put_PrLineSpacing(this.cmbLineRule.getValue(), (this.cmbLineRule.getValue()==c_paragraphLinerule.LINERULE_AUTO) ? field.getNumberValue() : Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
|
this.api.put_PrLineSpacing(this.cmbLineRule.getValue(), (this.cmbLineRule.getValue()==c_paragraphLinerule.LINERULE_AUTO) ? field.getNumberValue() : Common.Utils.Metric.fnRecalcToMM(field.getNumberValue(), Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
},
|
},
|
||||||
|
|
||||||
onNumSpacingBeforeChange: function(field, newValue, oldValue, eOpts){
|
onNumSpacingBeforeChange: function(field, newValue, oldValue, eOpts){
|
||||||
|
@ -109,7 +109,7 @@ define([
|
||||||
if (num<0)
|
if (num<0)
|
||||||
this.api.put_LineSpacingBeforeAfter(0, -1);
|
this.api.put_LineSpacingBeforeAfter(0, -1);
|
||||||
else
|
else
|
||||||
this.api.put_LineSpacingBeforeAfter(0, Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
|
this.api.put_LineSpacingBeforeAfter(0, Common.Utils.Metric.fnRecalcToMM(field.getNumberValue(), Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ define([
|
||||||
if (num<0)
|
if (num<0)
|
||||||
this.api.put_LineSpacingBeforeAfter(1, -1);
|
this.api.put_LineSpacingBeforeAfter(1, -1);
|
||||||
else
|
else
|
||||||
this.api.put_LineSpacingBeforeAfter(1, Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
|
this.api.put_LineSpacingBeforeAfter(1, Common.Utils.Metric.fnRecalcToMM(field.getNumberValue(), Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ define([
|
||||||
if ( linerule == c_paragraphLinerule.LINERULE_AUTO ) {
|
if ( linerule == c_paragraphLinerule.LINERULE_AUTO ) {
|
||||||
val = line;
|
val = line;
|
||||||
} else if (linerule !== null && line !== null ) {
|
} else if (linerule !== null && line !== null ) {
|
||||||
val = Common.Utils.Metric.fnRecalcFromMM(line);
|
val = Common.Utils.Metric.fnRecalcFromMM(line, Common.Utils.Metric.c_MetricUnits.pt);
|
||||||
}
|
}
|
||||||
this.numLineHeight.setValue((val !== null) ? val : '', true);
|
this.numLineHeight.setValue((val !== null) ? val : '', true);
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ define([
|
||||||
if ( Spacing.LineRule == c_paragraphLinerule.LINERULE_AUTO ) {
|
if ( Spacing.LineRule == c_paragraphLinerule.LINERULE_AUTO ) {
|
||||||
val = Spacing.Line;
|
val = Spacing.Line;
|
||||||
} else if (Spacing.LineRule !== null && Spacing.Line !== null ) {
|
} else if (Spacing.LineRule !== null && Spacing.Line !== null ) {
|
||||||
val = Common.Utils.Metric.fnRecalcFromMM(Spacing.Line);
|
val = Common.Utils.Metric.fnRecalcFromMM(Spacing.Line, Common.Utils.Metric.c_MetricUnits.pt);
|
||||||
}
|
}
|
||||||
this.numLineHeight.setValue((val !== null) ? val : '', true);
|
this.numLineHeight.setValue((val !== null) ? val : '', true);
|
||||||
|
|
||||||
|
@ -209,14 +209,14 @@ define([
|
||||||
if ( Math.abs(this._state.LineSpacingBefore-Spacing.Before)>0.001 ||
|
if ( Math.abs(this._state.LineSpacingBefore-Spacing.Before)>0.001 ||
|
||||||
(this._state.LineSpacingBefore===null || Spacing.Before===null)&&(this._state.LineSpacingBefore!==Spacing.Before)) {
|
(this._state.LineSpacingBefore===null || Spacing.Before===null)&&(this._state.LineSpacingBefore!==Spacing.Before)) {
|
||||||
|
|
||||||
this.numSpacingBefore.setValue((Spacing.Before !== null) ? ((Spacing.Before<0) ? Spacing.Before : Common.Utils.Metric.fnRecalcFromMM(Spacing.Before) ) : '', true);
|
this.numSpacingBefore.setValue((Spacing.Before !== null) ? ((Spacing.Before<0) ? Spacing.Before : Common.Utils.Metric.fnRecalcFromMM(Spacing.Before, Common.Utils.Metric.c_MetricUnits.pt) ) : '', true);
|
||||||
this._state.LineSpacingBefore=Spacing.Before;
|
this._state.LineSpacingBefore=Spacing.Before;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Math.abs(this._state.LineSpacingAfter-Spacing.After)>0.001 ||
|
if ( Math.abs(this._state.LineSpacingAfter-Spacing.After)>0.001 ||
|
||||||
(this._state.LineSpacingAfter===null || Spacing.After===null)&&(this._state.LineSpacingAfter!==Spacing.After)) {
|
(this._state.LineSpacingAfter===null || Spacing.After===null)&&(this._state.LineSpacingAfter!==Spacing.After)) {
|
||||||
|
|
||||||
this.numSpacingAfter.setValue((Spacing.After !== null) ? ((Spacing.After<0) ? Spacing.After : Common.Utils.Metric.fnRecalcFromMM(Spacing.After) ) : '', true);
|
this.numSpacingAfter.setValue((Spacing.After !== null) ? ((Spacing.After<0) ? Spacing.After : Common.Utils.Metric.fnRecalcFromMM(Spacing.After, Common.Utils.Metric.c_MetricUnits.pt) ) : '', true);
|
||||||
this._state.LineSpacingAfter=Spacing.After;
|
this._state.LineSpacingAfter=Spacing.After;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -226,19 +226,19 @@ define([
|
||||||
if (this.spinners) {
|
if (this.spinners) {
|
||||||
for (var i=0; i<this.spinners.length; i++) {
|
for (var i=0; i<this.spinners.length; i++) {
|
||||||
var spinner = this.spinners[i];
|
var spinner = this.spinners[i];
|
||||||
spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
|
//spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
|
||||||
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.01);
|
//spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.01);
|
||||||
}
|
}
|
||||||
var val = this._state.LineSpacingBefore;
|
var val = this._state.LineSpacingBefore;
|
||||||
this.numSpacingBefore && this.numSpacingBefore.setValue((val !== null) ? ((val<0) ? val : Common.Utils.Metric.fnRecalcFromMM(val) ) : '', true);
|
this.numSpacingBefore && this.numSpacingBefore.setValue((val !== null) ? ((val<0) ? val : Common.Utils.Metric.fnRecalcFromMM(val, Common.Utils.Metric.c_MetricUnits.pt) ) : '', true);
|
||||||
val = this._state.LineSpacingAfter;
|
val = this._state.LineSpacingAfter;
|
||||||
this.numSpacingAfter && this.numSpacingAfter.setValue((val !== null) ? ((val<0) ? val : Common.Utils.Metric.fnRecalcFromMM(val) ) : '', true);
|
this.numSpacingAfter && this.numSpacingAfter.setValue((val !== null) ? ((val<0) ? val : Common.Utils.Metric.fnRecalcFromMM(val, Common.Utils.Metric.c_MetricUnits.pt) ) : '', true);
|
||||||
}
|
}
|
||||||
if (this.cmbLineRule) {
|
if (this.cmbLineRule) {
|
||||||
var rec = this.cmbLineRule.store.at(1);
|
var rec = this.cmbLineRule.store.at(1);
|
||||||
rec.set({defaultUnit: Common.Utils.Metric.getCurrentMetricName(),
|
/*rec.set({defaultUnit: Common.Utils.Metric.getCurrentMetricName(),
|
||||||
minValue: parseFloat(Common.Utils.Metric.fnRecalcFromMM(0.3).toFixed(2)),
|
minValue: parseFloat(Common.Utils.Metric.fnRecalcFromMM(0.3).toFixed(2)),
|
||||||
step: (Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt) ? 1 : 0.01});
|
step: (Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt) ? 1 : 0.01});**/
|
||||||
|
|
||||||
if (this._state.LineRule !== null) {
|
if (this._state.LineRule !== null) {
|
||||||
var obj;
|
var obj;
|
||||||
|
@ -250,7 +250,7 @@ define([
|
||||||
if ( this._state.LineRule == c_paragraphLinerule.LINERULE_AUTO ) {
|
if ( this._state.LineRule == c_paragraphLinerule.LINERULE_AUTO ) {
|
||||||
val = this._state.LineHeight;
|
val = this._state.LineHeight;
|
||||||
} else if (this._state.LineHeight !== null ) {
|
} else if (this._state.LineHeight !== null ) {
|
||||||
val = Common.Utils.Metric.fnRecalcFromMM(this._state.LineHeight);
|
val = Common.Utils.Metric.fnRecalcFromMM(this._state.LineHeight, Common.Utils.Metric.c_MetricUnits.pt);
|
||||||
}
|
}
|
||||||
this.numLineHeight && this.numLineHeight.setValue((val !== null) ? val : '', true);
|
this.numLineHeight && this.numLineHeight.setValue((val !== null) ? val : '', true);
|
||||||
}
|
}
|
||||||
|
@ -261,7 +261,7 @@ define([
|
||||||
var me = this;
|
var me = this;
|
||||||
this._arrLineRule = [
|
this._arrLineRule = [
|
||||||
{displayValue: this.textAuto, defaultValue: 1, value: c_paragraphLinerule.LINERULE_AUTO, minValue: 0.5, step: 0.01, defaultUnit: ''},
|
{displayValue: this.textAuto, defaultValue: 1, value: c_paragraphLinerule.LINERULE_AUTO, minValue: 0.5, step: 0.01, defaultUnit: ''},
|
||||||
{displayValue: this.textExact, defaultValue: 5, value: c_paragraphLinerule.LINERULE_EXACT, minValue: 0.03, step: 0.01, defaultUnit: 'cm'}
|
{displayValue: this.textExact, defaultValue: 5, value: c_paragraphLinerule.LINERULE_EXACT, minValue: 0.03, step: 1, defaultUnit: 'pt'}
|
||||||
];
|
];
|
||||||
|
|
||||||
// Short Size
|
// Short Size
|
||||||
|
@ -288,11 +288,11 @@ define([
|
||||||
|
|
||||||
this.numSpacingBefore = new Common.UI.MetricSpinner({
|
this.numSpacingBefore = new Common.UI.MetricSpinner({
|
||||||
el: $('#paragraph-spin-spacing-before'),
|
el: $('#paragraph-spin-spacing-before'),
|
||||||
step: .1,
|
step: 1,
|
||||||
width: 85,
|
width: 85,
|
||||||
value: '0 cm',
|
value: '0 pt',
|
||||||
defaultUnit : "cm",
|
defaultUnit : "pt",
|
||||||
maxValue: 55.88,
|
maxValue: 1584,
|
||||||
minValue: 0,
|
minValue: 0,
|
||||||
allowAuto : true,
|
allowAuto : true,
|
||||||
autoText : this.txtAutoText
|
autoText : this.txtAutoText
|
||||||
|
@ -302,11 +302,11 @@ define([
|
||||||
|
|
||||||
this.numSpacingAfter = new Common.UI.MetricSpinner({
|
this.numSpacingAfter = new Common.UI.MetricSpinner({
|
||||||
el: $('#paragraph-spin-spacing-after'),
|
el: $('#paragraph-spin-spacing-after'),
|
||||||
step: .1,
|
step: 1,
|
||||||
width: 85,
|
width: 85,
|
||||||
value: '0.35 cm',
|
value: '0.35 pt',
|
||||||
defaultUnit : "cm",
|
defaultUnit : "pt",
|
||||||
maxValue: 55.88,
|
maxValue: 1584,
|
||||||
minValue: 0,
|
minValue: 0,
|
||||||
allowAuto : true,
|
allowAuto : true,
|
||||||
autoText : this.txtAutoText
|
autoText : this.txtAutoText
|
||||||
|
|
|
@ -83,7 +83,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
|
||||||
|
|
||||||
this._arrLineRule = [
|
this._arrLineRule = [
|
||||||
{displayValue: this.textAuto, defaultValue: 1, value: c_paragraphLinerule.LINERULE_AUTO, minValue: 0.5, step: 0.01, defaultUnit: ''},
|
{displayValue: this.textAuto, defaultValue: 1, value: c_paragraphLinerule.LINERULE_AUTO, minValue: 0.5, step: 0.01, defaultUnit: ''},
|
||||||
{displayValue: this.textExact, defaultValue: 5, value: c_paragraphLinerule.LINERULE_EXACT, minValue: 0.03, step: 0.01, defaultUnit: 'cm'}
|
{displayValue: this.textExact, defaultValue: 5, value: c_paragraphLinerule.LINERULE_EXACT, minValue: 0.03, step: 1, defaultUnit: 'pt'}
|
||||||
];
|
];
|
||||||
|
|
||||||
var curLineRule = this._originalProps.get_Spacing().get_LineRule(),
|
var curLineRule = this._originalProps.get_Spacing().get_LineRule(),
|
||||||
|
@ -198,11 +198,11 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
|
||||||
|
|
||||||
this.numSpacingBefore = new Common.UI.MetricSpinner({
|
this.numSpacingBefore = new Common.UI.MetricSpinner({
|
||||||
el: $('#paragraphadv-spin-spacing-before'),
|
el: $('#paragraphadv-spin-spacing-before'),
|
||||||
step: .1,
|
step: 1,
|
||||||
width: 85,
|
width: 85,
|
||||||
value: '',
|
value: '',
|
||||||
defaultUnit : "cm",
|
defaultUnit : "pt",
|
||||||
maxValue: 55.88,
|
maxValue: 1584,
|
||||||
minValue: 0,
|
minValue: 0,
|
||||||
allowAuto : true,
|
allowAuto : true,
|
||||||
autoText : this.txtAutoText
|
autoText : this.txtAutoText
|
||||||
|
@ -213,17 +213,17 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
|
||||||
this.Spacing = properties.get_Spacing();
|
this.Spacing = properties.get_Spacing();
|
||||||
}
|
}
|
||||||
var value = field.getNumberValue();
|
var value = field.getNumberValue();
|
||||||
this.Spacing.put_Before(value<0 ? -1 : Common.Utils.Metric.fnRecalcToMM(value));
|
this.Spacing.put_Before(value<0 ? -1 : Common.Utils.Metric.fnRecalcToMM(value,Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
}, this));
|
}, this));
|
||||||
this.spinners.push(this.numSpacingBefore);
|
this.spinners.push(this.numSpacingBefore);
|
||||||
|
|
||||||
this.numSpacingAfter = new Common.UI.MetricSpinner({
|
this.numSpacingAfter = new Common.UI.MetricSpinner({
|
||||||
el: $('#paragraphadv-spin-spacing-after'),
|
el: $('#paragraphadv-spin-spacing-after'),
|
||||||
step: .1,
|
step: 1,
|
||||||
width: 85,
|
width: 85,
|
||||||
value: '',
|
value: '',
|
||||||
defaultUnit : "cm",
|
defaultUnit : "pt",
|
||||||
maxValue: 55.88,
|
maxValue: 1584,
|
||||||
minValue: 0,
|
minValue: 0,
|
||||||
allowAuto : true,
|
allowAuto : true,
|
||||||
autoText : this.txtAutoText
|
autoText : this.txtAutoText
|
||||||
|
@ -234,7 +234,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
|
||||||
this.Spacing = properties.get_Spacing();
|
this.Spacing = properties.get_Spacing();
|
||||||
}
|
}
|
||||||
var value = field.getNumberValue();
|
var value = field.getNumberValue();
|
||||||
this.Spacing.put_After(value<0 ? -1 : Common.Utils.Metric.fnRecalcToMM(value));
|
this.Spacing.put_After(value<0 ? -1 : Common.Utils.Metric.fnRecalcToMM(value, Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
}, this));
|
}, this));
|
||||||
this.spinners.push(this.numSpacingAfter);
|
this.spinners.push(this.numSpacingAfter);
|
||||||
|
|
||||||
|
@ -476,15 +476,15 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
|
||||||
this.numSpecialBy.setValue(this.FirstLine!== null ? Math.abs(Common.Utils.Metric.fnRecalcFromMM(this.FirstLine)) : '', true);
|
this.numSpecialBy.setValue(this.FirstLine!== null ? Math.abs(Common.Utils.Metric.fnRecalcFromMM(this.FirstLine)) : '', true);
|
||||||
|
|
||||||
var value = props.get_Spacing() ? props.get_Spacing().get_Before() : null;
|
var value = props.get_Spacing() ? props.get_Spacing().get_Before() : null;
|
||||||
this.numSpacingBefore.setValue((value !== null) ? (value<0 ? value : Common.Utils.Metric.fnRecalcFromMM(value)) : '', true);
|
this.numSpacingBefore.setValue((value !== null) ? (value<0 ? value : Common.Utils.Metric.fnRecalcFromMM(value, Common.Utils.Metric.c_MetricUnits.pt)) : '', true);
|
||||||
value = props.get_Spacing() ? props.get_Spacing().get_After() : null;
|
value = props.get_Spacing() ? props.get_Spacing().get_After() : null;
|
||||||
this.numSpacingAfter.setValue((value !== null) ? (value<0 ? value : Common.Utils.Metric.fnRecalcFromMM(value)) : '', true);
|
this.numSpacingAfter.setValue((value !== null) ? (value<0 ? value : Common.Utils.Metric.fnRecalcFromMM(value, Common.Utils.Metric.c_MetricUnits.pt)) : '', true);
|
||||||
|
|
||||||
var linerule = props.get_Spacing().get_LineRule();
|
var linerule = props.get_Spacing().get_LineRule();
|
||||||
this.cmbLineRule.setValue((linerule !== null) ? linerule : '', true);
|
this.cmbLineRule.setValue((linerule !== null) ? linerule : '', true);
|
||||||
|
|
||||||
if(props.get_Spacing() !== null && props.get_Spacing().get_Line() !== null) {
|
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);
|
this.numLineHeight.setValue((linerule==c_paragraphLinerule.LINERULE_AUTO) ? props.get_Spacing().get_Line() : Common.Utils.Metric.fnRecalcFromMM(props.get_Spacing().get_Line(), Common.Utils.Metric.c_MetricUnits.pt), true);
|
||||||
} else {
|
} else {
|
||||||
this.numLineHeight.setValue('', true);
|
this.numLineHeight.setValue('', true);
|
||||||
}
|
}
|
||||||
|
@ -535,16 +535,21 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
|
||||||
if (this.spinners) {
|
if (this.spinners) {
|
||||||
for (var i=0; i<this.spinners.length; i++) {
|
for (var i=0; i<this.spinners.length; i++) {
|
||||||
var spinner = this.spinners[i];
|
var spinner = this.spinners[i];
|
||||||
spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
|
if(spinner.el.id != 'paragraphadv-spin-spacing-before' && spinner.el.id != 'paragraphadv-spin-spacing-after' && spinner.el.id != 'paragraphadv-spin-line-height')
|
||||||
if (spinner.el.id == 'paragraphadv-spin-spacing' || spinner.el.id == 'paragraphadv-spin-spacing-before' || spinner.el.id == 'paragraphadv-spin-spacing-after')
|
spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
|
||||||
|
|
||||||
|
|
||||||
|
if (spinner.el.id == 'paragraphadv-spin-spacing' )
|
||||||
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.01);
|
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.01);
|
||||||
|
else if(spinner.el.id == 'paragraphadv-spin-spacing-before' || spinner.el.id == 'paragraphadv-spin-spacing-after')
|
||||||
|
spinner.setStep(1);
|
||||||
else
|
else
|
||||||
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.1);
|
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this._arrLineRule[1].defaultUnit = Common.Utils.Metric.getCurrentMetricName();
|
/*this._arrLineRule[1].defaultUnit = Common.Utils.Metric.getCurrentMetricName();
|
||||||
this._arrLineRule[1].minValue = parseFloat(Common.Utils.Metric.fnRecalcFromMM(0.3).toFixed(2));
|
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;
|
this._arrLineRule[1].step = (Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt) ? 1 : 0.01;*/
|
||||||
if (this.CurLineRuleIdx !== null) {
|
if (this.CurLineRuleIdx !== null) {
|
||||||
this.numLineHeight.setDefaultUnit(this._arrLineRule[this.CurLineRuleIdx].defaultUnit);
|
this.numLineHeight.setDefaultUnit(this._arrLineRule[this.CurLineRuleIdx].defaultUnit);
|
||||||
this.numLineHeight.setStep(this._arrLineRule[this.CurLineRuleIdx].step);
|
this.numLineHeight.setStep(this._arrLineRule[this.CurLineRuleIdx].step);
|
||||||
|
@ -796,7 +801,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
|
||||||
if (this.Spacing.get_LineRule() === c_paragraphLinerule.LINERULE_AUTO) {
|
if (this.Spacing.get_LineRule() === c_paragraphLinerule.LINERULE_AUTO) {
|
||||||
this.numLineHeight.setValue(this._arrLineRule[indexSelectItem].defaultValue);
|
this.numLineHeight.setValue(this._arrLineRule[indexSelectItem].defaultValue);
|
||||||
} else {
|
} else {
|
||||||
this.numLineHeight.setValue(Common.Utils.Metric.fnRecalcFromMM(this._arrLineRule[indexSelectItem].defaultValue));
|
this.numLineHeight.setValue(Common.Utils.Metric.fnRecalcFromMM(this._arrLineRule[indexSelectItem].defaultValue, Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
}
|
}
|
||||||
this.CurLineRuleIdx = indexSelectItem;
|
this.CurLineRuleIdx = indexSelectItem;
|
||||||
}
|
}
|
||||||
|
@ -809,7 +814,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
|
||||||
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
|
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
|
||||||
this.Spacing = properties.get_Spacing();
|
this.Spacing = properties.get_Spacing();
|
||||||
}
|
}
|
||||||
this.Spacing.put_Line((this.cmbLineRule.getValue()==c_paragraphLinerule.LINERULE_AUTO) ? field.getNumberValue() : Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
|
this.Spacing.put_Line((this.cmbLineRule.getValue()==c_paragraphLinerule.LINERULE_AUTO) ? field.getNumberValue() : Common.Utils.Metric.fnRecalcToMM(field.getNumberValue(), Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
},
|
},
|
||||||
|
|
||||||
textTitle: 'Paragraph - Advanced Settings',
|
textTitle: 'Paragraph - Advanced Settings',
|
||||||
|
|
|
@ -106,7 +106,7 @@ define([
|
||||||
if ( this.cmbLineRule.getRawValue() === '' )
|
if ( this.cmbLineRule.getRawValue() === '' )
|
||||||
return;
|
return;
|
||||||
if (this.api)
|
if (this.api)
|
||||||
this.api.asc_putPrLineSpacing(this.cmbLineRule.getValue(), (this.cmbLineRule.getValue()==c_paragraphLinerule.LINERULE_AUTO) ? field.getNumberValue() : Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
|
this.api.asc_putPrLineSpacing(this.cmbLineRule.getValue(), (this.cmbLineRule.getValue()==c_paragraphLinerule.LINERULE_AUTO) ? field.getNumberValue() : Common.Utils.Metric.fnRecalcToMM(field.getNumberValue(),Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
},
|
},
|
||||||
|
|
||||||
onNumSpacingBeforeChange: function(field, newValue, oldValue, eOpts){
|
onNumSpacingBeforeChange: function(field, newValue, oldValue, eOpts){
|
||||||
|
@ -115,7 +115,7 @@ define([
|
||||||
if (num<0)
|
if (num<0)
|
||||||
this.api.asc_putLineSpacingBeforeAfter(0, -1);
|
this.api.asc_putLineSpacingBeforeAfter(0, -1);
|
||||||
else
|
else
|
||||||
this.api.asc_putLineSpacingBeforeAfter(0, Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
|
this.api.asc_putLineSpacingBeforeAfter(0, Common.Utils.Metric.fnRecalcToMM(field.getNumberValue(), Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ define([
|
||||||
if (num<0)
|
if (num<0)
|
||||||
this.api.asc_putLineSpacingBeforeAfter(1, -1);
|
this.api.asc_putLineSpacingBeforeAfter(1, -1);
|
||||||
else
|
else
|
||||||
this.api.asc_putLineSpacingBeforeAfter(1, Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
|
this.api.asc_putLineSpacingBeforeAfter(1, Common.Utils.Metric.fnRecalcToMM(field.getNumberValue(), Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ define([
|
||||||
if ( linerule == c_paragraphLinerule.LINERULE_AUTO ) {
|
if ( linerule == c_paragraphLinerule.LINERULE_AUTO ) {
|
||||||
val = line;
|
val = line;
|
||||||
} else if (linerule !== null && line !== null ) {
|
} else if (linerule !== null && line !== null ) {
|
||||||
val = Common.Utils.Metric.fnRecalcFromMM(line);
|
val = Common.Utils.Metric.fnRecalcFromMM(line, Common.Utils.Metric.c_MetricUnits.pt);
|
||||||
}
|
}
|
||||||
this.numLineHeight.setValue((val !== null) ? val : '', true);
|
this.numLineHeight.setValue((val !== null) ? val : '', true);
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ define([
|
||||||
if ( Spacing.LineRule == c_paragraphLinerule.LINERULE_AUTO ) {
|
if ( Spacing.LineRule == c_paragraphLinerule.LINERULE_AUTO ) {
|
||||||
val = Spacing.Line;
|
val = Spacing.Line;
|
||||||
} else if (Spacing.LineRule !== null && Spacing.Line !== null ) {
|
} else if (Spacing.LineRule !== null && Spacing.Line !== null ) {
|
||||||
val = Common.Utils.Metric.fnRecalcFromMM(Spacing.Line);
|
val = Common.Utils.Metric.fnRecalcFromMM(Spacing.Line, Common.Utils.Metric.c_MetricUnits.pt);
|
||||||
}
|
}
|
||||||
this.numLineHeight.setValue((val !== null) ? val : '', true);
|
this.numLineHeight.setValue((val !== null) ? val : '', true);
|
||||||
|
|
||||||
|
@ -212,14 +212,14 @@ define([
|
||||||
if ( Math.abs(this._state.LineSpacingBefore-Spacing.Before)>0.001 ||
|
if ( Math.abs(this._state.LineSpacingBefore-Spacing.Before)>0.001 ||
|
||||||
(this._state.LineSpacingBefore===null || Spacing.Before===null)&&(this._state.LineSpacingBefore!==Spacing.Before)) {
|
(this._state.LineSpacingBefore===null || Spacing.Before===null)&&(this._state.LineSpacingBefore!==Spacing.Before)) {
|
||||||
|
|
||||||
this.numSpacingBefore.setValue((Spacing.Before !== null) ? ((Spacing.Before<0) ? Spacing.Before : Common.Utils.Metric.fnRecalcFromMM(Spacing.Before) ) : '', true);
|
this.numSpacingBefore.setValue((Spacing.Before !== null) ? ((Spacing.Before<0) ? Spacing.Before : Common.Utils.Metric.fnRecalcFromMM(Spacing.Before, Common.Utils.Metric.c_MetricUnits.pt) ) : '', true);
|
||||||
this._state.LineSpacingBefore=Spacing.Before;
|
this._state.LineSpacingBefore=Spacing.Before;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Math.abs(this._state.LineSpacingAfter-Spacing.After)>0.001 ||
|
if ( Math.abs(this._state.LineSpacingAfter-Spacing.After)>0.001 ||
|
||||||
(this._state.LineSpacingAfter===null || Spacing.After===null)&&(this._state.LineSpacingAfter!==Spacing.After)) {
|
(this._state.LineSpacingAfter===null || Spacing.After===null)&&(this._state.LineSpacingAfter!==Spacing.After)) {
|
||||||
|
|
||||||
this.numSpacingAfter.setValue((Spacing.After !== null) ? ((Spacing.After<0) ? Spacing.After : Common.Utils.Metric.fnRecalcFromMM(Spacing.After) ) : '', true);
|
this.numSpacingAfter.setValue((Spacing.After !== null) ? ((Spacing.After<0) ? Spacing.After : Common.Utils.Metric.fnRecalcFromMM(Spacing.After, Common.Utils.Metric.c_MetricUnits.pt) ) : '', true);
|
||||||
this._state.LineSpacingAfter=Spacing.After;
|
this._state.LineSpacingAfter=Spacing.After;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -229,19 +229,19 @@ define([
|
||||||
if (this.spinners) {
|
if (this.spinners) {
|
||||||
for (var i=0; i<this.spinners.length; i++) {
|
for (var i=0; i<this.spinners.length; i++) {
|
||||||
var spinner = this.spinners[i];
|
var spinner = this.spinners[i];
|
||||||
spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
|
/*spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
|
||||||
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.01);
|
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.01);*/
|
||||||
}
|
}
|
||||||
var val = this._state.LineSpacingBefore;
|
var val = this._state.LineSpacingBefore;
|
||||||
this.numSpacingBefore && this.numSpacingBefore.setValue((val !== null) ? ((val<0) ? val : Common.Utils.Metric.fnRecalcFromMM(val) ) : '', true);
|
this.numSpacingBefore && this.numSpacingBefore.setValue((val !== null) ? ((val<0) ? val : Common.Utils.Metric.fnRecalcFromMM(val, Common.Utils.Metric.c_MetricUnits.pt) ) : '', true);
|
||||||
val = this._state.LineSpacingAfter;
|
val = this._state.LineSpacingAfter;
|
||||||
this.numSpacingAfter && this.numSpacingAfter.setValue((val !== null) ? ((val<0) ? val : Common.Utils.Metric.fnRecalcFromMM(val) ) : '', true);
|
this.numSpacingAfter && this.numSpacingAfter.setValue((val !== null) ? ((val<0) ? val : Common.Utils.Metric.fnRecalcFromMM(val, Common.Utils.Metric.c_MetricUnits.pt) ) : '', true);
|
||||||
}
|
}
|
||||||
if (this.cmbLineRule) {
|
if (this.cmbLineRule) {
|
||||||
var rec = this.cmbLineRule.store.at(1);
|
var rec = this.cmbLineRule.store.at(1);
|
||||||
rec.set({defaultUnit: Common.Utils.Metric.getCurrentMetricName(),
|
/*rec.set({defaultUnit: Common.Utils.Metric.getCurrentMetricName(),
|
||||||
minValue: parseFloat(Common.Utils.Metric.fnRecalcFromMM(0.3).toFixed(2)),
|
minValue: parseFloat(Common.Utils.Metric.fnRecalcFromMM(0.3).toFixed(2)),
|
||||||
step: (Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt) ? 1 : 0.01});
|
step: (Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt) ? 1 : 0.01});*/
|
||||||
|
|
||||||
if (this._state.LineRule !== null) {
|
if (this._state.LineRule !== null) {
|
||||||
var obj;
|
var obj;
|
||||||
|
@ -253,7 +253,7 @@ define([
|
||||||
if ( this._state.LineRule == c_paragraphLinerule.LINERULE_AUTO ) {
|
if ( this._state.LineRule == c_paragraphLinerule.LINERULE_AUTO ) {
|
||||||
val = this._state.LineHeight;
|
val = this._state.LineHeight;
|
||||||
} else if (this._state.LineHeight !== null ) {
|
} else if (this._state.LineHeight !== null ) {
|
||||||
val = Common.Utils.Metric.fnRecalcFromMM(this._state.LineHeight);
|
val = Common.Utils.Metric.fnRecalcFromMM(this._state.LineHeight, Common.Utils.Metric.c_MetricUnits.pt);
|
||||||
}
|
}
|
||||||
this.numLineHeight && this.numLineHeight.setValue((val !== null) ? val : '', true);
|
this.numLineHeight && this.numLineHeight.setValue((val !== null) ? val : '', true);
|
||||||
}
|
}
|
||||||
|
@ -265,7 +265,7 @@ define([
|
||||||
|
|
||||||
this._arrLineRule = [
|
this._arrLineRule = [
|
||||||
{displayValue: this.textAuto, defaultValue: 1, value: c_paragraphLinerule.LINERULE_AUTO, minValue: 0.5, step: 0.01, defaultUnit: ''},
|
{displayValue: this.textAuto, defaultValue: 1, value: c_paragraphLinerule.LINERULE_AUTO, minValue: 0.5, step: 0.01, defaultUnit: ''},
|
||||||
{displayValue: this.textExact, defaultValue: 5, value: c_paragraphLinerule.LINERULE_EXACT, minValue: 0.03, step: 0.01, defaultUnit: 'cm'}
|
{displayValue: this.textExact, defaultValue: 4.66, value: c_paragraphLinerule.LINERULE_EXACT, minValue: 0.03, step: 1, defaultUnit: 'pt'}
|
||||||
];
|
];
|
||||||
|
|
||||||
// Short Size
|
// Short Size
|
||||||
|
@ -292,11 +292,11 @@ define([
|
||||||
|
|
||||||
this.numSpacingBefore = new Common.UI.MetricSpinner({
|
this.numSpacingBefore = new Common.UI.MetricSpinner({
|
||||||
el: $('#paragraph-spin-spacing-before'),
|
el: $('#paragraph-spin-spacing-before'),
|
||||||
step: .1,
|
step: 1,
|
||||||
width: 85,
|
width: 85,
|
||||||
value: '0 cm',
|
value: '0 pt',
|
||||||
defaultUnit : "cm",
|
defaultUnit : "pt",
|
||||||
maxValue: 55.88,
|
maxValue: 1584,
|
||||||
minValue: 0,
|
minValue: 0,
|
||||||
allowAuto : true,
|
allowAuto : true,
|
||||||
autoText : this.txtAutoText
|
autoText : this.txtAutoText
|
||||||
|
@ -306,11 +306,11 @@ define([
|
||||||
|
|
||||||
this.numSpacingAfter = new Common.UI.MetricSpinner({
|
this.numSpacingAfter = new Common.UI.MetricSpinner({
|
||||||
el: $('#paragraph-spin-spacing-after'),
|
el: $('#paragraph-spin-spacing-after'),
|
||||||
step: .1,
|
step: 1,
|
||||||
width: 85,
|
width: 85,
|
||||||
value: '0.35 cm',
|
value: '0.35 pt',
|
||||||
defaultUnit : "cm",
|
defaultUnit : "pt",
|
||||||
maxValue: 55.88,
|
maxValue: 1584,
|
||||||
minValue: 0,
|
minValue: 0,
|
||||||
allowAuto : true,
|
allowAuto : true,
|
||||||
autoText : this.txtAutoText
|
autoText : this.txtAutoText
|
||||||
|
|
|
@ -83,7 +83,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
|
||||||
|
|
||||||
this._arrLineRule = [
|
this._arrLineRule = [
|
||||||
{displayValue: this.textAuto, defaultValue: 1, value: c_paragraphLinerule.LINERULE_AUTO, minValue: 0.5, step: 0.01, defaultUnit: ''},
|
{displayValue: this.textAuto, defaultValue: 1, value: c_paragraphLinerule.LINERULE_AUTO, minValue: 0.5, step: 0.01, defaultUnit: ''},
|
||||||
{displayValue: this.textExact, defaultValue: 5, value: c_paragraphLinerule.LINERULE_EXACT, minValue: 0.03, step: 0.01, defaultUnit: 'cm'}
|
{displayValue: this.textExact, defaultValue: 4.66, value: c_paragraphLinerule.LINERULE_EXACT, minValue: 0.03, step: 1, defaultUnit: 'pt'}
|
||||||
];
|
];
|
||||||
|
|
||||||
var curLineRule = this._originalProps.asc_getSpacing().asc_getLineRule(),
|
var curLineRule = this._originalProps.asc_getSpacing().asc_getLineRule(),
|
||||||
|
@ -198,11 +198,11 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
|
||||||
|
|
||||||
this.numSpacingBefore = new Common.UI.MetricSpinner({
|
this.numSpacingBefore = new Common.UI.MetricSpinner({
|
||||||
el: $('#paragraphadv-spin-spacing-before'),
|
el: $('#paragraphadv-spin-spacing-before'),
|
||||||
step: .1,
|
step: 1,
|
||||||
width: 85,
|
width: 85,
|
||||||
value: '',
|
value: '',
|
||||||
defaultUnit : "cm",
|
defaultUnit : "pt",
|
||||||
maxValue: 55.88,
|
maxValue: 1584,
|
||||||
minValue: 0,
|
minValue: 0,
|
||||||
allowAuto : true,
|
allowAuto : true,
|
||||||
autoText : this.txtAutoText
|
autoText : this.txtAutoText
|
||||||
|
@ -212,17 +212,17 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
|
||||||
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
|
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
|
||||||
this.Spacing = properties.asc_getSpacing();
|
this.Spacing = properties.asc_getSpacing();
|
||||||
}
|
}
|
||||||
this.Spacing.put_Before(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
|
this.Spacing.put_Before(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue(), Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
}, this));
|
}, this));
|
||||||
this.spinners.push(this.numSpacingBefore);
|
this.spinners.push(this.numSpacingBefore);
|
||||||
|
|
||||||
this.numSpacingAfter = new Common.UI.MetricSpinner({
|
this.numSpacingAfter = new Common.UI.MetricSpinner({
|
||||||
el: $('#paragraphadv-spin-spacing-after'),
|
el: $('#paragraphadv-spin-spacing-after'),
|
||||||
step: .1,
|
step: 1,
|
||||||
width: 85,
|
width: 85,
|
||||||
value: '',
|
value: '',
|
||||||
defaultUnit : "cm",
|
defaultUnit : "pt",
|
||||||
maxValue: 55.88,
|
maxValue: 1584,
|
||||||
minValue: 0,
|
minValue: 0,
|
||||||
allowAuto : true,
|
allowAuto : true,
|
||||||
autoText : this.txtAutoText
|
autoText : this.txtAutoText
|
||||||
|
@ -232,7 +232,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
|
||||||
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
|
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
|
||||||
this.Spacing = properties.asc_getSpacing();
|
this.Spacing = properties.asc_getSpacing();
|
||||||
}
|
}
|
||||||
this.Spacing.put_After(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
|
this.Spacing.put_After(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue(), Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
}, this));
|
}, this));
|
||||||
this.spinners.push(this.numSpacingAfter);
|
this.spinners.push(this.numSpacingAfter);
|
||||||
|
|
||||||
|
@ -473,14 +473,14 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
|
||||||
this.cmbSpecial.setValue(this.CurSpecial);
|
this.cmbSpecial.setValue(this.CurSpecial);
|
||||||
this.numSpecialBy.setValue(this.FirstLine!== null ? Math.abs(Common.Utils.Metric.fnRecalcFromMM(this.FirstLine)) : '', true);
|
this.numSpecialBy.setValue(this.FirstLine!== null ? Math.abs(Common.Utils.Metric.fnRecalcFromMM(this.FirstLine)) : '', true);
|
||||||
|
|
||||||
this.numSpacingBefore.setValue((props.asc_getSpacing() !== null && props.asc_getSpacing().asc_getBefore() !== null) ? Common.Utils.Metric.fnRecalcFromMM(props.asc_getSpacing().asc_getBefore()) : '', true);
|
this.numSpacingBefore.setValue((props.asc_getSpacing() !== null && props.asc_getSpacing().asc_getBefore() !== null) ? Common.Utils.Metric.fnRecalcFromMM(props.asc_getSpacing().asc_getBefore(), Common.Utils.Metric.c_MetricUnits.pt) : '', true);
|
||||||
this.numSpacingAfter.setValue((props.asc_getSpacing() !== null && props.asc_getSpacing().asc_getAfter() !== null) ? Common.Utils.Metric.fnRecalcFromMM(props.asc_getSpacing().asc_getAfter()) : '', true);
|
this.numSpacingAfter.setValue((props.asc_getSpacing() !== null && props.asc_getSpacing().asc_getAfter() !== null) ? Common.Utils.Metric.fnRecalcFromMM(props.asc_getSpacing().asc_getAfter(), Common.Utils.Metric.c_MetricUnits.pt) : '', true);
|
||||||
|
|
||||||
var linerule = props.asc_getSpacing().asc_getLineRule();
|
var linerule = props.asc_getSpacing().asc_getLineRule();
|
||||||
this.cmbLineRule.setValue((linerule !== null) ? linerule : '', true);
|
this.cmbLineRule.setValue((linerule !== null) ? linerule : '', true);
|
||||||
|
|
||||||
if(props.asc_getSpacing() !== null && props.asc_getSpacing().asc_getLine() !== null) {
|
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);
|
this.numLineHeight.setValue((linerule==c_paragraphLinerule.LINERULE_AUTO) ? props.asc_getSpacing().asc_getLine() : Common.Utils.Metric.fnRecalcFromMM(props.asc_getSpacing().asc_getLine(), Common.Utils.Metric.c_MetricUnits.pt), true);
|
||||||
} else {
|
} else {
|
||||||
this.numLineHeight.setValue('', true);
|
this.numLineHeight.setValue('', true);
|
||||||
}
|
}
|
||||||
|
@ -530,16 +530,18 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
|
||||||
if (this.spinners) {
|
if (this.spinners) {
|
||||||
for (var i=0; i<this.spinners.length; i++) {
|
for (var i=0; i<this.spinners.length; i++) {
|
||||||
var spinner = this.spinners[i];
|
var spinner = this.spinners[i];
|
||||||
spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
|
if(spinner.el.id != 'paragraphadv-spin-spacing-before' && spinner.el.id != 'paragraphadv-spin-spacing-after'&& spinner.el.id != 'paragraphadv-spin-line-height')
|
||||||
if (spinner.el.id == 'paragraphadv-spin-spacing' || spinner.el.id == 'paragraphadv-spin-position' || spinner.el.id == 'paragraphadv-spin-spacing-before' || spinner.el.id == 'paragraphadv-spin-spacing-after' )
|
spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
|
||||||
|
|
||||||
|
if (spinner.el.id == 'paragraphadv-spin-spacing' || spinner.el.id == 'paragraphadv-spin-position' )
|
||||||
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.01);
|
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.01);
|
||||||
else
|
else
|
||||||
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.1);
|
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this._arrLineRule[1].defaultUnit = Common.Utils.Metric.getCurrentMetricName();
|
/*this._arrLineRule[1].defaultUnit = Common.Utils.Metric.getCurrentMetricName();
|
||||||
this._arrLineRule[1].minValue = parseFloat(Common.Utils.Metric.fnRecalcFromMM(0.3).toFixed(2));
|
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;
|
this._arrLineRule[1].step = (Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt) ? 1 : 0.01;*/
|
||||||
if (this.CurLineRuleIdx !== null) {
|
if (this.CurLineRuleIdx !== null) {
|
||||||
this.numLineHeight.setDefaultUnit(this._arrLineRule[this.CurLineRuleIdx].defaultUnit);
|
this.numLineHeight.setDefaultUnit(this._arrLineRule[this.CurLineRuleIdx].defaultUnit);
|
||||||
this.numLineHeight.setStep(this._arrLineRule[this.CurLineRuleIdx].step);
|
this.numLineHeight.setStep(this._arrLineRule[this.CurLineRuleIdx].step);
|
||||||
|
@ -791,7 +793,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
|
||||||
if (this.Spacing.get_LineRule() === c_paragraphLinerule.LINERULE_AUTO) {
|
if (this.Spacing.get_LineRule() === c_paragraphLinerule.LINERULE_AUTO) {
|
||||||
this.numLineHeight.setValue(this._arrLineRule[indexSelectItem].defaultValue);
|
this.numLineHeight.setValue(this._arrLineRule[indexSelectItem].defaultValue);
|
||||||
} else {
|
} else {
|
||||||
this.numLineHeight.setValue(Common.Utils.Metric.fnRecalcFromMM(this._arrLineRule[indexSelectItem].defaultValue));
|
this.numLineHeight.setValue(Common.Utils.Metric.fnRecalcFromMM(this._arrLineRule[indexSelectItem].defaultValue, Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
}
|
}
|
||||||
this.CurLineRuleIdx = indexSelectItem;
|
this.CurLineRuleIdx = indexSelectItem;
|
||||||
}
|
}
|
||||||
|
@ -804,7 +806,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
|
||||||
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
|
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
|
||||||
this.Spacing = properties.asc_getSpacing();
|
this.Spacing = properties.asc_getSpacing();
|
||||||
}
|
}
|
||||||
this.Spacing.put_Line((this.cmbLineRule.getValue()==c_paragraphLinerule.LINERULE_AUTO) ? field.getNumberValue() : Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
|
this.Spacing.put_Line((this.cmbLineRule.getValue()==c_paragraphLinerule.LINERULE_AUTO) ? field.getNumberValue() : Common.Utils.Metric.fnRecalcToMM(field.getNumberValue(), Common.Utils.Metric.c_MetricUnits.pt));
|
||||||
},
|
},
|
||||||
|
|
||||||
textTitle: 'Paragraph - Advanced Settings',
|
textTitle: 'Paragraph - Advanced Settings',
|
||||||
|
|
Loading…
Reference in a new issue