From 2528dfb5eb1832bc7223c53e79d0abb7cebee779 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 9 May 2023 22:15:48 +0300 Subject: [PATCH] Fix Bug 62449 --- apps/common/main/lib/component/ComboBox.js | 2 +- apps/documenteditor/main/app/controller/Toolbar.js | 7 ++++--- apps/documenteditor/main/app/view/ListSettingsDialog.js | 8 +++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/apps/common/main/lib/component/ComboBox.js b/apps/common/main/lib/component/ComboBox.js index f6e93f0e02..1c42f2e8f1 100644 --- a/apps/common/main/lib/component/ComboBox.js +++ b/apps/common/main/lib/component/ComboBox.js @@ -744,7 +744,7 @@ define([ setValue: function(value, defValue) { Common.UI.ComboBox.prototype.setValue.call(this, value, defValue); if (this.options.updateFormControl) - this.options.updateFormControl.call(this, this._selectedItem); + this.options.updateFormControl.call(this, this._selectedItem, defValue); }, selectRecord: function(record) { diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 1fee71d15f..70b23db9ae 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -873,7 +873,7 @@ define([ var listId = this.api.asc_GetCurrentNumberingId(), numformat = (listId !== null) ? this.api.asc_GetNumberingPr(listId).get_Lvl(this.api.asc_GetCurrentNumberingLvl()).get_Format() : Asc.c_oAscNumberingFormat.None; - this.toolbar.btnMarkers.toggle(numformat===Asc.c_oAscNumberingFormat.Bullet, true); + this.toolbar.btnMarkers.toggle(numformat===Asc.c_oAscNumberingFormat.Bullet || numformat===Asc.c_oAscNumberingFormat.None && (listId !== null), true); this.toolbar.btnNumbers.toggle(numformat!==Asc.c_oAscNumberingFormat.None && numformat!==Asc.c_oAscNumberingFormat.Bullet, true); }, @@ -1357,7 +1357,7 @@ define([ if (type===2) { // multilevel this.toolbar.mnuMultiChangeLevel && this.toolbar.mnuMultiChangeLevel.setDisabled(format === Asc.c_oAscNumberingFormat.None); } else if (type===0) { - this.toolbar.mnuMarkerChangeLevel && this.toolbar.mnuMarkerChangeLevel.setDisabled(format !== Asc.c_oAscNumberingFormat.Bullet); + this.toolbar.mnuMarkerChangeLevel && this.toolbar.mnuMarkerChangeLevel.setDisabled(!(format === Asc.c_oAscNumberingFormat.Bullet || format===Asc.c_oAscNumberingFormat.None && (listId !== null))); } else { this.toolbar.mnuNumberChangeLevel && this.toolbar.mnuNumberChangeLevel.setDisabled(format === Asc.c_oAscNumberingFormat.Bullet || format === Asc.c_oAscNumberingFormat.None); } @@ -1485,7 +1485,8 @@ define([ level = me.api.asc_GetCurrentNumberingLvl(), levelProps = (listId === null) ? null : me.api.asc_GetNumberingPr(listId), format = (listId === null) ? Asc.c_oAscNumberingFormat.None : levelProps.get_Lvl(level).get_Format(), - isNew = listId === null || type===0 && format!==Asc.c_oAscNumberingFormat.Bullet || type===1 && format===Asc.c_oAscNumberingFormat.Bullet, + isNew = listId === null || type===0 && !(format===Asc.c_oAscNumberingFormat.Bullet || format===Asc.c_oAscNumberingFormat.None) || + type===1 && format===Asc.c_oAscNumberingFormat.Bullet, props = isNew ? new Asc.CAscNumbering() : levelProps, picker = (type===0) ? me.toolbar.mnuMarkersPicker : (type===1 ? me.toolbar.mnuNumbersPicker : me.toolbar.mnuMultilevelPicker); if (isNew && picker && picker.store.length>1) { diff --git a/apps/documenteditor/main/app/view/ListSettingsDialog.js b/apps/documenteditor/main/app/view/ListSettingsDialog.js index 16467b73c9..b370db6c98 100644 --- a/apps/documenteditor/main/app/view/ListSettingsDialog.js +++ b/apps/documenteditor/main/app/view/ListSettingsDialog.js @@ -377,7 +377,7 @@ define([ itemsTemplate: _.template(itemsTemplate.join('')), takeFocusOnClose: true, data : [], - updateFormControl: function(record) { + updateFormControl: function(record, defValue) { var formcontrol = $(this.el).find('.form-control'); if (record) { if (record.get('value')==Asc.c_oAscNumberingFormat.Bullet) @@ -385,7 +385,7 @@ define([ else formcontrol[0].innerHTML = record.get('displayValue'); } else - formcontrol[0].innerHTML = ''; + formcontrol[0].innerHTML = defValue ? defValue : ''; } }); this.cmbFormat.on('selected', _.bind(function (combo, record) { @@ -1001,8 +1001,10 @@ define([ store.push(this._itemNewBullet); this.cmbFormat.setData(store); } - if (format == Asc.c_oAscNumberingFormat.Bullet) + if (format === Asc.c_oAscNumberingFormat.Bullet) this.cmbFormat.selectRecord(this.cmbFormat.store.findWhere({value: Asc.c_oAscNumberingFormat.Bullet, symbol: this.bulletProps.symbol, font: this.bulletProps.font || ''})); + else if (this.type===0 && format === Asc.c_oAscNumberingFormat.None) + this.cmbFormat.setValue(Asc.c_oAscNumberingFormat.None, this.txtNone); else this.cmbFormat.setValue((format!==undefined) ? format : ''); }