Commit 81670178 authored by Ilya Kirillov's avatar Ilya Kirillov

Added default values for all levels of the TOC styles.

parent 967d4ee7
...@@ -3167,30 +3167,37 @@ CStyle.prototype.CreateFootnoteReference = function() ...@@ -3167,30 +3167,37 @@ CStyle.prototype.CreateFootnoteReference = function()
this.Set_UnhideWhenUsed(true); this.Set_UnhideWhenUsed(true);
this.Set_TextPr(oTextPr); this.Set_TextPr(oTextPr);
}; };
CStyle.prototype.CreateTOC1 = function() CStyle.prototype.CreateTOC = function(nLvl)
{ {
var ParaPr = { var ParaPr = {
Spacing : { Spacing : {
After : 5 * g_dKoef_pt_to_mm After : 57 / 20 * g_dKoef_pt_to_mm
}
};
this.Set_UiPriority(39);
this.Set_UnhideWhenUsed(true);
this.Set_ParaPr(ParaPr);
};
CStyle.prototype.CreateTOC2 = function()
{
var ParaPr = {
Spacing : {
After : 5 * g_dKoef_pt_to_mm
}, },
Ind : { Ind : {
Left : 11 * g_dKoef_pt_to_mm Left : 0,
Right : 0,
FirstLine : 0
} }
}; };
if (1 === nLvl)
ParaPr.Ind.Left = 283 / 20 * g_dKoef_pt_to_mm;
else if (2 === nLvl)
ParaPr.Ind.Left = 567 / 20 * g_dKoef_pt_to_mm;
else if (3 === nLvl)
ParaPr.Ind.Left = 850 / 20 * g_dKoef_pt_to_mm;
else if (4 === nLvl)
ParaPr.Ind.Left = 1134 / 20 * g_dKoef_pt_to_mm;
else if (5 === nLvl)
ParaPr.Ind.Left = 1417 / 20 * g_dKoef_pt_to_mm;
else if (6 === nLvl)
ParaPr.Ind.Left = 1701 / 20 * g_dKoef_pt_to_mm;
else if (7 === nLvl)
ParaPr.Ind.Left = 1984 / 20 * g_dKoef_pt_to_mm;
else if (8 === nLvl)
ParaPr.Ind.Left = 2268 / 20 * g_dKoef_pt_to_mm;
this.Set_UiPriority(39); this.Set_UiPriority(39);
this.Set_UnhideWhenUsed(true); this.Set_UnhideWhenUsed(true);
this.Set_ParaPr(ParaPr); this.Set_ParaPr(ParaPr);
...@@ -3470,13 +3477,12 @@ function CStyles(bCreateDefault) ...@@ -3470,13 +3477,12 @@ function CStyles(bCreateDefault)
StyleFootnoteReference.CreateFootnoteReference(); StyleFootnoteReference.CreateFootnoteReference();
this.Default.FootnoteReference = this.Add(StyleFootnoteReference); this.Default.FootnoteReference = this.Add(StyleFootnoteReference);
var TOC1 = new CStyle("toc 1", this.Default.Paragraph, this.Default.Paragraph, styletype_Paragraph); for (var nLvl = 0; nLvl <= 8; ++nLvl)
TOC1.CreateTOC1(); {
this.Default.TOC[0] = this.Add(TOC1); var oStyleTOC = new CStyle("toc " + (nLvl + 1), this.Default.Paragraph, this.Default.Paragraph, styletype_Paragraph);
oStyleTOC.CreateTOC(nLvl);
var TOC2 = new CStyle("toc 2", this.Default.Paragraph, this.Default.Paragraph, styletype_Paragraph); this.Default.TOC[nLvl] = this.Add(oStyleTOC);
TOC2.CreateTOC2(); }
this.Default.TOC[1] = this.Add(TOC2);
// Добавляем данный класс в таблицу Id (обязательно в конце конструктора) // Добавляем данный класс в таблицу Id (обязательно в конце конструктора)
g_oTableId.Add( this, this.Id ); g_oTableId.Add( this, this.Id );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment