From 08f8ebf84533532c771600433c72b1f9054bb9e8 Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Wed, 5 Aug 2020 21:16:17 +0300 Subject: [PATCH 1/2] [SSE] Fix bug 43570 --- apps/spreadsheeteditor/main/app/view/Statusbar.js | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/spreadsheeteditor/main/app/view/Statusbar.js b/apps/spreadsheeteditor/main/app/view/Statusbar.js index 202230dc4..b5555ab23 100644 --- a/apps/spreadsheeteditor/main/app/view/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/view/Statusbar.js @@ -244,6 +244,7 @@ define([ var key = _.findWhere(arrData, {type: 'key'}).value; if (Common.Utils.InternalSettings.get("sse-doc-info-key") === key) { this.api.asc_moveWorksheet(index, _.findWhere(arrData, {type: 'indexes'}).value); + this.api.asc_enableKeyEvents(true); Common.NotificationCenter.trigger('tabs:dragend', this); } else { var names = [], wc = this.api.asc_getWorksheetsCount(); From 72a392698da25a0eb4b44198515b54c8f17c2ab8 Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Thu, 6 Aug 2020 14:51:59 +0300 Subject: [PATCH 2/2] [SSE] Fix bug 46017 --- .../main/app/view/Statusbar.js | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/Statusbar.js b/apps/spreadsheeteditor/main/app/view/Statusbar.js index b5555ab23..a393d21a6 100644 --- a/apps/spreadsheeteditor/main/app/view/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/view/Statusbar.js @@ -254,22 +254,19 @@ define([ var newNames = []; var arrNames = _.findWhere(arrData, {type: 'names'}).value; arrNames.forEach(function (name) { - var ind = 0, + var ind = 1, name = name; - var first = name; - if (names.indexOf(name.toLowerCase()) !== -1) { - while (true) { - if (names.indexOf(name.toLowerCase()) === -1) { - newNames.push(name); - break; - } else { - ind++; - name = first + '(' + ind + ')'; - } - } - } else { - newNames.push(name); + var re = /^(.*)\((\d)\)$/.exec(name); + var first = re ? re[1] : name + ' '; + var arr = []; + newNames.length > 0 && newNames.forEach(function (item) { + arr.push(item.toLowerCase()); + }); + while (names.indexOf(name.toLowerCase()) !== -1 || arr.indexOf(name.toLowerCase()) !== -1) { + ind++; + name = first + '(' + ind + ')'; } + newNames.push(name); }); this.api.asc_EndMoveSheet(index, newNames, _.findWhere(arrData, {type: 'onlyoffice'}).value); }