Commit 273e6ff9 authored by Ilya Kirillov's avatar Ilya Kirillov

Fix bug #30940. Default styles were remaked.

parent 902b1a3d
......@@ -678,17 +678,7 @@ CStyle.prototype =
Create_Default_Paragraph : function()
{
var TextPr =
{
FontFamily: { Name : "Arial", Index : -1 },
Color : { r : 0, g : 0, b : 0 },
Unifill : AscFormat.CreateUnfilFromRGB(0,0,0)
};
this.Set_QFormat( true );
this.Set_TextPr( TextPr );
this.Set_QFormat(true);
},
Create_Default_Character : function()
......@@ -705,15 +695,21 @@ CStyle.prototype =
this.Set_UnhideWhenUsed( true );
},
Create_Heading1 : function()
private_CreateDefaultUnifillColor : function()
{
var ParaPr =
var Unifill = new AscFormat.CUniFill();
Unifill.fill = new AscFormat.CSolidFill();
Unifill.fill.color = AscFormat.builder_CreateSchemeColor('tx1');
return Unifill;
},
Create_Heading1 : function()
{
var ParaPr = {
KeepNext : true,
KeepLines: true,
KeepLines : true,
Spacing :
{
Spacing : {
Before : 24 * g_dKoef_pt_to_mm,
After : 0
},
......@@ -721,17 +717,24 @@ CStyle.prototype =
OutlineLvl : 0
};
var TextPr =
{
var TextPr = {
FontSize : 24,
FontFamily : { Name : Default_Heading_Font, Index : -1 },
FontSizeCS : 24,
RFonts : {
Ascii : {Name : Default_Heading_Font, Index : -1},
EastAsia : {Name : Default_Heading_Font, Index : -1},
HAnsi : {Name : Default_Heading_Font, Index : -1},
CS : {Name : Default_Heading_Font, Index : -1}
},
Bold : true,
Color :
{
BoldCS : true,
Color : {
r : 0,
g : 0,
b : 0
}
},
Unifill : this.private_CreateDefaultUnifillColor()
};
this.Set_QFormat( true );
......@@ -742,13 +745,11 @@ CStyle.prototype =
Create_Heading2 : function()
{
var ParaPr =
{
var ParaPr = {
KeepNext : true,
KeepLines: true,
KeepLines : true,
Spacing :
{
Spacing : {
Before : 10 * g_dKoef_pt_to_mm,
After : 0
},
......@@ -756,35 +757,38 @@ CStyle.prototype =
OutlineLvl : 1
};
var TextPr =
{
var TextPr = {
FontSize : 20,
FontFamily : { Name : Default_Heading_Font, Index : -1 },
RFonts : {
Ascii : {Name : Default_Heading_Font, Index : -1},
EastAsia : {Name : Default_Heading_Font, Index : -1},
HAnsi : {Name : Default_Heading_Font, Index : -1},
CS : {Name : Default_Heading_Font, Index : -1}
},
Bold : true,
Color :
{
BoldCS : true,
Color : {
r : 0,
g : 0,
b : 0
}
},
Unifill : this.private_CreateDefaultUnifillColor()
};
this.Set_QFormat( true );
this.Set_UiPriority( 9 );
this.Set_UnhideWhenUsed( true );
this.Set_TextPr( TextPr );
this.Set_ParaPr( ParaPr );
this.Set_QFormat(true);
this.Set_UiPriority(9);
this.Set_UnhideWhenUsed(true);
this.Set_TextPr(TextPr);
this.Set_ParaPr(ParaPr);
},
Create_Heading3 : function()
{
var ParaPr =
{
var ParaPr = {
KeepNext : true,
KeepLines: true,
KeepLines : true,
Spacing :
{
Spacing : {
Before : 10 * g_dKoef_pt_to_mm,
After : 0
},
......@@ -792,36 +796,41 @@ CStyle.prototype =
OutlineLvl : 2
};
var TextPr =
{
var TextPr = {
FontSize : 18,
FontFamily : { Name : Default_Heading_Font, Index : -1 },
FontSizeCS : 18,
RFonts : {
Ascii : {Name : Default_Heading_Font, Index : -1},
EastAsia : {Name : Default_Heading_Font, Index : -1},
HAnsi : {Name : Default_Heading_Font, Index : -1},
CS : {Name : Default_Heading_Font, Index : -1}
},
Bold : true,
BoldCS : true,
Italic : true,
Color :
{
ItalicCS : true,
Color : {
r : 0,
g : 0,
b : 0
}
},
Unifill : this.private_CreateDefaultUnifillColor()
};
this.Set_QFormat( true );
this.Set_UiPriority( 9 );
this.Set_UnhideWhenUsed( true );
this.Set_TextPr( TextPr );
this.Set_ParaPr( ParaPr );
this.Set_QFormat(true);
this.Set_UiPriority(9);
this.Set_UnhideWhenUsed(true);
this.Set_TextPr(TextPr);
this.Set_ParaPr(ParaPr);
},
Create_Heading4 : function()
{
var ParaPr =
{
var ParaPr = {
KeepNext : true,
KeepLines: true,
KeepLines : true,
Spacing :
{
Spacing : {
Before : 10 * g_dKoef_pt_to_mm,
After : 0
},
......@@ -829,34 +838,37 @@ CStyle.prototype =
OutlineLvl : 3
};
var TextPr =
{
var TextPr = {
FontSize : 16,
FontFamily : { Name : Default_Heading_Font, Index : -1 },
Color :
{
FontSizeCS : 16,
RFonts : {
Ascii : {Name : Default_Heading_Font, Index : -1},
EastAsia : {Name : Default_Heading_Font, Index : -1},
HAnsi : {Name : Default_Heading_Font, Index : -1},
CS : {Name : Default_Heading_Font, Index : -1}
},
Color : {
r : 0x23,
g : 0x23,
b : 0x23
}
};
this.Set_QFormat( true );
this.Set_UiPriority( 9 );
this.Set_UnhideWhenUsed( true );
this.Set_TextPr( TextPr );
this.Set_ParaPr( ParaPr );
this.Set_QFormat(true);
this.Set_UiPriority(9);
this.Set_UnhideWhenUsed(true);
this.Set_TextPr(TextPr);
this.Set_ParaPr(ParaPr);
},
Create_Heading5 : function()
{
var ParaPr =
{
var ParaPr = {
KeepNext : true,
KeepLines: true,
KeepLines : true,
Spacing :
{
Spacing : {
Before : 10 * g_dKoef_pt_to_mm,
After : 0
},
......@@ -867,181 +879,188 @@ CStyle.prototype =
var TextPr =
{
FontSize : 14,
FontFamily : { Name : Default_Heading_Font, Index : -1 },
FontSizeCS : 14,
RFonts : {
Ascii : {Name : Default_Heading_Font, Index : -1},
EastAsia : {Name : Default_Heading_Font, Index : -1},
HAnsi : {Name : Default_Heading_Font, Index : -1},
CS : {Name : Default_Heading_Font, Index : -1}
},
Bold : true,
Color :
{
BoldCS : true,
Color : {
r : 0x44,
g : 0x44,
b : 0x44
}
};
this.Set_QFormat( true );
this.Set_UiPriority( 9 );
this.Set_UnhideWhenUsed( true );
this.Set_TextPr( TextPr );
this.Set_ParaPr( ParaPr );
this.Set_QFormat(true);
this.Set_UiPriority(9);
this.Set_UnhideWhenUsed(true);
this.Set_TextPr(TextPr);
this.Set_ParaPr(ParaPr);
},
Create_Heading6 : function()
{
var ParaPr =
{
var ParaPr = {
KeepNext : true,
KeepLines: true,
Spacing :
{
KeepLines : true,
Spacing : {
Before : 10 * g_dKoef_pt_to_mm,
After : 0
},
OutlineLvl : 5
};
var TextPr =
{
var TextPr = {
FontSize : 14,
FontSizeCS : 14,
Italic : true,
FontFamily : { Name : Default_Heading_Font, Index : -1 },
Color :
{
ItalicCS : true,
RFonts : {
Ascii : {Name : Default_Heading_Font, Index : -1},
EastAsia : {Name : Default_Heading_Font, Index : -1},
HAnsi : {Name : Default_Heading_Font, Index : -1},
CS : {Name : Default_Heading_Font, Index : -1}
},
Color : {
r : 0x23,
g : 0x23,
b : 0x23
}
};
this.Set_QFormat( true );
this.Set_UiPriority( 9 );
this.Set_UnhideWhenUsed( true );
this.Set_TextPr( TextPr );
this.Set_ParaPr( ParaPr );
this.Set_QFormat(true);
this.Set_UiPriority(9);
this.Set_UnhideWhenUsed(true);
this.Set_TextPr(TextPr);
this.Set_ParaPr(ParaPr);
},
Create_Heading7 : function()
{
var ParaPr =
{
var ParaPr = {
KeepNext : true,
KeepLines: true,
Spacing :
{
KeepLines : true,
Spacing : {
Before : 10 * g_dKoef_pt_to_mm,
After : 0
},
OutlineLvl : 6
};
var TextPr =
{
var TextPr = {
FontSize : 12,
FontFamily : { Name : Default_Heading_Font, Index : -1 },
FontSizeCS : 12,
RFonts : {
Ascii : {Name : Default_Heading_Font, Index : -1},
EastAsia : {Name : Default_Heading_Font, Index : -1},
HAnsi : {Name : Default_Heading_Font, Index : -1},
CS : {Name : Default_Heading_Font, Index : -1}
},
Bold : true,
Color :
{
BoldCS : true,
Color : {
r : 0x60,
g : 0x60,
b : 0x60
}
};
this.Set_QFormat( true );
this.Set_UiPriority( 9 );
this.Set_UnhideWhenUsed( true );
this.Set_TextPr( TextPr );
this.Set_ParaPr( ParaPr );
this.Set_QFormat(true);
this.Set_UiPriority(9);
this.Set_UnhideWhenUsed(true);
this.Set_TextPr(TextPr);
this.Set_ParaPr(ParaPr);
},
Create_Heading8 : function()
{
var ParaPr =
{
var ParaPr = {
KeepNext : true,
KeepLines: true,
Spacing :
{
KeepLines : true,
Spacing : {
Before : 10 * g_dKoef_pt_to_mm,
After : 0
},
OutlineLvl : 7
};
var TextPr =
{
var TextPr = {
FontSize : 12,
FontFamily : { Name : Default_Heading_Font, Index : -1 },
Color :
{
FontSizeCS : 12,
RFonts : {
Ascii : {Name : Default_Heading_Font, Index : -1},
EastAsia : {Name : Default_Heading_Font, Index : -1},
HAnsi : {Name : Default_Heading_Font, Index : -1},
CS : {Name : Default_Heading_Font, Index : -1}
},
Color : {
r : 0x44,
g : 0x44,
b : 0x44
}
};
this.Set_QFormat( true );
this.Set_UiPriority( 9 );
this.Set_UnhideWhenUsed( true );
this.Set_TextPr( TextPr );
this.Set_ParaPr( ParaPr );
this.Set_QFormat(true);
this.Set_UiPriority(9);
this.Set_UnhideWhenUsed(true);
this.Set_TextPr(TextPr);
this.Set_ParaPr(ParaPr);
},
Create_Heading9 : function()
{
var ParaPr =
{
var ParaPr = {
KeepNext : true,
KeepLines: true,
Spacing :
{
KeepLines : true,
Spacing : {
Before : 10 * g_dKoef_pt_to_mm,
After : 0
},
OutlineLvl : 8
};
var TextPr =
{
var TextPr = {
FontSize : 11.5,
FontFamily : { Name : Default_Heading_Font, Index : -1 },
FontSizeCS : 11.5,
RFonts : {
Ascii : {Name : Default_Heading_Font, Index : -1},
EastAsia : {Name : Default_Heading_Font, Index : -1},
HAnsi : {Name : Default_Heading_Font, Index : -1},
CS : {Name : Default_Heading_Font, Index : -1}
},
Italic : true,
Color :
{
ItalicCS : true,
Color : {
r : 0x44,
g : 0x44,
b : 0x44
}
};
this.Set_QFormat( true );
this.Set_UiPriority( 9 );
this.Set_UnhideWhenUsed( true );
this.Set_TextPr( TextPr );
this.Set_ParaPr( ParaPr );
this.Set_QFormat(true);
this.Set_UiPriority(9);
this.Set_UnhideWhenUsed(true);
this.Set_TextPr(TextPr);
this.Set_ParaPr(ParaPr);
},
Create_ListParagraph : function()
{
var ParaPr =
{
Ind :
{
var ParaPr = {
Ind : {
Left : 36 * g_dKoef_pt_to_mm
},
ContextualSpacing : true
};
this.Set_QFormat( true );
this.Set_UiPriority( 34 );
this.Set_ParaPr( ParaPr );
this.Set_QFormat(true);
this.Set_UiPriority(34);
this.Set_ParaPr(ParaPr);
},
Create_NoSpacing : function()
......@@ -8532,9 +8551,6 @@ CTextPr.prototype =
if (this.Underline !== TextPr.Underline)
return false;
if ((undefined === this.FontFamily && undefined !== TextPr.FontFamily) || (undefined !== this.FontFamily && (undefined === TextPr.FontFamily || this.FontFamily.Name !== TextPr.FontFamily.Name)))
return false;
if (false
|| (undefined === this.FontSize
&& undefined !== TextPr.FontSize)
......@@ -8599,7 +8615,6 @@ CTextPr.prototype =
if ((undefined === this.Unifill && undefined !== TextPr.Unifill) || (undefined !== this.Unifill && (undefined === TextPr.Unifill || true !== this.Unifill.IsIdentical(TextPr.Unifill))))
return false;
if ((undefined === this.TextOutline && undefined !== TextPr.TextOutline) || (undefined !== this.TextOutline && (undefined === TextPr.TextOutline || true !== this.TextOutline.IsIdentical(TextPr.TextOutline))))
return false;
......@@ -9306,9 +9321,13 @@ CParaSpacing.prototype =
{
if (this.Line !== Spacing.Line
|| this.LineRule !== Spacing.LineRule
|| this.Before !== Spacing.Before
|| (this.Before === undefined && Spacing.Before !== undefined)
|| (this.Before !== undefined && Spacing.Before === undefined)
|| ((this.Before !== undefined && Spacing.Before !== undefined) && (this.Before - Spacing.Before) > 0.001)
|| this.BeforeAutoSpacing !== Spacing.BeforeAutoSpacing
|| this.After !== Spacing.After
|| (this.After === undefined && Spacing.After !== undefined)
|| (this.After !== undefined && Spacing.After === undefined)
|| ((this.After !== undefined && Spacing.After !== undefined) && (this.After - Spacing.After) > 0.001)
|| this.AfterAutoSpacing !== Spacing.AfterAutoSpacing)
return false;
......@@ -10020,26 +10039,18 @@ CParaPr.prototype =
{
this.ContextualSpacing = ParaPr.ContextualSpacing;
if ( undefined != ParaPr.Ind )
{
this.Ind = new CParaInd();
this.Ind.Set_FromObject( ParaPr.Ind );
}
else
this.Ind = undefined;
if (undefined != ParaPr.Ind)
this.Ind.Set_FromObject(ParaPr.Ind);
this.Jc = ParaPr.Jc;
this.KeepLines = ParaPr.KeepLines;
this.KeepNext = ParaPr.KeepNext;
this.PageBreakBefore = ParaPr.PageBreakBefore;
if ( undefined != ParaPr.Spacing )
{
this.Spacing = new CParaSpacing();
this.Spacing.Set_FromObject( ParaPr.Spacing );
}
else
this.Spacing = undefined;
if (undefined != ParaPr.Spacing)
this.Spacing.Set_FromObject(ParaPr.Spacing);
if ( undefined != ParaPr.Shd )
{
......
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