From 6014823eb31ec39cf5d4a75bb2fac5e54be3d34f Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Sat, 23 Jan 2021 16:40:40 +0300 Subject: [PATCH] =?UTF-8?q?[SSE]=20Fix=20font=20name.=20Fix=20for=20rev.?= =?UTF-8?q?=20ab4817416569f21253e06d9927f8f8ebd29b04f9=20[ab48174]=2011=20?= =?UTF-8?q?=D0=BD=D0=BE=D1=8F=D0=B1=D1=80=D1=8F=202020=20=D0=B3.=2015:32:1?= =?UTF-8?q?9=20Improve=20performance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/main/lib/component/ComboBoxFonts.js | 4 ++-- .../spreadsheeteditor/main/app/controller/Toolbar.js | 12 +++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/apps/common/main/lib/component/ComboBoxFonts.js b/apps/common/main/lib/component/ComboBoxFonts.js index a47e0b976..7840c57ee 100644 --- a/apps/common/main/lib/component/ComboBoxFonts.js +++ b/apps/common/main/lib/component/ComboBoxFonts.js @@ -345,10 +345,9 @@ define([ var me = this; var name = (_.isFunction(font.get_Name) ? font.get_Name() : font.asc_getFontName()); if (this.__name !== name) { - this.__name = name; if (!this.__nameId) { this.__nameId = setTimeout(function () { - me.onApiChangeFontInternal(me.__name); + me.onApiChangeFontInternal(name); me.__nameId = null; }, 100); } @@ -358,6 +357,7 @@ define([ onApiChangeFontInternal: function(name) { if (this.inFormControl) return; + this.__name = name; if (this.getRawValue() !== name) { var record = this.store.findWhere({ name: name diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index e28e93882..0885beda8 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -2038,10 +2038,7 @@ define([ val; /* read font name */ - var fontparam = fontobj.asc_getFontName(); - if (fontparam != toolbar.cmbFontName.getValue()) { - Common.NotificationCenter.trigger('fonts:change', fontobj); - } + Common.NotificationCenter.trigger('fonts:change', fontobj); /* read font params */ if (!toolbar.mode.isEditMailMerge && !toolbar.mode.isEditDiagram) { @@ -2153,10 +2150,7 @@ define([ val, need_disable = false; /* read font name */ - var fontparam = xfs.asc_getFontName(); - if (fontparam != toolbar.cmbFontName.getValue()) { - Common.NotificationCenter.trigger('fonts:change', xfs); - } + Common.NotificationCenter.trigger('fonts:change', xfs); /* read font size */ var str_size = xfs.asc_getFontSize(); @@ -2335,7 +2329,7 @@ define([ formatTableInfo = info.asc_getFormatTableInfo(); if (!toolbar.mode.isEditMailMerge) { /* read cell horizontal align */ - fontparam = xfs.asc_getHorAlign(); + var fontparam = xfs.asc_getHorAlign(); if (this._state.pralign !== fontparam) { this._state.pralign = fontparam;