Commit 906a46a0 authored by Ilya Kirillov's avatar Ilya Kirillov

Changes for all math classes were replaced with a new classes.

parent 9d56cf52
...@@ -96,6 +96,7 @@ ...@@ -96,6 +96,7 @@
"../word/Editor/Run.js", "../word/Editor/Run.js",
"../word/Editor/RunChanges.js", "../word/Editor/RunChanges.js",
"../word/Editor/Math.js", "../word/Editor/Math.js",
"../word/Editor/MathChanges.js",
"../word/Editor/Paragraph.js", "../word/Editor/Paragraph.js",
"../word/Editor/ParagraphChanges.js", "../word/Editor/ParagraphChanges.js",
"../word/Editor/Paragraph_Recalculate.js", "../word/Editor/Paragraph_Recalculate.js",
......
...@@ -145,6 +145,7 @@ ...@@ -145,6 +145,7 @@
"../word/Editor/Run.js", "../word/Editor/Run.js",
"../word/Editor/RunChanges.js", "../word/Editor/RunChanges.js",
"../word/Editor/Math.js", "../word/Editor/Math.js",
"../word/Editor/MathChanges.js",
"../word/Editor/Paragraph.js", "../word/Editor/Paragraph.js",
"../word/Editor/ParagraphChanges.js", "../word/Editor/ParagraphChanges.js",
"../word/Editor/Paragraph_Recalculate.js", "../word/Editor/Paragraph_Recalculate.js",
......
...@@ -167,6 +167,7 @@ ...@@ -167,6 +167,7 @@
"../word/Editor/HeaderFooterController.js", "../word/Editor/HeaderFooterController.js",
"../word/Editor/HeaderFooter.js", "../word/Editor/HeaderFooter.js",
"../word/Editor/Math.js", "../word/Editor/Math.js",
"../word/Editor/MathChanges.js",
"../word/Editor/Spelling.js", "../word/Editor/Spelling.js",
"../word/Editor/Footnotes.js", "../word/Editor/Footnotes.js",
"../word/Editor/FootEndNote.js", "../word/Editor/FootEndNote.js",
......
...@@ -118,6 +118,7 @@ ...@@ -118,6 +118,7 @@
"../word/Editor/Run.js", "../word/Editor/Run.js",
"../word/Editor/RunChanges.js", "../word/Editor/RunChanges.js",
"../word/Editor/Math.js", "../word/Editor/Math.js",
"../word/Editor/MathChanges.js",
"../word/Editor/Paragraph.js", "../word/Editor/Paragraph.js",
"../word/Editor/ParagraphChanges.js", "../word/Editor/ParagraphChanges.js",
"../word/Editor/Paragraph_Recalculate.js", "../word/Editor/Paragraph_Recalculate.js",
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -466,56 +466,61 @@ CBorderBox.prototype.setPosition = function(pos, PosInfo) ...@@ -466,56 +466,61 @@ CBorderBox.prototype.setPosition = function(pos, PosInfo)
}; };
CBorderBox.prototype.Apply_MenuProps = function(Props) CBorderBox.prototype.Apply_MenuProps = function(Props)
{ {
if(Props.Type == Asc.c_oAscMathInterfaceType.BorderBox) if (Props.Type == Asc.c_oAscMathInterfaceType.BorderBox)
{ {
if(Props.HideTop !== undefined && Props.HideTop !== this.Pr.hideTop) if (Props.HideTop !== undefined && Props.HideTop !== this.Pr.hideTop)
{ {
History.Add(this, new CChangesMathBorderBoxTop(Props.HideTop, this.Pr.hideTop)); History.Add(new CChangesMathBorderBoxTop(this, this.Pr.hideTop, Props.HideTop));
this.raw_SetTop(Props.HideTop); this.raw_SetTop(Props.HideTop);
} }
if(Props.HideBottom !== undefined && Props.HideBottom !== this.Pr.hideBot) if (Props.HideBottom !== undefined && Props.HideBottom !== this.Pr.hideBot)
{ {
History.Add(this, new CChangesMathBorderBoxBot(Props.HideBottom, this.Pr.hideBot)); History.Add(new CChangesMathBorderBoxBot(this, this.Pr.hideBot, Props.HideBottom));
this.raw_SetBot(Props.HideBottom); this.raw_SetBot(Props.HideBottom);
} }
if(Props.HideLeft !== undefined && Props.HideLeft !== this.Pr.hideLeft) if (Props.HideLeft !== undefined && Props.HideLeft !== this.Pr.hideLeft)
{ {
History.Add(this, new CChangesMathBorderBoxLeft(Props.HideLeft, this.Pr.hideLeft)); History.Add(new CChangesMathBorderBoxLeft(this, this.Pr.hideLeft, Props.HideLeft));
this.raw_SetLeft(Props.HideLeft); this.raw_SetLeft(Props.HideLeft);
} }
if(Props.HideRight !== undefined && Props.HideRight !== this.Pr.hideRight) if (Props.HideRight !== undefined && Props.HideRight !== this.Pr.hideRight)
{ {
History.Add(this, new CChangesMathBorderBoxRight(Props.HideRight, this.Pr.hideRight)); History.Add(new CChangesMathBorderBoxRight(this, this.Pr.hideRight, Props.HideRight));
this.raw_SetRight(Props.HideRight); this.raw_SetRight(Props.HideRight);
} }
if(Props.HideHor !== undefined && Props.HideHor == this.Pr.strikeH) // strikeH - нарисовать горизонтальную линию if (Props.HideHor !== undefined && Props.HideHor == this.Pr.strikeH) // strikeH - нарисовать горизонтальную линию
{ {
History.Add(this, new CChangesMathBorderBoxHor(!Props.HideHor, this.Pr.strikeH)); History.Add(new CChangesMathBorderBoxHor(this, this.Pr.strikeH, !Props.HideHor));
this.raw_SetHor(!Props.HideHor); this.raw_SetHor(!Props.HideHor);
} }
if(Props.HideVer !== undefined && Props.HideVer == this.Pr.strikeV) // strikeV - нарисовать вертикальную линию if (Props.HideVer !== undefined && Props.HideVer == this.Pr.strikeV) // strikeV - нарисовать вертикальную линию
{ {
History.Add(this, new CChangesMathBorderBoxVer(!Props.HideVer, this.Pr.strikeV)); History.Add(new CChangesMathBorderBoxVer(this, this.Pr.strikeV, !Props.HideVer));
this.raw_SetVer(!Props.HideVer); this.raw_SetVer(!Props.HideVer);
} }
if(Props.HideTopLTR !== undefined && Props.HideTopLTR == this.Pr.strikeTLBR) // strikeTLBR - нарисовать диагональ из верхнего угла слева направо if (Props.HideTopLTR !== undefined && Props.HideTopLTR == this.Pr.strikeTLBR) // strikeTLBR - нарисовать диагональ из
{ // верхнего угла слева направо
History.Add(this, new CChangesMathBorderBoxTopLTR(!Props.HideTopLTR, this.Pr.strikeTLBR)); {
this.raw_SetTopLTR(!Props.HideTopLTR ); History.Add(new CChangesMathBorderBoxTopLTR(this, this.Pr.strikeTLBR, !Props.HideTopLTR));
} this.raw_SetTopLTR(!Props.HideTopLTR);
}
if(Props.HideTopRTL !== undefined && Props.HideTopRTL == this.Pr.strikeBLTR)
{ if (Props.HideTopRTL !== undefined && Props.HideTopRTL == this.Pr.strikeBLTR)
History.Add(this, new CChangesMathBorderBoxTopRTL(!Props.HideTopRTL, this.Pr.strikeBLTR)); // strikeBLTR - нарисовать диагональ из нижнего угла слева направо {
this.raw_SetTopRTL(!Props.HideTopRTL); History.Add(new CChangesMathBorderBoxTopRTL(this, this.Pr.strikeBLTR, !Props.HideTopRTL)); // strikeBLTR -
} // нарисовать
} // диагональ из
// нижнего угла
// слева направо
this.raw_SetTopRTL(!Props.HideTopRTL);
}
}
}; };
CBorderBox.prototype.raw_SetTop = function(Value) CBorderBox.prototype.raw_SetTop = function(Value)
{ {
...@@ -842,24 +847,24 @@ CBox.prototype.Get_AlignBrk = function() ...@@ -842,24 +847,24 @@ CBox.prototype.Get_AlignBrk = function()
}; };
CBox.prototype.Displace_BreakOperator = function(isForward, bBrkBefore, CountOperators) CBox.prototype.Displace_BreakOperator = function(isForward, bBrkBefore, CountOperators)
{ {
if(this.Pr.brk !== undefined) if (this.Pr.brk !== undefined)
{ {
var AlnAt = this.Pr.Get_AlnAt(); var AlnAt = this.Pr.Get_AlnAt();
var NotIncrease = AlnAt == CountOperators && isForward == true; var NotIncrease = AlnAt == CountOperators && isForward == true;
if(NotIncrease == false) if (NotIncrease == false)
{ {
this.Pr.Displace_Break(isForward); this.Pr.Displace_Break(isForward);
var NewAlnAt = this.Pr.Get_AlnAt(); var NewAlnAt = this.Pr.Get_AlnAt();
if(AlnAt !== NewAlnAt) if (AlnAt !== NewAlnAt)
{ {
History.Add(this, new CChangesMathBoxAlnAt(NewAlnAt, AlnAt)); History.Add(new CChangesMathBoxAlnAt(this, AlnAt, NewAlnAt));
} }
} }
} }
}; };
CBox.prototype.raw_setAlnAt = function(Value) CBox.prototype.raw_setAlnAt = function(Value)
{ {
...@@ -876,14 +881,13 @@ CBox.prototype.Apply_MenuProps = function(Props) ...@@ -876,14 +881,13 @@ CBox.prototype.Apply_MenuProps = function(Props)
if(Props.Action & c_oMathMenuAction.InsertForcedBreak && true == this.Can_InsertForcedBreak()) if(Props.Action & c_oMathMenuAction.InsertForcedBreak && true == this.Can_InsertForcedBreak())
{ {
History.Add(this, new CChangesMathBoxForcedBreak(true, false)); History.Add(new CChangesMathBoxForcedBreak(this, false, true));
this.raw_ForcedBreak(true); this.raw_ForcedBreak(true);
} }
if(Props.Action & c_oMathMenuAction.DeleteForcedBreak && true == this.Can_DeleteForcedBreak()) if(Props.Action & c_oMathMenuAction.DeleteForcedBreak && true == this.Can_DeleteForcedBreak())
{ {
var AlnAt = this.Pr.Get_AlnAt(); History.Add(new CChangesMathBoxForcedBreak(this, true, false));
History.Add(this, new CChangesMathBoxForcedBreak(false, true, AlnAt));
this.raw_ForcedBreak(false); this.raw_ForcedBreak(false);
} }
}; };
...@@ -1052,16 +1056,16 @@ CBar.prototype.getAscent = function() ...@@ -1052,16 +1056,16 @@ CBar.prototype.getAscent = function()
}; };
CBar.prototype.Apply_MenuProps = function(Props) CBar.prototype.Apply_MenuProps = function(Props)
{ {
if(Props.Type == Asc.c_oAscMathInterfaceType.Bar && Props.Pos !== undefined) if (Props.Type == Asc.c_oAscMathInterfaceType.Bar && Props.Pos !== undefined)
{ {
var Pos = Props.Pos == Asc.c_oAscMathInterfaceBarPos.Bottom ? LOCATION_BOT : LOCATION_TOP; var Pos = Props.Pos == Asc.c_oAscMathInterfaceBarPos.Bottom ? LOCATION_BOT : LOCATION_TOP;
if(Pos !== this.Pr.pos) if (Pos !== this.Pr.pos)
{ {
History.Add(this, new CChangesMathBarLinePos(Pos, this.Pr.pos)); History.Add(new CChangesMathBarLinePos(this, this.Pr.pos, Pos));
this.raw_SetLinePos(Pos); this.raw_SetLinePos(Pos);
} }
} }
}; };
CBar.prototype.Get_InterfaceProps = function() CBar.prototype.Get_InterfaceProps = function()
{ {
......
...@@ -1161,20 +1161,20 @@ CDegreeSubSup.prototype.protected_GetRangeEndPos = function(CurLine, CurRange) ...@@ -1161,20 +1161,20 @@ CDegreeSubSup.prototype.protected_GetRangeEndPos = function(CurLine, CurRange)
}; };
CDegreeSubSup.prototype.Apply_MenuProps = function(Props) CDegreeSubSup.prototype.Apply_MenuProps = function(Props)
{ {
if(Props.Type == Asc.c_oAscMathInterfaceType.Script) if (Props.Type == Asc.c_oAscMathInterfaceType.Script)
{ {
if(Props.ScriptType == Asc.c_oAscMathInterfaceScript.PreSubSup && this.Pr.type == DEGREE_SubSup) if (Props.ScriptType == Asc.c_oAscMathInterfaceScript.PreSubSup && this.Pr.type == DEGREE_SubSup)
{ {
AscCommon.History.Add(this, new CChangesMathDegreeSubSupType(DEGREE_PreSubSup, this.Pr.type)); AscCommon.History.Add(new CChangesMathDegreeSubSupType(this, this.Pr.type, DEGREE_PreSubSup));
this.raw_SetType(DEGREE_PreSubSup); this.raw_SetType(DEGREE_PreSubSup);
} }
if(Props.ScriptType == Asc.c_oAscMathInterfaceScript.SubSup && this.Pr.type == DEGREE_PreSubSup) if (Props.ScriptType == Asc.c_oAscMathInterfaceScript.SubSup && this.Pr.type == DEGREE_PreSubSup)
{ {
AscCommon.History.Add(this, new CChangesMathDegreeSubSupType(DEGREE_SubSup, this.Pr.type)); AscCommon.History.Add(new CChangesMathDegreeSubSupType(this, this.Pr.type, DEGREE_SubSup));
this.raw_SetType(DEGREE_SubSup); this.raw_SetType(DEGREE_SubSup);
} }
} }
}; };
CDegreeSubSup.prototype.raw_SetType = function(type) CDegreeSubSup.prototype.raw_SetType = function(type)
{ {
......
...@@ -577,32 +577,32 @@ CFraction.prototype.fillContent = function() ...@@ -577,32 +577,32 @@ CFraction.prototype.fillContent = function()
}; };
CFraction.prototype.Apply_MenuProps = function(Props) CFraction.prototype.Apply_MenuProps = function(Props)
{ {
if(Props.Type == Asc.c_oAscMathInterfaceType.Fraction && Props.FractionType !== undefined) if (Props.Type == Asc.c_oAscMathInterfaceType.Fraction && Props.FractionType !== undefined)
{ {
var FractionType = this.Pr.type; var FractionType = this.Pr.type;
switch (Props.FractionType) switch (Props.FractionType)
{ {
case Asc.c_oAscMathInterfaceFraction.Bar: case Asc.c_oAscMathInterfaceFraction.Bar:
FractionType = BAR_FRACTION; FractionType = BAR_FRACTION;
break; break;
case Asc.c_oAscMathInterfaceFraction.Skewed: case Asc.c_oAscMathInterfaceFraction.Skewed:
FractionType = SKEWED_FRACTION; FractionType = SKEWED_FRACTION;
break; break;
case Asc.c_oAscMathInterfaceFraction.Linear: case Asc.c_oAscMathInterfaceFraction.Linear:
FractionType = LINEAR_FRACTION; FractionType = LINEAR_FRACTION;
break; break;
case Asc.c_oAscMathInterfaceFraction.NoBar: case Asc.c_oAscMathInterfaceFraction.NoBar:
FractionType = NO_BAR_FRACTION; FractionType = NO_BAR_FRACTION;
break; break;
} }
if(FractionType !== this.Pr.type) if (FractionType !== this.Pr.type)
{ {
AscCommon.History.Add(this, new CChangesMathFractionType(FractionType, this.Pr.type)); AscCommon.History.Add(new CChangesMathFractionType(this, this.Pr.type, FractionType));
this.raw_SetFractionType(FractionType); this.raw_SetFractionType(FractionType);
} }
} }
}; };
CFraction.prototype.Get_InterfaceProps = function() CFraction.prototype.Get_InterfaceProps = function()
{ {
......
...@@ -285,16 +285,16 @@ CLimit.prototype.ApplyProperties = function(RPI) ...@@ -285,16 +285,16 @@ CLimit.prototype.ApplyProperties = function(RPI)
}; };
CLimit.prototype.Apply_MenuProps = function(Props) CLimit.prototype.Apply_MenuProps = function(Props)
{ {
if(Props.Type == Asc.c_oAscMathInterfaceType.Limit && Props.Pos !== undefined) if (Props.Type == Asc.c_oAscMathInterfaceType.Limit && Props.Pos !== undefined)
{ {
var Type = Props.Pos == Asc.c_oAscMathInterfaceLimitPos.Bottom ? LIMIT_LOW : LIMIT_UP; var Type = Props.Pos == Asc.c_oAscMathInterfaceLimitPos.Bottom ? LIMIT_LOW : LIMIT_UP;
if(this.Pr.type !== Type) if (this.Pr.type !== Type)
{ {
AscCommon.History.Add(this, new CChangesMathLimitType(Type, this.Pr.type)); AscCommon.History.Add(new CChangesMathLimitType(this, this.Pr.type, Type));
this.raw_SetType(Type); this.raw_SetType(Type);
} }
} }
}; };
CLimit.prototype.Get_InterfaceProps = function() CLimit.prototype.Get_InterfaceProps = function()
{ {
......
This diff is collapsed.
This diff is collapsed.
...@@ -494,27 +494,27 @@ CNary.prototype.getSubMathContent = function() ...@@ -494,27 +494,27 @@ CNary.prototype.getSubMathContent = function()
}; };
CNary.prototype.Apply_MenuProps = function(Props) CNary.prototype.Apply_MenuProps = function(Props)
{ {
if(Props.Type == Asc.c_oAscMathInterfaceType.LargeOperator) if (Props.Type == Asc.c_oAscMathInterfaceType.LargeOperator)
{ {
if(Props.LimLoc !== undefined && false == this.ParaMath.Is_Inline() && this.Pr.limLoc !== Props.LimLoc) if (Props.LimLoc !== undefined && false == this.ParaMath.Is_Inline() && this.Pr.limLoc !== Props.LimLoc)
{ {
var LimLoc = Props.LimLoc == Asc.c_oAscMathInterfaceNaryLimitLocation.SubSup ? NARY_SubSup : NARY_UndOvr; var LimLoc = Props.LimLoc == Asc.c_oAscMathInterfaceNaryLimitLocation.SubSup ? NARY_SubSup : NARY_UndOvr;
AscCommon.History.Add(this, new CChangesMathNaryLimLoc(LimLoc, this.Pr.limLoc)); AscCommon.History.Add(new CChangesMathNaryLimLoc(this, this.Pr.limLoc, LimLoc));
this.raw_SetLimLoc(LimLoc); this.raw_SetLimLoc(LimLoc);
} }
if(Props.HideUpper !== undefined && Props.HideUpper !== this.Pr.supHide) if (Props.HideUpper !== undefined && Props.HideUpper !== this.Pr.supHide)
{ {
AscCommon.History.Add(this, new CChangesMathNaryUpperLimit(!this.Pr.supHide, this.Pr.supHide)); AscCommon.History.Add(new CChangesMathNaryUpperLimit(this, this.Pr.supHide, !this.Pr.supHide));
this.raw_HideUpperIterator(!this.Pr.supHide); this.raw_HideUpperIterator(!this.Pr.supHide);
} }
if(Props.HideLower !== undefined && Props.HideLower !== this.Pr.subHide) if (Props.HideLower !== undefined && Props.HideLower !== this.Pr.subHide)
{ {
AscCommon.History.Add(this, new CChangesMathNaryLowerLimit(!this.Pr.subHide, this.Pr.subHide)); AscCommon.History.Add(new CChangesMathNaryLowerLimit(this, this.Pr.subHide, !this.Pr.subHide));
this.raw_HideLowerIterator(!this.Pr.subHide); this.raw_HideLowerIterator(!this.Pr.subHide);
} }
} }
}; };
CNary.prototype.Get_InterfaceProps = function() CNary.prototype.Get_InterfaceProps = function()
{ {
......
This diff is collapsed.
...@@ -719,14 +719,14 @@ CRadical.prototype.Apply_TextPr = function(TextPr, IncFontSize, ApplyToAll) ...@@ -719,14 +719,14 @@ CRadical.prototype.Apply_TextPr = function(TextPr, IncFontSize, ApplyToAll)
}; };
CRadical.prototype.Apply_MenuProps = function(Props) CRadical.prototype.Apply_MenuProps = function(Props)
{ {
if(Props.Type == Asc.c_oAscMathInterfaceType.Radical && Props.HideDegree !== undefined) if (Props.Type == Asc.c_oAscMathInterfaceType.Radical && Props.HideDegree !== undefined)
{ {
if(true == this.Iterator.IsPlaceholder() && Props.HideDegree !== this.Pr.degHide) if (true == this.Iterator.IsPlaceholder() && Props.HideDegree !== this.Pr.degHide)
{ {
AscCommon.History.Add(this, new CChangesMathRadicalHideDegree( Props.HideDegree, this.Pr.degHide )); AscCommon.History.Add(new CChangesMathRadicalHideDegree(this, this.Pr.degHide, Props.HideDegree));
this.raw_SetHideDegree(Props.HideDegree); this.raw_SetHideDegree(Props.HideDegree);
} }
} }
}; };
CRadical.prototype.Get_InterfaceProps = function() CRadical.prototype.Get_InterfaceProps = function()
{ {
......
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