Commit 2fa4d4ac authored by Anna.Pavlova's avatar Anna.Pavlova Committed by Alexander.Trofimov

1. Поправила баг : элементы из первого Run зажимались в нулевом Range, а сама...

1. Поправила баг : элементы из первого Run зажимались в нулевом Range, а сама формула располагается во втором Range. Соответственно элементы из первого Run отсутствовали на странице. Документ IndLeft (two pictures) (16).docx
2. Поправила зависание из-за ф-ии CheckRangesInfo (когда это происходило в нулевом Range нулевой строки, соответственно перед тем как PRS.Ranges заполнен был отрезками, Lines обнулялись и ничего  пересчитать после этого было невозможно). Документ IndLeft (two pictures) (17).docx

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64876 954022d7-b5bf-4e40-9824-e11837661b57
parent d32cf9af
...@@ -218,7 +218,6 @@ function CParaMathLineWidths() ...@@ -218,7 +218,6 @@ function CParaMathLineWidths()
this.Widths = []; this.Widths = [];
this.MaxW = 0; // without first line this.MaxW = 0; // without first line
this.PrevMaxW = 0;
this.bWordLarge = false; this.bWordLarge = false;
this.NeedUpdateWrap = true; this.NeedUpdateWrap = true;
...@@ -230,7 +229,6 @@ function CParaMathLineWidths() ...@@ -230,7 +229,6 @@ function CParaMathLineWidths()
this.Widths.length = 0; this.Widths.length = 0;
this.MaxW = 0; this.MaxW = 0;
this.PrevMaxW = 0;
this.bWordLarge = false; this.bWordLarge = false;
this.NeedUpdateWrap = true; this.NeedUpdateWrap = true;
...@@ -268,10 +266,6 @@ CParaMathLineWidths.prototype.UpdateWidth = function(Line, W) ...@@ -268,10 +266,6 @@ CParaMathLineWidths.prototype.UpdateWidth = function(Line, W)
return bUpdMaxWidth; return bUpdMaxWidth;
}; };
CParaMathLineWidths.prototype.UpdatePrevMaxWidth = function()
{
this.PrevMaxW = this.MaxW;
};
CParaMathLineWidths.prototype.SetWordLarge = function(Line, bWordLarge) CParaMathLineWidths.prototype.SetWordLarge = function(Line, bWordLarge)
{ {
if(Line >= this.Widths.length) if(Line >= this.Widths.length)
...@@ -452,10 +446,6 @@ CMathPageInfo.prototype.GetStarLinetWidth = function() ...@@ -452,10 +446,6 @@ CMathPageInfo.prototype.GetStarLinetWidth = function()
{ {
return this.WPages[0].GetFirst(); return this.WPages[0].GetFirst();
}; };
CMathPageInfo.prototype.UpdatePrevMaxWidth = function()
{
this.WPages[this.CurPage].UpdatePrevMaxWidth();
};
CMathPageInfo.prototype.UpdateCurrentWidth = function(_Line, Width) CMathPageInfo.prototype.UpdateCurrentWidth = function(_Line, Width)
{ {
var Line = this.WPages[this.CurPage].GetNumberLine(_Line - this.StartLine); var Line = this.WPages[this.CurPage].GetNumberLine(_Line - this.StartLine);
...@@ -768,6 +758,8 @@ ParaMath.prototype.Get_AlignToLine = function(_CurLine, _CurRange, _Page, _X, _X ...@@ -768,6 +758,8 @@ ParaMath.prototype.Get_AlignToLine = function(_CurLine, _CurRange, _Page, _X, _X
// отступ первой строки не учитывается для неинлайновых формул // отступ первой строки не учитывается для неинлайновых формул
var X = _X; var X = _X;
if(this.ParaMathRPI.bLeaveRecalculate == false)
{
var MathSettings = Get_WordDocumentDefaultMathSettings(); var MathSettings = Get_WordDocumentDefaultMathSettings();
var AbsolutePage = this.Paragraph == null ? 0 : this.Paragraph.Get_StartPage_Absolute(); var AbsolutePage = this.Paragraph == null ? 0 : this.Paragraph.Get_StartPage_Absolute();
...@@ -795,7 +787,7 @@ ParaMath.prototype.Get_AlignToLine = function(_CurLine, _CurRange, _Page, _X, _X ...@@ -795,7 +787,7 @@ ParaMath.prototype.Get_AlignToLine = function(_CurLine, _CurRange, _Page, _X, _X
var XStart, XEnd; var XStart, XEnd;
if(this.ParaMathRPI.bInline == false/*this.ParaMathRPI.bInternalRanges == true && this.ParaMathRPI.IntervalState == MATH_INTERVAL_ON_SIDE*/) if(this.ParaMathRPI.bInline == false)
{ {
XStart = this.ParaMathRPI.XStart; XStart = this.ParaMathRPI.XStart;
XEnd = this.ParaMathRPI.XEnd; XEnd = this.ParaMathRPI.XEnd;
...@@ -859,7 +851,7 @@ ParaMath.prototype.Get_AlignToLine = function(_CurLine, _CurRange, _Page, _X, _X ...@@ -859,7 +851,7 @@ ParaMath.prototype.Get_AlignToLine = function(_CurLine, _CurRange, _Page, _X, _X
X = XEnd - XStart > W ? XStart + wrap : XStart; X = XEnd - XStart > W ? XStart + wrap : XStart;
} }
} }
}
return X; return X;
}; };
...@@ -1266,17 +1258,11 @@ ParaMath.prototype.Recalculate_Range = function(PRS, ParaPr, Depth) ...@@ -1266,17 +1258,11 @@ ParaMath.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
this.Set_EmptyRange(PRS); this.Set_EmptyRange(PRS);
this.private_UpdateRangeY(PRS, this.ParaMathRPI.ShiftY); this.private_UpdateRangeY(PRS, this.ParaMathRPI.ShiftY);
} }
else if(false === this.ParaMathRPI.CheckRangesInfo(PRS))
{
PRS.EmptyLine = false;
PRS.RecalcResult = recalcresult_NextLine;
PRS.RestartPageRecalcInfo.Object = this;
PRS.NewRange = true;
}
else else
{ {
this.ParaMathRPI.bLeaveRecalculate = false === this.ParaMathRPI.CheckRangesInfo(PRS);
// такая ситуация возможна когда пришел пересчет заново и кол-во отрезков выравнивания 0 (либо меньше, чем нужно)
// при этом если это первый Range данной формулы, то пришел еще Reset, то есть пересчитать придется, при этом не меняем max ширину, т.к. если мы уже пересчитали с учетом Range, она не должна поменяться
this.Root.Set_Paragraph(Para); this.Root.Set_Paragraph(Para);
this.Root.Set_ParaMath(this, null); this.Root.Set_ParaMath(this, null);
...@@ -1485,7 +1471,6 @@ ParaMath.prototype.private_RecalculateRangeInsideInterval = function(PRS, ParaPr ...@@ -1485,7 +1471,6 @@ ParaMath.prototype.private_RecalculateRangeInsideInterval = function(PRS, ParaPr
this.private_UpdateXLimits(PRS); this.private_UpdateXLimits(PRS);
this.PageInfo.UpdatePrevMaxWidth();
this.private_RecalculateRoot(PRS, ParaPr, Depth); this.private_RecalculateRoot(PRS, ParaPr, Depth);
...@@ -1549,7 +1534,7 @@ ParaMath.prototype.private_RecalculateRangeWrap = function(PRS, ParaPr, Depth) ...@@ -1549,7 +1534,7 @@ ParaMath.prototype.private_RecalculateRangeWrap = function(PRS, ParaPr, Depth)
} }
this.PageInfo.UpdateCurrentWidth(PRS.Line, 0); this.PageInfo.UpdateCurrentWidth(PRS.Line, 0);
this.Root.Math_Set_EmptyRange(PRS); this.Root.Math_Set_EmptyRange(PRS.Line, PRS.Range);
PRS.bMathWordLarge = false; PRS.bMathWordLarge = false;
PRS.NewRange = true; PRS.NewRange = true;
PRS.MoveToLBP = false; PRS.MoveToLBP = false;
...@@ -1599,7 +1584,7 @@ ParaMath.prototype.Set_EmptyRange = function(PRS) ...@@ -1599,7 +1584,7 @@ ParaMath.prototype.Set_EmptyRange = function(PRS)
{ {
PRS.EmptyLine = false; PRS.EmptyLine = false;
this.Root.Math_Set_EmptyRange(PRS); this.Root.Math_Set_EmptyRange(PRS.Line, PRS.Range);
PRS.RecalcResult = recalcresult_NextLine; PRS.RecalcResult = recalcresult_NextLine;
PRS.RestartPageRecalcInfo.Object = this; PRS.RestartPageRecalcInfo.Object = this;
...@@ -1729,7 +1714,7 @@ ParaMath.prototype.UpdateWidthLine = function(PRS, Width) ...@@ -1729,7 +1714,7 @@ ParaMath.prototype.UpdateWidthLine = function(PRS, Width)
{ {
var PrevRecalcObject = PRS.RestartPageRecalcInfo.Object; var PrevRecalcObject = PRS.RestartPageRecalcInfo.Object;
if(PrevRecalcObject == null || PrevRecalcObject == this) if(PrevRecalcObject == null || PrevRecalcObject == this && this.ParaMathRPI.bLeaveRecalculate == false)
{ {
var MathSettings = Get_WordDocumentDefaultMathSettings(), var MathSettings = Get_WordDocumentDefaultMathSettings(),
Page = this.AbsolutePage + PRS.Page; Page = this.AbsolutePage + PRS.Page;
...@@ -3697,12 +3682,13 @@ function CMathRecalculateInfo() ...@@ -3697,12 +3682,13 @@ function CMathRecalculateInfo()
this.XRange = 0; this.XRange = 0;
this.XLimit = 0; this.XLimit = 0;
this.IndLeft = 0; this.IndLeft = 0;
this.bInternalRanges = false; this.bInternalRanges = false;
this.bLeaveRecalculate = false;
this.RangeY = null; // max среди нижних границ плавающих объектов this.RangeY = null; // max среди нижних границ плавающих объектов
this.ShiftY = 0; this.ShiftY = 0;
this.InfoLine = new CMathInfoLines(); this.InfoLine = new CMathInfoLines();
} }
CMathRecalculateInfo.prototype.Reset = function(PRS, ParaPr) CMathRecalculateInfo.prototype.Reset = function(PRS, ParaPr)
...@@ -3719,6 +3705,7 @@ CMathRecalculateInfo.prototype.Reset_WrapSettings = function() ...@@ -3719,6 +3705,7 @@ CMathRecalculateInfo.prototype.Reset_WrapSettings = function()
this.RangeY = null; this.RangeY = null;
this.bInternalRanges = false; this.bInternalRanges = false;
this.bLeaveRecalculate = false;
this.IntervalState = MATH_INTERVAL_EMPTY; this.IntervalState = MATH_INTERVAL_EMPTY;
this.XStart = this.XRange; this.XStart = this.XRange;
...@@ -3745,7 +3732,6 @@ CMathRecalculateInfo.prototype.CheckRangesInfo = function(PRS) ...@@ -3745,7 +3732,6 @@ CMathRecalculateInfo.prototype.CheckRangesInfo = function(PRS)
return this.InfoLine.CheckRangesInfo(PRS); return this.InfoLine.CheckRangesInfo(PRS);
}; };
function CMathInfoLines() function CMathInfoLines()
{ {
this.InfoRanges = []; this.InfoRanges = [];
......
...@@ -9440,7 +9440,6 @@ ParaRun.prototype.Recalculate_Range_OneLine = function(PRS, ParaPr, Depth) ...@@ -9440,7 +9440,6 @@ ParaRun.prototype.Recalculate_Range_OneLine = function(PRS, ParaPr, Depth)
// обновляем позиции start и end для Range // обновляем позиции start и end для Range
//this.Lines[0].Add_Range(0, RangeStartPos, RangeEndPos);
var RangeStartPos = this.protected_AddRange(CurLine, CurRange); var RangeStartPos = this.protected_AddRange(CurLine, CurRange);
var RangeEndPos = Lng; var RangeEndPos = Lng;
...@@ -9487,10 +9486,10 @@ ParaRun.prototype.Math_RecalculateContent = function(PRS) ...@@ -9487,10 +9486,10 @@ ParaRun.prototype.Math_RecalculateContent = function(PRS)
this.size.ascent = ascent; this.size.ascent = ascent;
this.size.height = ascent + descent; this.size.height = ascent + descent;
}; };
ParaRun.prototype.Math_Set_EmptyRange = function(PRS) ParaRun.prototype.Math_Set_EmptyRange = function(_CurLine, _CurRange)
{ {
var CurLine = PRS.Line - this.StartLine; var CurLine = _CurLine - this.StartLine;
var CurRange = ( 0 === CurLine ? PRS.Range - this.StartRange : PRS.Range ); var CurRange = (0 === CurLine ? _CurRange - this.StartRange : _CurRange);
var RangeStartPos = this.protected_AddRange(CurLine, CurRange); var RangeStartPos = this.protected_AddRange(CurLine, CurRange);
var RangeEndPos = RangeStartPos; var RangeEndPos = RangeStartPos;
......
...@@ -4282,17 +4282,17 @@ CMathContent.prototype.private_BoxOperEmulator = function(PRS, Box, _Depth, Prev ...@@ -4282,17 +4282,17 @@ CMathContent.prototype.private_BoxOperEmulator = function(PRS, Box, _Depth, Prev
PRS.FirstItemOnLine = false; PRS.FirstItemOnLine = false;
} }
}; };
CMathContent.prototype.Math_Set_EmptyRange = function(PRS) CMathContent.prototype.Math_Set_EmptyRange = function(_CurLine, _CurRange)
{ {
var CurLine = PRS.Line - this.StartLine; var CurLine = _CurLine - this.StartLine;
var CurRange = ( 0 === CurLine ? PRS.Range - this.StartRange : PRS.Range ); var CurRange = ( 0 === CurLine ? _CurRange - this.StartRange : _CurRange );
var RangeStartPos = this.protected_AddRange(CurLine, CurRange); var RangeStartPos = this.protected_AddRange(CurLine, CurRange);
var RangeEndPos = RangeStartPos; var RangeEndPos = RangeStartPos;
this.protected_FillRange(CurLine, CurRange, RangeStartPos, RangeEndPos); this.protected_FillRange(CurLine, CurRange, RangeStartPos, RangeEndPos);
this.Content[RangeStartPos].Math_Set_EmptyRange(PRS); this.Content[RangeStartPos].Math_Set_EmptyRange(_CurLine, _CurRange);
}; };
CMathContent.prototype.Recalculate_Reset = function(StartRange, StartLine, PRS) CMathContent.prototype.Recalculate_Reset = function(StartRange, StartLine, PRS)
{ {
...@@ -4302,6 +4302,8 @@ CMathContent.prototype.Recalculate_Reset = function(StartRange, StartLine, PRS) ...@@ -4302,6 +4302,8 @@ CMathContent.prototype.Recalculate_Reset = function(StartRange, StartLine, PRS)
this.StartLine = StartLine; this.StartLine = StartLine;
this.StartRange = StartRange; this.StartRange = StartRange;
this.Content[0].Recalculate_Reset(StartRange, StartLine, PRS);
this.protected_ClearLines(); this.protected_ClearLines();
} }
}; };
......
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