Commit 72eff22b authored by Anna.Pavlova's avatar Anna.Pavlova Committed by Alexander.Trofimov

1. Сделала поддержку RFonts для мат текста, ctrPrp (Ascii, HAnsi etc)

2. Поправила баг : для случая когда в матрице один столбец не учитывалось выравнивание столбцов

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59972 954022d7-b5bf-4e40-9824-e11837661b57
parent a6e0227a
......@@ -1165,21 +1165,6 @@ ParaMath.prototype.MathToImageConverter = function(bCopy, _canvasInput, _widthPx
return null;
};
ParaMath.prototype.ApplyArgSize = function(FontSize, argSize)
{
var ResultFontSize = FontSize;
if(argSize == -1)
{
ResultFontSize *= g_dMathArgSizeKoeff_1;
}
else if(argSize == -2)
{
ResultFontSize *= g_dMathArgSizeKoeff_2;
}
return ResultFontSize;
};
ParaMath.prototype.GetFirstRPrp = function()
{
return this.Root.getFirstRPrp(this);
......@@ -1990,6 +1975,11 @@ var historyitem_Math_CtrPrpStrikeout = 11;
var historyitem_Math_CtrPrpDoubleStrikeout = 12;
var historyitem_Math_CtrPrpItalic = 13;
var historyitem_Math_CtrPrpBold = 14;
var historyitem_Math_RFontsAscii = 15;
var historyitem_Math_RFontsHAnsi = 16;
var historyitem_Math_RFontsCS = 17;
var historyitem_Math_RFontsEastAsia = 18;
var historyitem_Math_RFontsHint = 19;
function ReadChanges_FromBinary(Reader, Class)
......@@ -2010,6 +2000,11 @@ function ReadChanges_FromBinary(Reader, Class)
case historyitem_Math_CtrPrpDoubleStrikeout : Changes = new CChangesMath_DoubleStrikeout(); break;
case historyitem_Math_CtrPrpItalic : Changes = new CChangesMathItalic(); break;
case historyitem_Math_CtrPrpBold : Changes = new CChangesMathBold(); break;
case historyitem_Math_RFontsAscii : Changes = new CChangesMath_RFontsAscii(); break;
case historyitem_Math_RFontsHAnsi : Changes = new CChangesMath_RFontsHAnsi(); break;
case historyitem_Math_RFontsCS : Changes = new CChangesMath_RFontsCS(); break;
case historyitem_Math_RFontsEastAsia : Changes = new CChangesMath_RFontsEastAsia(); break;
case historyitem_Math_RFontsHint : Changes = new CChangesMath_RFontsHint(); break;
}
if (null !== Changes)
......@@ -2406,6 +2401,244 @@ CChangesMathBold.prototype.Load_Changes = function(Reader, Class)
};
function CChangesMath_RFontsAscii(NewValue, OldValue)
{
this.New = NewValue;
this.Old = OldValue;
}
CChangesMath_RFontsAscii.prototype.Type = historyitem_Math_RFontsAscii;
CChangesMath_RFontsAscii.prototype.Undo = function(Class)
{
Class.raw_SetRFontsAscii(this.Old);
};
CChangesMath_RFontsAscii.prototype.Redo = function(Class)
{
Class.raw_SetRFontsAscii(this.New);
};
CChangesMath_RFontsAscii.prototype.Save_Changes = function(Writer)
{
// Bool : IsUndefined
// String : Font
if (undefined === this.New)
{
Writer.WriteBool(true);
}
else
{
Writer.WriteBool(false);
Writer.WriteString2(this.New.Name);
}
};
CChangesMath_RFontsAscii.prototype.Load_Changes = function(Reader, Class)
{
// Bool : IsUndefined
// String : Font
if(true === Reader.GetBool())
this.New = undefined;
else
{
this.New =
{
Name : Reader.GetString2(),
Index : -1
};
}
this.Redo(Class);
};
function CChangesMath_RFontsHAnsi(NewValue, OldValue)
{
this.New = NewValue;
this.Old = OldValue;
}
CChangesMath_RFontsHAnsi.prototype.Type = historyitem_Math_RFontsHAnsi;
CChangesMath_RFontsHAnsi.prototype.Undo = function(Class)
{
Class.raw_SetRFontsHAnsi(this.Old);
};
CChangesMath_RFontsHAnsi.prototype.Redo = function(Class)
{
Class.raw_SetRFontsHAnsi(this.New);
};
CChangesMath_RFontsHAnsi.prototype.Save_Changes = function(Writer)
{
// Bool : IsUndefined
// String : Font
if (undefined === this.New)
{
Writer.WriteBool(true);
}
else
{
Writer.WriteBool(false);
Writer.WriteString2(this.New.Name);
}
};
CChangesMath_RFontsHAnsi.prototype.Load_Changes = function(Reader, Class)
{
// Bool : IsUndefined
// String : Font
if(true === Reader.GetBool())
this.New = undefined;
else
{
this.New =
{
Name : Reader.GetString2(),
Index : -1
};
}
this.Redo(Class);
};
function CChangesMath_RFontsCS(NewValue, OldValue)
{
this.New = NewValue;
this.Old = OldValue;
}
CChangesMath_RFontsCS.prototype.Type = historyitem_Math_RFontsCS;
CChangesMath_RFontsCS.prototype.Undo = function(Class)
{
Class.raw_SetRFontsCS(this.Old);
};
CChangesMath_RFontsCS.prototype.Redo = function(Class)
{
Class.raw_SetRFontsCS(this.New);
};
CChangesMath_RFontsCS.prototype.Save_Changes = function(Writer)
{
// Bool : IsUndefined
// String : Font
if (undefined === this.New)
{
Writer.WriteBool(true);
}
else
{
Writer.WriteBool(false);
Writer.WriteString2(this.New.Name);
}
};
CChangesMath_RFontsCS.prototype.Load_Changes = function(Reader, Class)
{
// Bool : IsUndefined
// String : Font
if(true === Reader.GetBool())
this.New = undefined;
else
{
this.New =
{
Name : Reader.GetString2(),
Index : -1
};
}
this.Redo(Class);
};
function CChangesMath_RFontsEastAsia(NewValue, OldValue)
{
this.New = NewValue;
this.Old = OldValue;
}
CChangesMath_RFontsEastAsia.prototype.Type = historyitem_Math_RFontsEastAsia;
CChangesMath_RFontsEastAsia.prototype.Undo = function(Class)
{
Class.raw_SetRFontsEastAsia(this.Old);
};
CChangesMath_RFontsEastAsia.prototype.Redo = function(Class)
{
Class.raw_SetRFontsEastAsia(this.New);
};
CChangesMath_RFontsEastAsia.prototype.Save_Changes = function(Writer)
{
// Bool : IsUndefined
// String : Font
if (undefined === this.New)
{
Writer.WriteBool(true);
}
else
{
Writer.WriteBool(false);
Writer.WriteString2(this.New.Name);
}
};
CChangesMath_RFontsEastAsia.prototype.Load_Changes = function(Reader, Class)
{
// Bool : IsUndefined
// String : Font
if(true === Reader.GetBool())
this.New = undefined;
else
{
this.New =
{
Name : Reader.GetString2(),
Index : -1
};
}
this.Redo(Class);
};
function CChangesMath_RFontsHint(NewValue, OldValue)
{
this.New = NewValue;
this.Old = OldValue;
}
CChangesMath_RFontsHint.prototype.Type = historyitem_Math_RFontsHint;
CChangesMath_RFontsHint.prototype.Undo = function(Class)
{
Class.raw_SetRFontsHint(this.Old);
};
CChangesMath_RFontsHint.prototype.Redo = function(Class)
{
Class.raw_SetRFontsHint(this.New);
};
CChangesMath_RFontsHint.prototype.Save_Changes = function(Writer)
{
// Bool : IsUndefined
// String : Font
if (undefined === this.New)
{
Writer.WriteBool(true);
}
else
{
Writer.WriteBool(false);
Writer.WriteLong(this.New);
}
};
CChangesMath_RFontsHint.prototype.Load_Changes = function(Reader, Class)
{
// Bool : IsUndefined
// String : Font
if(true === Reader.GetBool())
this.New = undefined;
else
this.New = Reader.GetLong();
this.Redo(Class);
};
function CChangesMathAddItems(Pos, Items)
{
this.Pos = Pos;
......@@ -2530,4 +2763,19 @@ CChangesMathEqArrayPr.prototype.Load_Changes = function(Reader, Class)
}
this.Redo(Class);
};
function MathApplyArgSize(FontSize, argSize)
{
var ResultFontSize = FontSize;
if(argSize == -1)
{
ResultFontSize *= g_dMathArgSizeKoeff_1;
}
else if(argSize == -2)
{
ResultFontSize *= g_dMathArgSizeKoeff_2;
}
return ResultFontSize;
};
\ No newline at end of file
......@@ -1203,7 +1203,7 @@ ParaRun.prototype.Create_FontMap = function(Map, ArgSize)
FontSize = TextPr.FontSize;
if(null !== this.Parent && undefined !== this.Parent && null !== this.Parent.ParaMath && undefined !== this.Parent.ParaMath)
TextPr.FontSize = this.Parent.ParaMath.ApplyArgSize(TextPr.FontSize, ArgSize.value);
TextPr.FontSize = MathApplyArgSize(TextPr.FontSize, ArgSize.value);
}
else
TextPr = this.Get_CompiledPr(false);
......@@ -3319,26 +3319,13 @@ ParaRun.prototype.Draw_Elements = function(PDSE)
var CurTextPr = this.Get_CompiledPr( false );
pGraphics.SetTextPr( CurTextPr, Theme );
var Font;
var NewMathTextPr;
if(this.Type == para_Math_Run)
{
Y += this.size.ascent;
Font =
{
Bold : CurTextPr.Bold,
Italic : CurTextPr.Italic,
FontFamily : {Name : CurTextPr.FontFamily.Name, Index : CurTextPr.FontFamily.Index},
FontSize : this.Parent.ParaMath.ApplyArgSize(CurTextPr.FontSize, this.Parent.Compiled_ArgSz.value)
};
if(this.IsMathematicalText()) // выставляем false, чтобы не применился наклон к спец символам
{
Font.Italic = false;
Font.Bold = false;
}
pGraphics.SetFont(Font);
NewMathTextPr = GetMathModifiedFont(MathFont_ForMathText, CurTextPr, this);
pGraphics.SetTextPr( NewMathTextPr, Theme );
}
if ( undefined !== CurTextPr.Shd && shd_Nil !== CurTextPr.Shd.Value )
......@@ -3414,7 +3401,6 @@ ParaRun.prototype.Draw_Elements = function(PDSE)
if ( para_Drawing != ItemType || drawing_Anchor != Item.DrawingType )
{
Item.Draw( X, Y - this.YOffset, pGraphics );
X += Item.Get_WidthVisible();
}
......@@ -3504,28 +3490,7 @@ ParaRun.prototype.Draw_Elements = function(PDSE)
case para_Math_Text:
case para_Math_Placeholder:
{
var bChangeFont = (Item.Is_SpecilalOperator() || this.IsPlaceholder()) && !this.IsNormalText() && Font.FontFamily.Name !== "Cambria Math",
FFont = {};
// опред набор символов, если Font не Cambria Math, рисуется все равно Font Cambria Math
if(bChangeFont) // для математического текста
{
FFont.FontFamily = {Name : "Cambria Math", Index : -1};
FFont.FontSize = Font.FontSize;
FFont.Bold = false;
FFont.Italic = false;
pGraphics.SetFont(FFont);
}
Item.draw(X, Y, pGraphics );
if(bChangeFont)
{
pGraphics.SetFont(Font);
}
Item.draw(X, Y, pGraphics, NewMathTextPr);
break;
}
......@@ -3935,7 +3900,6 @@ ParaRun.prototype.Set_ParaContentPos = function(ContentPos, Depth)
Pos = 0;
this.State.ContentPos = Pos;
};
ParaRun.prototype.Get_PosByElement = function(Class, ContentPos, Depth, UseRange, Range, Line)
......@@ -4739,9 +4703,34 @@ ParaRun.prototype.Internal_Compile_Pr = function ()
return TextPr;
}
// var Styles = this.Paragraph.Parent.Get_Styles();
// this.Paragraph.Parent.Styles (rPrDefault, pPrDefault) не влияют на Font Name в мат тексте, поэтому выставляем в Default в текстовых настройках RFonts "Cambria Math" (дефолтовый Font)
//
if(!this.IsNormalText()) // math text
{
var Styles = this.Paragraph.Parent.Get_Styles();
// скопируем текстовые настройки прежде чем подменим на пустые
var StyleDefaultTextPr = Styles.Default.TextPr.Copy();
var DefaultTextPr = new CTextPr();
DefaultTextPr.RFonts.Set_All("Cambria Math", -1);
Styles.Default.TextPr = DefaultTextPr;
var StyleId = this.Paragraph.Style_Get();
var Pr = Styles.Get_Pr( StyleId, styletype_Paragraph, null, null );
TextPr.RFonts.Set_FromObject(Pr.TextPr.RFonts);
// подменяем обратно
Styles.Default.TextPr = StyleDefaultTextPr;
}
// Not Apply ArgSize !
var oWPrp = this.Parent.Get_Default_TPrp();
TextPr.Merge(oWPrp);
//var oWPrp = this.Parent.Get_Default_TPrp();
//TextPr.Merge(oWPrp);
if(this.IsPlaceholder())
{
......@@ -5178,14 +5167,12 @@ ParaRun.prototype.Apply_Pr = function(TextPr)
{
if(this.Type == para_Math_Run && !this.IsNormalText()) // при смене Font в этом случае (даже на Cambria Math) cs, eastAsia не меняются
{
// только для редактирования
// делаем так для проверки действительно ли нужно сменить Font, чтобы при смене других текстовых настроек не выставился Cambria Math (TextPr.RFonts приходит всегда в виде объекта)
if(TextPr.RFonts.Ascii !== undefined || TextPr.RFonts.HAnsi !== undefined)
{
var RFonts =
{
Ascii: {Name: "Cambria Math", Index: -1},
HAnsi: {Name: "Cambria Math", Index: -1}
};
var RFonts = new CRFonts();
RFonts.Set_All("Cambria Math", -1);
this.Set_RFonts2(RFonts);
}
......@@ -7834,7 +7821,7 @@ ParaRun.prototype.Math_Draw = function(x, y, pGraphics)
Bold : oWPrp.Bold,
Italic : oWPrp.Italic,
FontFamily : {Name : oWPrp.FontFamily.Name, Index : oWPrp.FontFamily.Index},
FontSize : this.Parent.ParaMath.ApplyArgSize(oWPrp.FontSize, this.Parent.Compiled_ArgSz.value)
FontSize : MathApplyArgSize(oWPrp.FontSize, this.Parent.Compiled_ArgSz.value)
};
if(this.IsMathematicalText()) // выставляем false, чтобы не применился наклон к спец символам
......@@ -7865,9 +7852,6 @@ ParaRun.prototype.Math_Recalculate = function(oMeasure, RPI, WidthPoints)
var RangeEndPos = this.Content.length;
//this.Paragraph = Paragraph;
//this.Parent = Parent;
// обновляем позиции start и end для Range
//this.Lines[0].Add_Range(0, RangeStartPos, RangeEndPos);
this.protected_AddRange(0, 0);
......@@ -7878,23 +7862,9 @@ ParaRun.prototype.Math_Recalculate = function(oMeasure, RPI, WidthPoints)
{
var oWPrp = this.Get_CompiledPr(false);
var Font =
{
Bold : oWPrp.Bold,
Italic : oWPrp.Italic,
FontFamily : {Name : oWPrp.FontFamily.Name, Index : oWPrp.FontFamily.Index},
FontSize : this.Parent.ParaMath.ApplyArgSize(oWPrp.FontSize, this.Parent.Compiled_ArgSz.value)
};
if(this.IsMathematicalText()) // выставляем false, чтобы не применился наклон к спец символам
{
Font.Italic = false;
Font.Bold = false;
}
g_oTextMeasurer.SetFont(Font);
var Theme = this.Paragraph.Get_Theme();
var NewMathTextPr = GetMathModifiedFont(MathFont_ForMathText, oWPrp, this);
g_oTextMeasurer.SetTextPr( NewMathTextPr, Theme );
this.bEqqArray = RPI.bEqqArray;
......@@ -7906,28 +7876,9 @@ ParaRun.prototype.Math_Recalculate = function(oMeasure, RPI, WidthPoints)
var Lng = this.Content.length;
var FontFamily;
for (var i = 0 ; i < Lng; i++)
{
var bChangeFont = (this.Content[i].Is_SpecilalOperator() || this.IsPlaceholder()) && Font.FontFamily.Name !== "Cambria Math";
if(bChangeFont)
{
FontFamily = Font.FontFamily;
Font.FontFamily = {Name : "Cambria Math", Index : -1};
g_oTextMeasurer.SetFont(Font);
}
this.Content[i].Resize(oMeasure, RPI);
if(bChangeFont)
{
Font.FontFamily = FontFamily;
g_oTextMeasurer.SetFont(Font);
}
this.Content[i].Resize(oMeasure, RPI, NewMathTextPr);
var oSize = this.Content[i].size;
......@@ -8157,6 +8108,8 @@ ParaRun.prototype.Get_RangesByPos = function(Pos)
return Ranges;
};
function CParaRunStartState(Run)
{
this.Paragraph = Run.Paragraph;
......@@ -8167,22 +8120,3 @@ function CParaRunStartState(Run)
this.Content.push(Run.Content[i]);
}
}
function AddItemToRun(Run, code)
{
var NewText = null;
var bMath = Run.Type == para_Math_Run;
if(bMath)
{
NewText = new CMathText(false);
NewText.add(code);
}
else
{
NewText = new ParaText();
NewText.Set_CharCode(code);
}
Run.Add(NewText, bMath);
}
\ No newline at end of file
......@@ -21,7 +21,6 @@ function CMathBase(bInside)
this.nRow = 0;
this.nCol = 0;
this.bInside = bInside === true ? true: false;
this.elements = [];
......@@ -44,7 +43,6 @@ function CMathBase(bInside)
bProps: true
};
this.Content = [];
this.CurPos = 0;
......@@ -134,11 +132,11 @@ CMathBase.prototype =
CompiledCtrPrp = this.Get_CompiledCtrPrp_2();
if(bAllowInline !== false && this.ParaMath)
CompiledCtrPrp.FontSize = this.ParaMath.ApplyArgSize(CompiledCtrPrp.FontSize, this.Parent.Get_CompiledArgSize().value);
CompiledCtrPrp.FontSize = MathApplyArgSize(CompiledCtrPrp.FontSize, this.Parent.Get_CompiledArgSize().value);
}
if(bAllowInline !== false && this.ParaMath)
CompiledCtrPrp.FontSize = this.ParaMath.ApplyArgSize(CompiledCtrPrp.FontSize, this.ArgSize.value);// для настроек inline формул
CompiledCtrPrp.FontSize = MathApplyArgSize(CompiledCtrPrp.FontSize, this.ArgSize.value);// для настроек inline формул
return CompiledCtrPrp;
},
......@@ -482,12 +480,12 @@ CMathBase.prototype =
{
var TxtPr = Parent.Get_TxtPrControlLetter();
FontSize = TxtPr.FontSize;
FontSize = ParaMath.ApplyArgSize(FontSize, this.ArgSize.value);
FontSize = MathApplyArgSize(FontSize, this.ArgSize.value);
}
else
{
FontSize = ParaMath.ApplyArgSize(FontSize, Parent.Get_CompiledArgSize().value);
FontSize = ParaMath.ApplyArgSize(FontSize, this.ArgSize.value);
FontSize = MathApplyArgSize(FontSize, Parent.Get_CompiledArgSize().value);
FontSize = MathApplyArgSize(FontSize, this.ArgSize.value);
}
this.TextPrControlLetter.FontSize = FontSize;
......@@ -730,6 +728,14 @@ CMathBase.prototype =
{
this.Set_DoubleStrikeout(TextPr.DStrikeout);
}
if ( undefined != TextPr.RFonts )
{
var RFonts = new CRFonts();
RFonts.Set_All("Cambria Math", -1);
this.raw_SetRFonts(RFonts);
}
}
......@@ -826,53 +832,77 @@ CMathBase.prototype =
this.raw_SetItalic(Value);
}
},
Set_RFonts_Ascii: function(Value)
{
if(this.CtrPrp.RFonts.Ascii !== Value)
{
History.Add(this, new CChangesMath_RFontsAscii(Value, this.CtrPrp.RFonts.Ascii));
this.raw_SetRFontsAscii(Value);
}
},
Set_RFonts_HAnsi: function(Value)
{
if(this.CtrPrp.RFonts.HAnsi !== Value)
{
History.Add(this, new CChangesMath_RFontsHAnsi(Value, this.CtrPrp.RFonts.HAnsi));
this.raw_SetRFontsHAnsi(Value);
}
},
Set_RFonts_CS: function(Value)
{
if(this.CtrPrp.RFonts.CS !== Value)
{
History.Add(this, new CChangesMath_RFontsCS(Value, this.CtrPrp.RFonts.CS));
this.raw_SetRFontsCS(Value);
}
},
Set_RFonts_EastAsia: function(Value)
{
if(this.CtrPrp.RFonts.EastAsia !== Value)
{
History.Add(this, new CChangesMath_RFontsEastAsia(Value, this.CtrPrp.RFonts.EastAsia));
this.raw_SetRFontsEastAsia(Value);
}
},
Set_RFonts_Hint: function(Value)
{
if(this.CtrPrp.RFonts.Hint !== Value)
{
History.Add(this, new CChangesMath_RFontsHint(Value, this.CtrPrp.RFonts.Hint));
this.raw_SetRFontsHint(Value);
}
},
raw_SetBold: function(Value)
{
this.CtrPrp.Bold = Value;
this.RecalcInfo.bCtrPrp = true;
if (null !== this.ParaMath)
this.ParaMath.SetNeedResize();
this.NeedUpdate_CtrPrp();
},
raw_SetItalic: function(Value)
{
this.CtrPrp.Italic = Value;
this.RecalcInfo.bCtrPrp = true;
if (null !== this.ParaMath)
this.ParaMath.SetNeedResize();
this.NeedUpdate_CtrPrp();
},
raw_SetUnderline : function(Value)
{
this.CtrPrp.Underline = Value;
this.RecalcInfo.bCtrPrp = true;
this.NeedUpdate_CtrPrp();
if (null !== this.ParaMath)
this.ParaMath.SetNeedResize();
},
raw_SetStrikeout: function(Value)
{
this.CtrPrp.Strikeout = Value;
this.RecalcInfo.bCtrPrp = true;
if (null !== this.ParaMath)
this.ParaMath.SetNeedResize();
this.NeedUpdate_CtrPrp();
},
raw_Set_DoubleStrikeout: function(Value)
{
this.CtrPrp.DStrikeout = Value;
this.RecalcInfo.bCtrPrp = true;
this.NeedUpdate_CtrPrp();
if (null !== this.ParaMath)
this.ParaMath.SetNeedResize();
},
raw_SetFontSize : function(Value)
{
this.CtrPrp.FontSize = Value;
this.RecalcInfo.bCtrPrp = true;
if (null !== this.ParaMath)
this.ParaMath.SetNeedResize();
this.NeedUpdate_CtrPrp();
},
raw_SetShd: function(Shd)
{
......@@ -884,28 +914,78 @@ CMathBase.prototype =
else
this.CtrPrp.Shd = undefined;
this.RecalcInfo.bCtrPrp = true;
if(null !== this.ParaMath)
this.ParaMath.SetNeedResize();
this.NeedUpdate_CtrPrp();
},
raw_SetColor: function(Value)
{
this.CtrPrp.Color = Value;
this.RecalcInfo.bCtrPrp = true;
if(null !== this.ParaMath)
this.ParaMath.SetNeedResize();
this.NeedUpdate_CtrPrp();
},
raw_SetUnifill: function(Value)
{
this.CtrPrp.Unifill = Value;
this.NeedUpdate_CtrPrp();
},
raw_SetRFonts: function(RFonts)
{
if ( undefined != RFonts )
{
if ( undefined != RFonts.Ascii )
this.Set_RFonts_Ascii( RFonts.Ascii );
if ( undefined != RFonts.HAnsi )
this.Set_RFonts_HAnsi( RFonts.HAnsi );
if ( undefined != RFonts.CS )
this.Set_RFonts_CS( RFonts.CS );
if ( undefined != RFonts.EastAsia )
this.Set_RFonts_EastAsia( RFonts.EastAsia );
if ( undefined != RFonts.Hint )
this.Set_RFonts_Hint( RFonts.Hint );
}
else
{
this.Set_RFonts_Ascii( undefined );
this.Set_RFonts_HAnsi( undefined );
this.Set_RFonts_CS( undefined );
this.Set_RFonts_EastAsia( undefined );
this.Set_RFonts_Hint( undefined );
}
},
raw_SetRFontsAscii: function(Value)
{
this.CtrPrp.RFonts.Ascii = Value;
this.NeedUpdate_CtrPrp();
},
raw_SetRFontsHAnsi: function(Value)
{
this.CtrPrp.RFonts.HAnsi = Value;
this.NeedUpdate_CtrPrp();
},
raw_SetRFontsCS: function(Value)
{
this.CtrPrp.RFonts.CS = Value;
this.NeedUpdate_CtrPrp();
},
raw_SetRFontsEastAsia: function(Value)
{
this.CtrPrp.RFonts.EastAsia = Value;
this.NeedUpdate_CtrPrp();
},
raw_SetRFontsHint: function(Value)
{
this.CtrPrp.RFonts.Hint = Value;
this.NeedUpdate_CtrPrp();
},
NeedUpdate_CtrPrp: function()
{
this.RecalcInfo.bCtrPrp = true;
if(null !== this.ParaMath)
this.ParaMath.SetNeedResize();
},
SelectToParent: function(bCorrect)
{
......
This diff is collapsed.
......@@ -215,29 +215,35 @@ CMatrixBase.prototype.recalculateSize = function(oMeasure, RPI)
if(this.nCol > 1)
{
this.setRuleGap(this.spaceColumn, this.Pr.cGpRule, this.Pr.cGp, this.Pr.cSp);
}
if(this.kind == MATH_MATRIX)
{
// выставим выравнивание для столбцов
var lng = this.Pr.mcs.length;
var col = 0;
this.alignment.wdt.length = 0;
for(var j = 0; j < lng; j++)
if(this.Pr.mcs !== undefined)
{
var mc = this.Pr.mcs[j],
count = mc.count;
var lng = this.Pr.mcs.length;
var col = 0;
this.alignment.wdt.length = 0;
for(var i = 0; i < count; i++)
for(var j = 0; j < lng; j++)
{
this.alignment.wdt[col] = mc.mcJc;
col++;
var mc = this.Pr.mcs[j],
count = mc.count;
for(var i = 0; i < count; i++)
{
this.alignment.wdt[col] = mc.mcJc;
col++;
}
}
}
}
if(this.kind == MATH_MATRIX && this.Pr.plcHide)
this.hidePlaceholder(true);
if(this.Pr.plcHide)
this.hidePlaceholder(true);
}
this.RecalcInfo.bProps = false;
}
......
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