[SSE] Fix Bug 51288

This commit is contained in:
Julia Radzhabova 2021-07-14 18:57:23 +03:00
parent 6c4fe8984f
commit fc69eb3b2a

View file

@ -1322,7 +1322,8 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesEditDlg.template',
if (rec) { if (rec) {
props = this._originalProps || new Asc.asc_CConditionalFormattingRule(); props = this._originalProps || new Asc.asc_CConditionalFormattingRule();
var type = rec.get('type'); var type = rec.get('type'),
type_changed = (type!==props.asc_getType());
props.asc_setType(type); props.asc_setType(type);
if (type == Asc.c_oAscCFType.containsText || type == Asc.c_oAscCFType.containsBlanks || type == Asc.c_oAscCFType.duplicateValues || if (type == Asc.c_oAscCFType.containsText || type == Asc.c_oAscCFType.containsBlanks || type == Asc.c_oAscCFType.duplicateValues ||
type == Asc.c_oAscCFType.timePeriod || type == Asc.c_oAscCFType.aboveAverage || type == Asc.c_oAscCFType.timePeriod || type == Asc.c_oAscCFType.aboveAverage ||
@ -1364,7 +1365,7 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesEditDlg.template',
props.asc_setValue1(this.txtRange1.getValue()); props.asc_setValue1(this.txtRange1.getValue());
break; break;
case Asc.c_oAscCFType.colorScale: case Asc.c_oAscCFType.colorScale:
var scaleProps = new Asc.asc_CColorScale(); var scaleProps = !type_changed ? props.asc_getColorScaleOrDataBarOrIconSetRule() : new Asc.asc_CColorScale();
var scalesCount = rec.get('num'); var scalesCount = rec.get('num');
var arr = (scalesCount==2) ? [this.scaleControls[0], this.scaleControls[2]] : this.scaleControls; var arr = (scalesCount==2) ? [this.scaleControls[0], this.scaleControls[2]] : this.scaleControls;
var colors = [], scales = []; var colors = [], scales = [];
@ -1381,7 +1382,8 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesEditDlg.template',
props.asc_setColorScaleOrDataBarOrIconSetRule(scaleProps); props.asc_setColorScaleOrDataBarOrIconSetRule(scaleProps);
break; break;
case Asc.c_oAscCFType.dataBar: case Asc.c_oAscCFType.dataBar:
var barProps = new Asc.asc_CDataBar(); var barProps = !type_changed ? props.asc_getColorScaleOrDataBarOrIconSetRule() : new Asc.asc_CDataBar();
type_changed && barProps.asc_setInterfaceDefault();
var arr = this.barControls; var arr = this.barControls;
var bars = []; var bars = [];
for (var i=0; i<arr.length; i++) { for (var i=0; i<arr.length; i++) {
@ -1417,7 +1419,7 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesEditDlg.template',
props.asc_setColorScaleOrDataBarOrIconSetRule(barProps); props.asc_setColorScaleOrDataBarOrIconSetRule(barProps);
break; break;
case Asc.c_oAscCFType.iconSet: case Asc.c_oAscCFType.iconSet:
var iconsProps = new Asc.asc_CIconSet(); var iconsProps = !type_changed ? props.asc_getColorScaleOrDataBarOrIconSetRule() : new Asc.asc_CIconSet();
iconsProps.asc_setShowValue(this.chIconShow.getValue()!=='checked'); iconsProps.asc_setShowValue(this.chIconShow.getValue()!=='checked');
iconsProps.asc_setReverse(!!this.iconsProps.isReverse); iconsProps.asc_setReverse(!!this.iconsProps.isReverse);
iconsProps.asc_setIconSet(this.iconsProps.iconsSet); iconsProps.asc_setIconSet(this.iconsProps.iconsSet);
@ -1506,6 +1508,7 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesEditDlg.template',
this._changedProps.asc_setColorScaleOrDataBarOrIconSetRule(this.scaleProps); this._changedProps.asc_setColorScaleOrDataBarOrIconSetRule(this.scaleProps);
} else if (type == Asc.c_oAscCFType.dataBar) { } else if (type == Asc.c_oAscCFType.dataBar) {
this.barProps = new Asc.asc_CDataBar(); this.barProps = new Asc.asc_CDataBar();
this.barProps.asc_setInterfaceDefault();
this.barProps.asc_setGradient(this.cmbFill.getValue()); this.barProps.asc_setGradient(this.cmbFill.getValue());
this.barProps.asc_setColor(Common.Utils.ThemeColor.getRgbColor(this.btnPosFill.colorPicker.currentColor)); this.barProps.asc_setColor(Common.Utils.ThemeColor.getRgbColor(this.btnPosFill.colorPicker.currentColor));
var hasBorder = !this.cmbBorder.getValue(); var hasBorder = !this.cmbBorder.getValue();