[DE] Refactoring

This commit is contained in:
Julia Radzhabova 2020-10-15 10:38:12 +03:00
parent 44749d0094
commit 9378917df8

View file

@ -637,12 +637,10 @@ define([
arr = []; arr = [];
_.each(this.api.asc_getAllUsedParagraphStyles(), function (style, index) { _.each(this.api.asc_getAllUsedParagraphStyles(), function (style, index) {
var name = style.get_Name(), var name = style.get_Name();
level = me.api.asc_GetHeadingLevel(name);
arr.push({ arr.push({
displayValue: name, displayValue: name,
value: index, value: index
level: level
}); });
}); });
this.cmbTOFStyles.setData(arr); this.cmbTOFStyles.setData(arr);
@ -741,7 +739,7 @@ define([
} else { } else {
props.put_Caption(null); props.put_Caption(null);
var rec = this.cmbTOFStyles.getSelectedRecord(); var rec = this.cmbTOFStyles.getSelectedRecord();
rec && props.add_Style(rec.displayValue, rec.level); rec && props.add_Style(rec.displayValue, 0);
} }
} else { } else {
if (this._needUpdateOutlineLevels) { if (this._needUpdateOutlineLevels) {
@ -819,7 +817,7 @@ define([
var properties = (this._originalProps) ? this._originalProps : new Asc.CTableOfContentsPr(); var properties = (this._originalProps) ? this._originalProps : new Asc.CTableOfContentsPr();
properties.put_Caption(null); properties.put_Caption(null);
properties.clear_Styles(); properties.clear_Styles();
properties.add_Style(record.displayValue, record.level); properties.add_Style(record.displayValue, 0);
this.api.SetDrawImagePlaceContents('tableofcontents-img', properties); this.api.SetDrawImagePlaceContents('tableofcontents-img', properties);
this.scrollerY.update(); this.scrollerY.update();
} }