From cd39943c812e41112a8ca026c533be2b0356c584 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 17 Jan 2022 22:45:48 +0300 Subject: [PATCH] Fix Bug 54917 --- apps/documenteditor/main/app/controller/Main.js | 9 +++++++-- apps/presentationeditor/main/app/controller/Main.js | 9 +++++++-- apps/spreadsheeteditor/main/app/controller/Main.js | 9 +++++++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index cda8b75f0..1d2037829 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -2193,7 +2193,8 @@ define([ var me = this, shapegrouparray = [], - shapeStore = this.getCollection('ShapeGroups'); + shapeStore = this.getCollection('ShapeGroups'), + name_arr = {}; shapeStore.reset(); @@ -2208,12 +2209,15 @@ define([ width = 30 * cols; _.each(shapes[index], function(shape, idx){ + var name = me['txtShape_' + shape.Type]; arr.push({ data : {shapeType: shape.Type}, - tip : me['txtShape_' + shape.Type] || (me.textShape + ' ' + (idx+1)), + tip : name || (me.textShape + ' ' + (idx+1)), allowSelected : true, selected: false }); + if (name) + name_arr[shape.Type] = name; }); store.add(arr); shapegrouparray.push({ @@ -2228,6 +2232,7 @@ define([ setTimeout(function(){ me.getApplication().getController('Toolbar').onApiAutoShapes(); }, 50); + this.api.asc_setShapeNames(name_arr); }, fillTextArt: function(shapes){ diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 856092514..672c06ff9 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -1905,7 +1905,8 @@ define([ return; var me = this, - shapegrouparray = []; + shapegrouparray = [], + name_arr = {}; _.each(groupNames, function(groupName, index){ var store = new Backbone.Collection([], { @@ -1918,12 +1919,15 @@ define([ width = 30 * cols; _.each(shapes[index], function(shape, idx){ + var name = me['txtShape_' + shape.Type]; arr.push({ data : {shapeType: shape.Type}, - tip : me['txtShape_' + shape.Type] || (me.textShape + ' ' + (idx+1)), + tip : name || (me.textShape + ' ' + (idx+1)), allowSelected : true, selected: false }); + if (name) + name_arr[shape.Type] = name; }); store.add(arr); shapegrouparray.push({ @@ -1935,6 +1939,7 @@ define([ }); this.getCollection('ShapeGroups').reset(shapegrouparray); + this.api.asc_setShapeNames(name_arr); }, fillLayoutsStore: function(layouts){ diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index b32e41c92..1a13e7f58 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -2349,7 +2349,8 @@ define([ var me = this, shapegrouparray = [], - shapeStore = this.getCollection('ShapeGroups'); + shapeStore = this.getCollection('ShapeGroups'), + name_arr = {}; shapeStore.reset(); @@ -2364,12 +2365,15 @@ define([ width = 30 * cols; _.each(shapes[index], function(shape, idx){ + var name = me['txtShape_' + shape.Type]; arr.push({ data : {shapeType: shape.Type}, - tip : me['txtShape_' + shape.Type] || (me.textShape + ' ' + (idx+1)), + tip : name || (me.textShape + ' ' + (idx+1)), allowSelected : true, selected: false }); + if (name) + name_arr[shape.Type] = name; }); store.add(arr); shapegrouparray.push({ @@ -2385,6 +2389,7 @@ define([ setTimeout(function(){ me.getApplication().getController('Toolbar').onApiAutoShapes(); }, 50); + this.api.asc_setShapeNames(name_arr); }, fillTextArt: function(shapes){