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