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

1. Поправила выравнивание строк, отличных от первой (Get_AlignToLine)

2. Поправила вычисление ширины MaxW (на Recalculate_Range), теперь если Word = true, то необязательно WordLen дб равен 0, т.к. WordLen может включать GapLeft мат объекта

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62273 954022d7-b5bf-4e40-9824-e11837661b57
parent fea7e01d
......@@ -432,9 +432,6 @@ ParaMath.prototype.Add = function(Item)
};
ParaMath.prototype.Get_AlignToLine = function(_CurLine, _CurRange, Page, _X, _XLimit)
{
var CurLine = _CurLine - this.StartLine;
var CurRange = ( 0 === CurLine ? _CurRange - this.StartRange : _CurRange );
var X = _X;
var MathSettings = Get_WordDocumentDefaultMathSettings();
......@@ -452,8 +449,11 @@ ParaMath.prototype.Get_AlignToLine = function(_CurLine, _CurRange, Page, _X, _XL
var LineCount = this.Root.protected_GetLinesCount();
//if(LineCount > 0)
// WidthFirstLine = this.Root.GetWidth(_CurLine);
if(LineCount > 0)
WidthFirstLine = this.Root.GetWidth(_CurLine);
WidthFirstLine = this.Root.GetWidth(this.Root.StartLine);
var FirstWidth = CurrentPage == 0 ? WidthFirstLine : 0; // если страница не первая, то ширину первой строки формулы не учитываем
......
......@@ -2173,7 +2173,7 @@ function CParagraphRecalculateStateWrap(Para)
this.bMathWordLarge = false; // for ParaMath
this.bEndRunToContent = false;
this.PosEndRun = new CParagraphContentPos();
//this.ContentMetrics = new CMathBoundsMeasures();
}
CParagraphRecalculateStateWrap.prototype =
......
......@@ -2068,13 +2068,20 @@ ParaRun.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
}
}
if (true !== NewRange || (this.Type == para_Math_Run && this.ParaMath.Is_BrkBinBefore() == false))
if(this.Type == para_Math_Run && this.ParaMath.Is_BrkBinBefore() == false)
{
PRS.Set_LineBreakPos(Pos);
WordLen += LetterLen;
Word = true;
}
else if (true !== NewRange)
{
// Отмечаем начало нового слова
PRS.Set_LineBreakPos(Pos);
WordLen = LetterLen;
Word = true;
}
}
else
{
......
......@@ -1789,7 +1789,7 @@ CMathBase.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
var RangeStartPos = this.protected_AddRange(CurLine, CurRange),
RangeEndPos = Len - 1;
this.VerifyWordLen(PRS);
//this.VerifyWordLen(PRS);
if(CurLine == 0 && CurRange == 0)
{
......@@ -1828,9 +1828,10 @@ CMathBase.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
PRS.WordLen = WWordLen + Item.size.width;
PRS.Word = true;
if(Pos < Len - 1)
PRS.WordLen += this.dW;
}
if(PRS.NewRange == false && Pos < Len - 1)
PRS.WordLen += this.dW
}
......
......@@ -879,7 +879,7 @@ CDegreeSubSup.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
var RangeStartPos = this.protected_AddRange(CurLine, CurRange),
RangeEndPos = 0;
this.VerifyWordLen(PRS);
//this.VerifyWordLen(PRS);
if(CurLine == 0 && CurRange == 0)
{
......
......@@ -844,7 +844,6 @@ CMathContent.prototype.getGapsInside = function(GapsInfo) // учитываем
if(!checkGap.bChildGaps)
{
gaps.left = GapsInfo.getGapsMComp(this.Content[1], -1);
//gaps.left = gapsMComp.left;
}
}
......@@ -855,7 +854,6 @@ CMathContent.prototype.getGapsInside = function(GapsInfo) // учитываем
if(!checkGap.bChildGaps)
{
gaps.right = GapsInfo.getGapsMComp(this.Content[len - 2], 1);
//gaps.right = gapsMComp.right;
}
}
......@@ -3917,7 +3915,8 @@ CMathContent.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
RangeEndPos = ContentLen - 1;
}
this.InfoPoints.SetDefault();
if(this.RecalcInfo.bEqArray)
this.InfoPoints.SetDefault();
var ascent = 0, descent = 0;
this.size.width = 0;
......
......@@ -475,7 +475,7 @@ CNary.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
var RangeStartPos = this.protected_AddRange(CurLine, CurRange),
RangeEndPos = 2;
this.VerifyWordLen(PRS);
//this.VerifyWordLen(PRS);
if(CurLine == 0 && CurRange == 0)
{
......
......@@ -3451,7 +3451,7 @@ CDelimiter.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
var Content = this.Content[0];
this.VerifyWordLen(PRS);
//this.VerifyWordLen(PRS);
if(CurLine == 0 && CurRange == 0)
{
......@@ -3459,7 +3459,8 @@ CDelimiter.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
// далее будем считать объект как многостроковый на Recalculate_Range
PRS.bMath_OneLine = true;
var WordLen = PRS.WordLen;
var WordLen = PRS.WordLen,
SpaceLen = PRS.SpaceLen;
Content.Recalculate_Range(PRS, ParaPr, Depth + 1);
this.RecalculateGeneralSize(g_oTextMeasurer, Content.size.height, Content.size.ascent);
......@@ -3471,7 +3472,8 @@ CDelimiter.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
//
Content.Recalculate_Reset(PRS.Range, PRS.Line);
PRS.WordLen = WordLen + this.BrGapLeft;
PRS.WordLen = WordLen + this.BrGapLeft;
PRS.SpaceLen = SpaceLen;
}
PRS.bMath_OneLine = false;
PRS.Update_CurPos(0, Depth);
......
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