From c19fd3b831c743390fabe280195dd067e079f9f6 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 28 Mar 2022 15:31:59 +0300 Subject: [PATCH] Disable flip for shape in smart art --- apps/documenteditor/main/app/view/DocumentHolder.js | 6 ++++-- .../documenteditor/main/app/view/ImageSettingsAdvanced.js | 2 ++ apps/documenteditor/main/app/view/ShapeSettings.js | 8 +++++--- apps/presentationeditor/main/app/view/DocumentHolder.js | 5 ++++- apps/presentationeditor/main/app/view/ShapeSettings.js | 8 +++++--- .../main/app/view/ShapeSettingsAdvanced.js | 2 ++ .../main/app/controller/DocumentHolder.js | 2 ++ apps/spreadsheeteditor/main/app/view/ShapeSettings.js | 8 +++++--- .../main/app/view/ShapeSettingsAdvanced.js | 2 ++ 9 files changed, 31 insertions(+), 12 deletions(-) diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js index 77271e1c7..5bb403590 100644 --- a/apps/documenteditor/main/app/view/DocumentHolder.js +++ b/apps/documenteditor/main/app/view/DocumentHolder.js @@ -2767,9 +2767,11 @@ define([ menuImgReplace.menu.items[2].setVisible(me.mode.canRequestInsertImage || me.mode.fileChoiceUrl && me.mode.fileChoiceUrl.indexOf("{documentType}")>-1); menuImgRotate.setVisible(!value.imgProps.isChart && (pluginGuid===null || pluginGuid===undefined)); - if (menuImgRotate.isVisible()) + if (menuImgRotate.isVisible()) { menuImgRotate.setDisabled(islocked || value.imgProps.isSmartArt); - + menuImgRotate.menu.items[3].setDisabled(value.imgProps.isSmartArtInternal); + menuImgRotate.menu.items[4].setDisabled(value.imgProps.isSmartArtInternal); + } me.menuImgCrop.setVisible(me.api.asc_canEditCrop()); if (me.menuImgCrop.isVisible()) me.menuImgCrop.setDisabled(islocked); diff --git a/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js b/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js index 9e3e36bb5..1a70d2d23 100644 --- a/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js +++ b/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js @@ -1561,6 +1561,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat } if (props.get_FromSmartArtInternal()) { this.chAutofit.setDisabled(true); + this.chFlipHor.setDisabled(true); + this.chFlipVert.setDisabled(true); } var stroke = props.get_stroke(); diff --git a/apps/documenteditor/main/app/view/ShapeSettings.js b/apps/documenteditor/main/app/view/ShapeSettings.js index 8f7a7031d..58d01426b 100644 --- a/apps/documenteditor/main/app/view/ShapeSettings.js +++ b/apps/documenteditor/main/app/view/ShapeSettings.js @@ -822,6 +822,8 @@ define([ this._originalProps = new Asc.asc_CImgProperty(props); this._noApply = true; + this._state.isFromImage = !!shapeprops.get_FromImage(); + this._state.isFromSmartArtInternal = !!shapeprops.get_FromSmartArtInternal(); this.disableControls(this._locked, !shapeprops.get_CanFill()); this.hideShapeOnlySettings(shapeprops.get_FromChart() || !!shapeprops.get_FromImage()); @@ -832,10 +834,8 @@ define([ || shapetype=='curvedConnector3' || shapetype=='curvedConnector4' || shapetype=='curvedConnector5' || shapetype=='straightConnector1'; this.hideChangeTypeSettings(hidechangetype || control_props); - this._state.isFromImage = !!shapeprops.get_FromImage(); - this._state.isFromSmartArtInternal = !!shapeprops.get_FromSmartArtInternal(); if (!hidechangetype && this.btnChangeShape.menu.items.length) { - this.btnChangeShape.shapePicker.hideTextRect(shapeprops.get_FromImage() || shapeprops.get_FromSmartArtInternal()); + this.btnChangeShape.shapePicker.hideTextRect(shapeprops.get_FromImage() || this._state.isFromSmartArtInternal); } var value = props.get_WrappingStyle(); @@ -1986,6 +1986,8 @@ define([ }); this.linkAdvanced.toggleClass('disabled', disable); } + this.btnFlipV.setDisabled(disable || this._state.isFromSmartArtInternal); + this.btnFlipH.setDisabled(disable || this._state.isFromSmartArtInternal); }, hideShapeOnlySettings: function(value) { diff --git a/apps/presentationeditor/main/app/view/DocumentHolder.js b/apps/presentationeditor/main/app/view/DocumentHolder.js index b36dfb0d3..8e82ff2ae 100644 --- a/apps/presentationeditor/main/app/view/DocumentHolder.js +++ b/apps/presentationeditor/main/app/view/DocumentHolder.js @@ -3579,8 +3579,11 @@ define([ mnuArrangeBackward.setDisabled(inSmartartInternal); menuImgShapeRotate.setVisible(_.isUndefined(value.chartProps) && (pluginGuid===null || pluginGuid===undefined)); - if (menuImgShapeRotate.isVisible()) + if (menuImgShapeRotate.isVisible()) { menuImgShapeRotate.setDisabled(disabled || (value.shapeProps && value.shapeProps.value.get_FromSmartArt())); + menuImgShapeRotate.menu.items[3].setDisabled(inSmartartInternal); + menuImgShapeRotate.menu.items[4].setDisabled(inSmartartInternal); + } // image properties menuImgOriginalSize.setVisible(isimage); diff --git a/apps/presentationeditor/main/app/view/ShapeSettings.js b/apps/presentationeditor/main/app/view/ShapeSettings.js index 3d4167f10..0032927cd 100644 --- a/apps/presentationeditor/main/app/view/ShapeSettings.js +++ b/apps/presentationeditor/main/app/view/ShapeSettings.js @@ -766,6 +766,8 @@ define([ { this._originalProps = props; this._noApply = true; + this._state.isFromImage = !!props.get_FromImage(); + this._state.isFromSmartArtInternal = !!props.get_FromSmartArtInternal(); var shapetype = props.asc_getType(); @@ -778,10 +780,8 @@ define([ || shapetype=='curvedConnector3' || shapetype=='curvedConnector4' || shapetype=='curvedConnector5' || shapetype=='straightConnector1'; this.hideChangeTypeSettings(hidechangetype); - this._state.isFromImage = !!props.get_FromImage(); - this._state.isFromSmartArtInternal = !!props.get_FromSmartArtInternal(); if (!hidechangetype && this.btnChangeShape.menu.items.length) { - this.btnChangeShape.shapePicker.hideTextRect(props.get_FromImage() || props.get_FromSmartArtInternal()); + this.btnChangeShape.shapePicker.hideTextRect(props.get_FromImage() || this._state.isFromSmartArtInternal); } // background colors @@ -1849,6 +1849,8 @@ define([ }); this.linkAdvanced.toggleClass('disabled', disable); } + this.btnFlipV.setDisabled(disable || this._state.isFromSmartArtInternal); + this.btnFlipH.setDisabled(disable || this._state.isFromSmartArtInternal); }, hideShapeOnlySettings: function(value) { diff --git a/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js b/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js index 388c8ef53..14d370fb5 100644 --- a/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js +++ b/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js @@ -576,6 +576,8 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem this.radioNofit.setDisabled(true); this.radioShrink.setDisabled(true); this.radioFit.setDisabled(true); + this.chFlipHor.setDisabled(true); + this.chFlipVert.setDisabled(true); } this.spnWidth.setValue(Common.Utils.Metric.fnRecalcFromMM(props.get_Width()).toFixed(2), true); diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index 2ad3a6700..2648a9c15 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -1937,6 +1937,8 @@ define([ documentHolder.menuImgRotate.setVisible(!ischartmenu && (pluginGuid===null || pluginGuid===undefined) && !isslicermenu); documentHolder.menuImgRotate.setDisabled(isObjLocked || isSmartArt); + documentHolder.menuImgRotate.menu.items[3].setDisabled(isSmartArtInternal); + documentHolder.menuImgRotate.menu.items[4].setDisabled(isSmartArtInternal); documentHolder.menuImgCrop.setVisible(this.api.asc_canEditCrop()); documentHolder.menuImgCrop.setDisabled(isObjLocked); diff --git a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js index 50ee3dfea..fe17489b1 100644 --- a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js @@ -764,6 +764,8 @@ define([ this._originalProps = shapeprops; this._noApply = true; + this._state.isFromImage = !!shapeprops.get_FromImage(); + this._state.isFromSmartArtInternal = !!shapeprops.asc_getFromSmartArtInternal(); this.disableControls(this._locked, !shapeprops.asc_getCanFill()); this.hideShapeOnlySettings(shapeprops.asc_getFromChart() || !!shapeprops.asc_getFromImage()); @@ -774,10 +776,8 @@ define([ || shapetype=='curvedConnector3' || shapetype=='curvedConnector4' || shapetype=='curvedConnector5' || shapetype=='straightConnector1'; this.hideChangeTypeSettings(hidechangetype); - this._state.isFromImage = !!shapeprops.get_FromImage(); - this._state.isFromSmartArtInternal = !!shapeprops.asc_getFromSmartArtInternal(); if (!hidechangetype && this.btnChangeShape.menu.items.length) { - this.btnChangeShape.shapePicker.hideTextRect(shapeprops.get_FromImage() || shapeprops.asc_getFromSmartArtInternal()); + this.btnChangeShape.shapePicker.hideTextRect(shapeprops.get_FromImage() || this._state.isFromSmartArtInternal); } // background colors @@ -1868,6 +1868,8 @@ define([ }); this.linkAdvanced.toggleClass('disabled', disable); } + this.btnFlipV.setDisabled(disable || this._state.isFromSmartArtInternal); + this.btnFlipH.setDisabled(disable || this._state.isFromSmartArtInternal); }, hideShapeOnlySettings: function(value) { diff --git a/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js b/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js index ddb8ffd01..2bb6390e7 100644 --- a/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js +++ b/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js @@ -635,6 +635,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp if (shapeprops.asc_getFromSmartArtInternal()) { this.chAutofit.setDisabled(true); this.chOverflow.setDisabled(true); + this.chFlipHor.setDisabled(true); + this.chFlipVert.setDisabled(true); } this.spnWidth.setValue(Common.Utils.Metric.fnRecalcFromMM(props.asc_getWidth()).toFixed(2), true);