From c1978e567ed89d3f6b4529d44052ede54dd99cf6 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 9 Nov 2021 15:23:31 +0300 Subject: [PATCH] [DE] Disable toolbar buttons for smart arts --- apps/documenteditor/main/app/controller/PageLayout.js | 5 +++-- apps/documenteditor/main/app/controller/Toolbar.js | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/app/controller/PageLayout.js b/apps/documenteditor/main/app/controller/PageLayout.js index 0be70b040..652d94b9b 100644 --- a/apps/documenteditor/main/app/controller/PageLayout.js +++ b/apps/documenteditor/main/app/controller/PageLayout.js @@ -129,7 +129,8 @@ define([ for (var i in objects) { type = objects[i].get_ObjectType(); if ( type === Asc.c_oAscTypeSelectElement.Image ) { - var props = objects[i].get_ObjectValue(); + var props = objects[i].get_ObjectValue(), + shapeProps = props.get_ShapeProperties(); var islocked = props.get_Locked(); var notflow = !props.get_CanBeFlow(); @@ -147,7 +148,7 @@ define([ disable.align = islocked || wrapping == Asc.c_oAscWrapStyle2.Inline || content_locked; disable.group = islocked || wrapping == Asc.c_oAscWrapStyle2.Inline || content_locked; - disable.arrange = (wrapping == Asc.c_oAscWrapStyle2.Inline) && !props.get_FromGroup() || content_locked; + disable.arrange = (wrapping == Asc.c_oAscWrapStyle2.Inline) && !props.get_FromGroup() || shapeProps && shapeProps.asc_getFromSmartArtInternal() || content_locked; disable.wrapping = islocked || props.get_FromGroup() || (notflow && !me.api.CanChangeWrapPolygon()) || content_locked || (!!control_props && control_props.get_SpecificType()==Asc.c_oAscContentControlSpecificType.Picture); if ( !disable.group ) { diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 8e74ccf5f..c504cfe00 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -744,6 +744,7 @@ define([ enable_dropcap = undefined, disable_dropcapadv = true, frame_pr = undefined, + shape_pr = undefined, toolbar = this.toolbar, in_header = false, in_chart = false, @@ -772,6 +773,8 @@ define([ image_locked = pr.get_Locked(); if (pr && pr.get_ChartProperties()) in_chart = true; + if (pr && pr.get_ShapeProperties()) + shape_pr = pr.get_ShapeProperties(); } else if (type === Asc.c_oAscTypeSelectElement.Math) { in_equation = true; if (Asc.c_oAscMathInterfaceType.Common === pr.get_Type()) @@ -819,7 +822,7 @@ define([ toolbar.btnContentControls.menu.items[10].setDisabled(!in_control || if_form); } - var need_text_disable = paragraph_locked || header_locked || in_chart || rich_edit_lock || plain_edit_lock; + var need_text_disable = paragraph_locked || header_locked || in_chart || rich_edit_lock || plain_edit_lock || shape_pr && (shape_pr.asc_getFromSmartArt() || shape_pr.asc_getFromSmartArtInternal()); if (this._state.textonlycontrolsdisable != need_text_disable) { if (this._state.activated) this._state.textonlycontrolsdisable = need_text_disable; if (!need_disable) {