From 7f1ddadefac21b30ce13a9e5e96cdc97ca485917 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 9 Nov 2021 16:56:05 +0300 Subject: [PATCH] [SSE] Fix cell color --- .../main/app/controller/Toolbar.js | 20 ++++++++----------- .../main/app/view/FormatRulesEditDlg.js | 2 +- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 2152752a6..55997074b 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -604,39 +604,35 @@ define([ }, onTextColor: function() { - this.toolbar.mnuTextColorPicker.trigger('select', this.toolbar.mnuTextColorPicker, this.toolbar.mnuTextColorPicker.currentColor, true); + this.toolbar.mnuTextColorPicker.trigger('select', this.toolbar.mnuTextColorPicker, this.toolbar.mnuTextColorPicker.currentColor); }, onBackColor: function() { - this.toolbar.mnuBackColorPicker.trigger('select', this.toolbar.mnuBackColorPicker, this.toolbar.mnuBackColorPicker.currentColor, true); + this.toolbar.mnuBackColorPicker.trigger('select', this.toolbar.mnuBackColorPicker, this.toolbar.mnuBackColorPicker.currentColor); }, - onTextColorSelect: function(btn, color, fromBtn) { + onTextColorSelect: function(btn, color) { this._state.clrtext_asccolor = this._state.clrtext = undefined; this.toolbar.btnTextColor.currentColor = color; this.toolbar.mnuTextColorPicker.currentColor = color; if (this.api) { - this.toolbar.btnTextColor.ischanged = (fromBtn!==true); this.api.asc_setCellTextColor(color.isAuto ? color.color : Common.Utils.ThemeColor.getRgbColor(color)); - this.toolbar.btnTextColor.ischanged = false; } Common.NotificationCenter.trigger('edit:complete', this.toolbar, {restorefocus:true}); Common.component.Analytics.trackEvent('ToolBar', 'Text Color'); }, - onBackColorSelect: function(btn, color, fromBtn) { + onBackColorSelect: function(btn, color) { this._state.clrshd_asccolor = this._state.clrback = undefined; this.toolbar.btnBackColor.currentColor = color; this.toolbar.mnuBackColorPicker.currentColor = color; if (this.api) { - this.toolbar.btnBackColor.ischanged = (fromBtn!==true); this.api.asc_setCellBackgroundColor(color == 'transparent' ? null : Common.Utils.ThemeColor.getRgbColor(color)); - this.toolbar.btnBackColor.ischanged = false; } Common.component.Analytics.trackEvent('ToolBar', 'Background Color'); @@ -2446,7 +2442,7 @@ define([ color, fontColorPicker = this.toolbar.mnuTextColorPicker; - if (!toolbar.btnTextColor.ischanged && !fontColorPicker.isDummy) { + if (!fontColorPicker.isDummy) { color = fontobj.asc_getFontColor(); if (color) { if (color.get_auto()) { @@ -2608,7 +2604,7 @@ define([ fontColorPicker = this.toolbar.mnuTextColorPicker, paragraphColorPicker = this.toolbar.mnuBackColorPicker; - if (!toolbar.btnTextColor.ischanged && !fontColorPicker.isDummy) { + if (!fontColorPicker.isDummy) { color = xfs.asc_getFontColor(); if (color) { if (color.get_auto()) { @@ -2651,9 +2647,9 @@ define([ } /* read cell background color */ - if (!toolbar.btnBackColor.ischanged && !paragraphColorPicker.isDummy) { + if (!paragraphColorPicker.isDummy) { color = xfs.asc_getFillColor(); - if (color) { + if (color && !color.get_auto()) { if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) { clr = {color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()), effectValue: color.get_value() }; } else { diff --git a/apps/spreadsheeteditor/main/app/view/FormatRulesEditDlg.js b/apps/spreadsheeteditor/main/app/view/FormatRulesEditDlg.js index 8d61decb8..bab9b24b5 100644 --- a/apps/spreadsheeteditor/main/app/view/FormatRulesEditDlg.js +++ b/apps/spreadsheeteditor/main/app/view/FormatRulesEditDlg.js @@ -1267,7 +1267,7 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesEditDlg.template', setColor: function(color, control, picker) { picker = control ? control.colorPicker : picker; - if (color) { + if (color && !color.get_auto()) { if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) { color = {color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()), effectValue: color.get_value() }; } else {