From b2f9eec00aa1629b0043016af687a256c4c4d5f8 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 12 Apr 2016 13:21:31 +0300 Subject: [PATCH] =?UTF-8?q?[DE]=20=D0=9E=D1=82=D0=BB=D0=B0=D0=B4=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=B2=D1=8B=D1=81=D1=82=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D1=80=D0=B0=D0=B7=D0=BC=D0=B5=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=20=D1=84=D0=B8=D0=B3=D1=83=D1=80=20(=D0=BF=D1=80=D0=B8=20?= =?UTF-8?q?=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D0=B8=20=D0=BE?= =?UTF-8?q?=D0=B4=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=B8=D0=B7=D0=BC=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B7=D0=B0=D0=BF=D0=BE=D0=BB=D0=BD?= =?UTF-8?q?=D1=8F=D1=82=D1=8C=20=D0=B8=20=D0=B2=D1=82=D0=BE=D1=80=D0=BE?= =?UTF-8?q?=D0=B5).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/app/view/ImageSettingsAdvanced.js | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js b/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js index fd3b411d1..77e9dffbe 100644 --- a/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js +++ b/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js @@ -249,7 +249,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat } if (this._changedProps) { this._changedProps.put_Width(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue())); - this._changedProps.put_Height(Common.Utils.Metric.fnRecalcToMM(this.spnShapeHeight.getNumberValue())); + this.fillShapeHeight(); } }, this)); this.spinners.push(this.spnShapeWidth); @@ -276,7 +276,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat } if (this._changedProps) { this._changedProps.put_Height(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue())); - this._changedProps.put_Width(Common.Utils.Metric.fnRecalcToMM(this.spnShapeWidth.getNumberValue())); + this.fillShapeWidth(); } }, this)); this.spinners.push(this.spnShapeHeight); @@ -298,6 +298,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat this._changedProps.get_SizeRelH().put_Value(field.getNumberValue()); this._changedProps.get_SizeRelH().put_RelativeFrom(this._state.ShapeWidthPcFrom); + + this.fillShapeHeight(); } }, this)); @@ -318,6 +320,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat this._changedProps.get_SizeRelV().put_Value(field.getNumberValue()); this._changedProps.get_SizeRelV().put_RelativeFrom(this._state.ShapeHeightPcFrom); + + this.fillShapeWidth(); } }, this)); @@ -1772,6 +1776,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat if (this._changedProps) { this._changedProps.put_Width(Common.Utils.Metric.fnRecalcToMM(this.spnShapeWidth.getNumberValue())); this._changedProps.put_SizeRelH(undefined); + + this.fillShapeHeight(); } this.chRatio.setDisabled(this.radioVSizePc.getValue()); this.cmbWidthPc.setDisabled(true); @@ -1788,6 +1794,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat this._changedProps.get_SizeRelH().put_Value(this.spnShapeWidthPc.getNumberValue()); this._changedProps.get_SizeRelH().put_RelativeFrom(this._state.ShapeWidthPcFrom); + + this.fillShapeHeight(); } this.chRatio.setDisabled(true); this.cmbWidthPc.setDisabled(false); @@ -1801,6 +1809,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat if (this._changedProps) { this._changedProps.put_Height(Common.Utils.Metric.fnRecalcToMM(this.spnShapeHeight.getNumberValue())); this._changedProps.put_SizeRelV(undefined); + + this.fillShapeWidth(); } this.chRatio.setDisabled(this.radioHSizePc.getValue()); this.cmbHeightPc.setDisabled(true); @@ -1817,6 +1827,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat this._changedProps.get_SizeRelV().put_Value(this.spnShapeHeightPc.getNumberValue()); this._changedProps.get_SizeRelV().put_RelativeFrom(this._state.ShapeHeightPcFrom); + + this.fillShapeWidth(); } this.chRatio.setDisabled(true); this.cmbHeightPc.setDisabled(false); @@ -1833,6 +1845,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat this._state.ShapeWidthPcFrom = record.value; this._changedProps.get_SizeRelH().put_Value(this.spnShapeWidthPc.getNumberValue()); this._changedProps.get_SizeRelH().put_RelativeFrom(this._state.ShapeWidthPcFrom); + + this.fillShapeHeight(); } }, @@ -1844,6 +1858,32 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat this._state.ShapeHeightPcFrom = record.value; this._changedProps.get_SizeRelV().put_Value(this.spnShapeHeightPc.getNumberValue()); this._changedProps.get_SizeRelV().put_RelativeFrom(this._state.ShapeHeightPcFrom); + + this.fillShapeWidth(); + } + }, + + fillShapeWidth: function(combo, record){ + if (this.radioHSize.getValue()) + this._changedProps.put_Width(Common.Utils.Metric.fnRecalcToMM(this.spnShapeWidth.getNumberValue())); + else { + if (this._changedProps.get_SizeRelH()===null || this._changedProps.get_SizeRelH()===undefined) + this._changedProps.put_SizeRelH(new Asc.CImagePositionH()); + + this._changedProps.get_SizeRelH().put_Value(this.spnShapeWidthPc.getNumberValue()); + this._changedProps.get_SizeRelH().put_RelativeFrom(this._state.ShapeWidthPcFrom); + } + }, + + fillShapeHeight: function(combo, record){ + if (this.radioVSize.getValue()) + this._changedProps.put_Height(Common.Utils.Metric.fnRecalcToMM(this.spnShapeHeight.getNumberValue())); + else { + if (this._changedProps.get_SizeRelV()===null || this._changedProps.get_SizeRelV()===undefined) + this._changedProps.put_SizeRelV(new Asc.CImagePositionV()); + + this._changedProps.get_SizeRelV().put_Value(this.spnShapeHeightPc.getNumberValue()); + this._changedProps.get_SizeRelV().put_RelativeFrom(this._state.ShapeHeightPcFrom); } },