Fix Bug 62449

This commit is contained in:
Julia Radzhabova
2023-05-09 22:15:48 +03:00
parent 981e242e14
commit 2528dfb5eb
3 changed files with 10 additions and 7 deletions

View File

@ -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) {

View File

@ -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) {

View File

@ -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 : '');
}