Commit 47115f37 authored by Anna Pavlova's avatar Anna Pavlova Committed by Alexander.Trofimov

Файлы с SVN : branch Math_ForcedBreak

parent 9ff89124
This diff is collapsed.
...@@ -23,7 +23,6 @@ function CMathBase(bInside) ...@@ -23,7 +23,6 @@ function CMathBase(bInside)
this.CtrPrp = new CTextPr(); this.CtrPrp = new CTextPr();
this.CompiledCtrPrp = new CTextPr(); this.CompiledCtrPrp = new CTextPr();
this.TextPrControlLetter = new CTextPr(); this.TextPrControlLetter = new CTextPr();
//this.CtrPr = new CCtrPr();
this.ArgSize = new CMathArgSize(); this.ArgSize = new CMathArgSize();
......
...@@ -85,12 +85,14 @@ CDegreeBase.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsI ...@@ -85,12 +85,14 @@ CDegreeBase.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsI
var ArgSzDegr = ArgSize.Copy(); var ArgSzDegr = ArgSize.Copy();
ArgSzDegr.Decrease(); ArgSzDegr.Decrease();
var RPIDegr = RPI.Copy();
RPIDegr.bDecreasedComp = true;
this.bNaryInline = RPI.bNaryInline; this.bNaryInline = RPI.bNaryInline;
this.iterContent.PreRecalc(this, ParaMath, ArgSzDegr, RPIDegr); var bDecreasedComp = RPI.bDecreasedComp;
RPI.bDecreasedComp = true;
this.iterContent.PreRecalc(this, ParaMath, ArgSzDegr, RPI);
RPI.bDecreasedComp = bDecreasedComp;
}; };
CDegreeBase.prototype.Resize = function(oMeasure, RPI) CDegreeBase.prototype.Resize = function(oMeasure, RPI)
{ {
...@@ -536,11 +538,13 @@ CIterators.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsIn ...@@ -536,11 +538,13 @@ CIterators.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsIn
this.Set_CompiledCtrPrp(Parent, ParaMath, RPI); this.Set_CompiledCtrPrp(Parent, ParaMath, RPI);
var RPI_ITER = RPI.Copy(); var bDecreasedComp = RPI.bDecreasedComp;
RPI_ITER.bDecreasedComp = true; RPI.bDecreasedComp = true;
this.iterUp.PreRecalc(this, ParaMath, ArgSzIters, RPI);
this.iterDn.PreRecalc(this, ParaMath, ArgSzIters, RPI);
this.iterUp.PreRecalc(this, ParaMath, ArgSzIters, RPI_ITER); RPI.bDecreasedComp = bDecreasedComp;
this.iterDn.PreRecalc(this, ParaMath, ArgSzIters, RPI_ITER);
}; };
CIterators.prototype.recalculateSize = function(oMeasure, dH, ascent) CIterators.prototype.recalculateSize = function(oMeasure, dH, ascent)
{ {
......
...@@ -303,7 +303,12 @@ CFraction.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInf ...@@ -303,7 +303,12 @@ CFraction.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInf
var ArgSzNumDen = ArgSize.Copy(); var ArgSzNumDen = ArgSize.Copy();
if(RPI.bInline == true && (this.Pr.type === BAR_FRACTION || this.Pr.type == NO_BAR_FRACTION)) // уменьшае размер числителя и знаменателя var oMathSettings = Get_WordDocumentDefaultMathSettings();
var bInlineBarFaction = RPI.bInline == true && (this.Pr.type === BAR_FRACTION || this.Pr.type == NO_BAR_FRACTION),
bReduceSize = (RPI.bSmallFraction || RPI.bDecreasedComp == true) && true == oMathSettings.Get_SmallFrac();
if(bInlineBarFaction || bReduceSize) // уменьшае размер числителя и знаменателя
{ {
ArgSzNumDen.Decrease(); // для контентов числителя и знаменателя ArgSzNumDen.Decrease(); // для контентов числителя и знаменателя
this.ArgSize.SetValue(-1); // для CtrPrp this.ArgSize.SetValue(-1); // для CtrPrp
...@@ -322,17 +327,24 @@ CFraction.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInf ...@@ -322,17 +327,24 @@ CFraction.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInf
this.ApplyProperties(RPI); this.ApplyProperties(RPI);
var NewRPI = RPI.Copy(); var bDecreasedComp = RPI.bDecreasedComp,
bSmallFraction = RPI.bSmallFraction;
if(this.Pr.type !== LINEAR_FRACTION) if(this.Pr.type !== LINEAR_FRACTION)
NewRPI.bDecreasedComp = true; RPI.bDecreasedComp = true;
RPI.bSmallFraction = true;
// setGaps обязательно после того как смержили CtrPrp (Set_CompiledCtrPrp) // setGaps обязательно после того как смержили CtrPrp (Set_CompiledCtrPrp)
if(this.bInside == false) if(this.bInside == false)
GapsInfo.setGaps(this, this.TextPrControlLetter.FontSize); GapsInfo.setGaps(this, this.TextPrControlLetter.FontSize);
this.Numerator.PreRecalc(this, ParaMath, ArgSzNumDen, NewRPI); this.Numerator.PreRecalc(this, ParaMath, ArgSzNumDen, RPI);
this.Denominator.PreRecalc(this, ParaMath, ArgSzNumDen, NewRPI); this.Denominator.PreRecalc(this, ParaMath, ArgSzNumDen, RPI);
RPI.bDecreasedComp = bDecreasedComp;
RPI.bSmallFraction = bSmallFraction;
}; };
CFraction.prototype.recalculateSize = function(oMeasure) CFraction.prototype.recalculateSize = function(oMeasure)
{ {
......
...@@ -87,10 +87,12 @@ CLimitPrimary.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, Gap ...@@ -87,10 +87,12 @@ CLimitPrimary.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, Gap
var ArgSzIter = ArgSize.Copy(); var ArgSzIter = ArgSize.Copy();
ArgSzIter.Decrease(); ArgSzIter.Decrease();
var NewRPI = RPI.Copy(); var bDecreasedComp = RPI.bDecreasedComp;
NewRPI.bDecreasedComp = true; RPI.bDecreasedComp = true;
this.Iterator.PreRecalc(this, ParaMath, ArgSzIter, NewRPI); this.Iterator.PreRecalc(this, ParaMath, ArgSzIter, RPI);
RPI.bDecreasedComp = bDecreasedComp;
}; };
CLimitPrimary.prototype.Resize = function(oMeasure, RPI) CLimitPrimary.prototype.Resize = function(oMeasure, RPI)
{ {
...@@ -343,10 +345,12 @@ CMathFunc.prototype.init = function(props) ...@@ -343,10 +345,12 @@ CMathFunc.prototype.init = function(props)
}; };
CMathFunc.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo) CMathFunc.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{ {
var NewRPI = RPI.Copy(); var bMathFunc = RPI.bMathFunc;
NewRPI.bMathFunc = true; RPI.bMathFunc = true;
CMathFunc.superclass.PreRecalc.call(this, Parent, ParaMath, ArgSize, RPI, GapsInfo);
CMathFunc.superclass.PreRecalc.call(this, Parent, ParaMath, ArgSize, NewRPI, GapsInfo); RPI.bMathFunc = bMathFunc;
}; };
CMathFunc.prototype.GetLastElement = function() CMathFunc.prototype.GetLastElement = function()
{ {
......
...@@ -10,22 +10,8 @@ function CRPI() ...@@ -10,22 +10,8 @@ function CRPI()
this.bMathFunc = false; this.bMathFunc = false;
this.bRecalcCtrPrp = false; // пересчет ctrPrp нужен, когда на Undo и тп изменился размер первого Run, а ctrPrp уже для мат объектов пересчитались this.bRecalcCtrPrp = false; // пересчет ctrPrp нужен, когда на Undo и тп изменился размер первого Run, а ctrPrp уже для мат объектов пересчитались
this.bCorrect_ConvertFontSize = false; this.bCorrect_ConvertFontSize = false;
this.bSmallFraction = false;
} }
CRPI.prototype.Copy = function()
{
var RPI = new CRPI();
RPI.bInline = this.bInline;
RPI.bDecreasedComp = this.bDecreasedComp;
RPI.bChangeInline = this.bChangeInline;
RPI.bNaryInline = this.bNaryInline;
RPI.bEqArray = this.bEqArray;
RPI.bMathFunc = this.bMathFunc;
RPI.bRecalcCtrPrp = this.bRecalcCtrPrp;
RPI.bCorrect_ConvertFontSize = this.bCorrect_ConvertFontSize;
return RPI;
};
CRPI.prototype.MergeMathInfo = function(MathInfo) CRPI.prototype.MergeMathInfo = function(MathInfo)
{ {
this.bInline = MathInfo.bInline || (MathInfo.bInternalRanges == true && MathInfo.bStartRanges == false); this.bInline = MathInfo.bInline || (MathInfo.bInternalRanges == true && MathInfo.bStartRanges == false);
...@@ -1307,10 +1293,9 @@ CMathContent.prototype.Correct_Content = function(bInnerCorrection) ...@@ -1307,10 +1293,9 @@ CMathContent.prototype.Correct_Content = function(bInnerCorrection)
{ {
bEmptyContent = false; bEmptyContent = false;
} }
} }
if(bEmptyContent) if(bEmptyContent == true && this.bRoot == false)
{ {
this.Content[0].fillPlaceholders(); this.Content[0].fillPlaceholders();
this.Content[0].Recalc_CompiledPr(true); this.Content[0].Recalc_CompiledPr(true);
...@@ -1473,7 +1458,7 @@ CMathContent.prototype.GetMathTextPrForMenu = function(ContentPos, Depth) ...@@ -1473,7 +1458,7 @@ CMathContent.prototype.GetMathTextPrForMenu = function(ContentPos, Depth)
return this.Content[pos].GetMathTextPrForMenu(ContentPos, Depth + 1); return this.Content[pos].GetMathTextPrForMenu(ContentPos, Depth + 1);
}; };
CMathContent.prototype.Apply_TextPr = function(TextPr, IncFontSize, ApplyToAll, PosForMenu) CMathContent.prototype.Apply_TextPr = function(TextPr, IncFontSize, ApplyToAll, StartPos, EndPos)
{ {
if ( true === ApplyToAll ) if ( true === ApplyToAll )
{ {
...@@ -1484,10 +1469,10 @@ CMathContent.prototype.Apply_TextPr = function(TextPr, IncFontSize, ApplyToAll, ...@@ -1484,10 +1469,10 @@ CMathContent.prototype.Apply_TextPr = function(TextPr, IncFontSize, ApplyToAll,
{ {
var StartPos, EndPos, bMenu = false; var StartPos, EndPos, bMenu = false;
if(PosForMenu !== undefined) if(StartPos !== undefined && EndPos !== undefined)
{ {
StartPos = PosForMenu.StartPos; StartPos = StartPos;
EndPos = PosForMenu.EndPos; EndPos = EndPos;
bMenu = true; bMenu = true;
} }
......
...@@ -1323,17 +1323,15 @@ CEqArray.prototype.getColsCount = function() ...@@ -1323,17 +1323,15 @@ CEqArray.prototype.getColsCount = function()
}; };
CEqArray.prototype.Resize = function(oMeasure, RPI) CEqArray.prototype.Resize = function(oMeasure, RPI)
{ {
// на случай, чтобы не затереть массив var bEqArray = RPI.bEqArray;
//var CurrAmperWPoints = RPI.AmperWPoints, RPI.bEqArray = true;
// CurrEqArray = RPI.bEqArray;
var NewRPI = RPI.Copy();
NewRPI.bEqArray = true;
for(var i = 0; i < this.nRow; i++) for(var i = 0; i < this.nRow; i++)
this.elements[i][0].Resize(oMeasure, NewRPI); this.elements[i][0].Resize(oMeasure, RPI);
this.recalculateSize(oMeasure); this.recalculateSize(oMeasure);
RPI.bEqArray = bEqArray;
}; };
CEqArray.prototype.getMetrics = function() CEqArray.prototype.getMetrics = function()
{ {
...@@ -1343,7 +1341,6 @@ CEqArray.prototype.getMetrics = function() ...@@ -1343,7 +1341,6 @@ CEqArray.prototype.getMetrics = function()
// нумерация начинается с нуля, поэтому все четные точки идут с нечетными номерами в массиве // нумерация начинается с нуля, поэтому все четные точки идут с нечетными номерами в массиве
//var lngW = RPI.Widths.length; // this.nRow
var EndWidths = 0; var EndWidths = 0;
var even, // четная точка var even, // четная точка
......
...@@ -305,12 +305,14 @@ CNary.prototype.private_GetLimLoc = function() ...@@ -305,12 +305,14 @@ CNary.prototype.private_GetLimLoc = function()
}; };
CNary.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo) CNary.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{ {
var NewRPI = RPI.Copy(); var bNaryInline = RPI.bNaryInline;
if(RPI.bInline || RPI.bDecreasedComp) if(RPI.bInline || RPI.bDecreasedComp)
NewRPI.bNaryInline = true; RPI.bNaryInline = true;
CNary.superclass.PreRecalc.call(this, Parent, ParaMath, ArgSize, NewRPI, GapsInfo); CNary.superclass.PreRecalc.call(this, Parent, ParaMath, ArgSize, RPI, GapsInfo);
RPI.bNaryInline = bNaryInline;
}; };
CNary.prototype.getSign = function(chrCode, chrType) CNary.prototype.getSign = function(chrCode, chrType)
{ {
...@@ -871,11 +873,14 @@ CNaryUnd.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI) ...@@ -871,11 +873,14 @@ CNaryUnd.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI)
var ArgSzUnd = ArgSize.Copy(); var ArgSzUnd = ArgSize.Copy();
ArgSzUnd.Decrease(); ArgSzUnd.Decrease();
var RPIUnd = RPI.Copy();
RPIUnd.bDecreasedComp = true;
this.elements[0][0].PreRecalc(this, ParaMath, ArgSzUnd, RPIUnd);
this.elements[1][0].PreRecalc(this, ParaMath, ArgSize, RPI); this.elements[1][0].PreRecalc(this, ParaMath, ArgSize, RPI);
var bDecreasedComp = RPI.bDecreasedComp;
RPI.bDecreasedComp = true;
this.elements[0][0].PreRecalc(this, ParaMath, ArgSzUnd, RPI);
RPI.bDecreasedComp = bDecreasedComp;
}; };
CNaryUnd.prototype.setBase = function(base) CNaryUnd.prototype.setBase = function(base)
{ {
...@@ -909,11 +914,14 @@ CNaryOvr.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI) ...@@ -909,11 +914,14 @@ CNaryOvr.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI)
var ArgSzOvr = ArgSize.Copy(); var ArgSzOvr = ArgSize.Copy();
ArgSzOvr.Decrease(); ArgSzOvr.Decrease();
var RPIOvr = RPI.Copy();
RPIOvr.bDecreasedComp = true;
this.elements[0][0].PreRecalc(this, ParaMath, ArgSize, RPI); this.elements[0][0].PreRecalc(this, ParaMath, ArgSize, RPI);
this.elements[1][0].PreRecalc(this, ParaMath, ArgSzOvr, RPIOvr);
var bDecreasedComp = RPI.bDecreasedComp;
RPI.bDecreasedComp = true;
this.elements[1][0].PreRecalc(this, ParaMath, ArgSzOvr, RPI);
RPI.bDecreasedComp = bDecreasedComp;
}; };
CNaryOvr.prototype.recalculateSize = function() CNaryOvr.prototype.recalculateSize = function()
{ {
...@@ -976,13 +984,16 @@ CNaryUndOvr.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI) ...@@ -976,13 +984,16 @@ CNaryUndOvr.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI)
var ArgSzIter = ArgSize.Copy(); var ArgSzIter = ArgSize.Copy();
ArgSzIter.Decrease(); ArgSzIter.Decrease();
var RPI_Iter = RPI.Copy(); this.elements[1][0].PreRecalc(this, ParaMath, ArgSize, RPI);
RPI_Iter.bDecreasedComp = true;
var bDecreasedComp = RPI.bDecreasedComp;
RPI.bDecreasedComp = true;
this.elements[0][0].PreRecalc(this, ParaMath, ArgSzIter, RPI);
this.elements[0][0].PreRecalc(this, ParaMath, ArgSzIter, RPI_Iter); this.elements[2][0].PreRecalc(this, ParaMath, ArgSzIter, RPI);
this.elements[1][0].PreRecalc(this, ParaMath, ArgSize, RPI);
this.elements[2][0].PreRecalc(this, ParaMath, ArgSzIter, RPI_Iter); RPI.bDecreasedComp = bDecreasedComp;
}; };
CNaryUndOvr.prototype.recalculateSize = function() CNaryUndOvr.prototype.recalculateSize = function()
{ {
......
...@@ -418,9 +418,16 @@ CRadical.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo ...@@ -418,9 +418,16 @@ CRadical.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo
var ArgSzIter = new CMathArgSize(); var ArgSzIter = new CMathArgSize();
ArgSzIter.SetValue(-2); ArgSzIter.SetValue(-2);
this.Iterator.PreRecalc(this, ParaMath, ArgSzIter, RPI);
this.RealBase.PreRecalc(this, ParaMath, ArgSize, RPI); this.RealBase.PreRecalc(this, ParaMath, ArgSize, RPI);
var bDecreasedComp = RPI.bDecreasedComp;
RPI.bDecreasedComp = true;
this.Iterator.PreRecalc(this, ParaMath, ArgSzIter, RPI);
RPI.bDecreasedComp = bDecreasedComp;
if(this.bInside == false) if(this.bInside == false)
GapsInfo.setGaps(this, this.TextPrControlLetter.FontSize); GapsInfo.setGaps(this, this.TextPrControlLetter.FontSize);
}; };
......
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