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

1. Реализовала разбивку на строки delimiters

2. Поправила баг на Get_StartRangePos2, когда внутренний контент разбивался на несколько страниц было падение
3. Переделала setPosition для класса Operator

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@61634 954022d7-b5bf-4e40-9824-e11837661b57
parent 387aadc5
...@@ -1751,7 +1751,7 @@ ParaMath.prototype.Get_StartRangePos = function(_CurLine, _CurRange, SearchPos, ...@@ -1751,7 +1751,7 @@ ParaMath.prototype.Get_StartRangePos = function(_CurLine, _CurRange, SearchPos,
}; };
ParaMath.prototype.Get_StartRangePos2 = function(_CurLine, _CurRange, ContentPos, Depth) ParaMath.prototype.Get_StartRangePos2 = function(_CurLine, _CurRange, ContentPos, Depth)
{ {
return this.Root.Get_StartRangePos(_CurLine, _CurRange, SearchPos, Depth); return this.Root.Get_StartRangePos2(_CurLine, _CurRange, ContentPos, Depth);
}; };
ParaMath.prototype.Get_StartPos = function(ContentPos, Depth) ParaMath.prototype.Get_StartPos = function(ContentPos, Depth)
......
...@@ -2168,9 +2168,11 @@ function CParagraphRecalculateStateWrap(Para) ...@@ -2168,9 +2168,11 @@ function CParagraphRecalculateStateWrap(Para)
Object : null // Объект, который вызвал пересчет Object : null // Объект, который вызвал пересчет
}; };
// for ParaMath
this.bMath_OneLine = false; // for ParaMath this.bMath_OneLine = false; // for ParaMath
this.bMathWordLarge = false; // for ParaMath this.bMathWordLarge = false; // for ParaMath
this.PosEndRun = new CParagraphContentPos(); this.PosEndRun = new CParagraphContentPos();
this.ContentMetrics = new CMathMetrics();
} }
CParagraphRecalculateStateWrap.prototype = CParagraphRecalculateStateWrap.prototype =
......
...@@ -2572,11 +2572,17 @@ ParaRun.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, _Cur ...@@ -2572,11 +2572,17 @@ ParaRun.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, _Cur
{ {
case para_Sym: case para_Sym:
case para_Text: case para_Text:
case para_PageNum:
{
UpdateLineMetricsText = true;
break;
}
case para_Math_Text: case para_Math_Text:
case para_Math_Placeholder: case para_Math_Placeholder:
case para_Math_BreakOperator: case para_Math_BreakOperator:
case para_PageNum:
{ {
PRS.ContentMetrics.UpdateMetrics(Item.size);
UpdateLineMetricsText = true; UpdateLineMetricsText = true;
break; break;
} }
...@@ -8536,6 +8542,15 @@ ParaRun.prototype.Math_Get_EndRangePos = function(bEndLine, _CurLine, _CurRange, ...@@ -8536,6 +8542,15 @@ ParaRun.prototype.Math_Get_EndRangePos = function(bEndLine, _CurLine, _CurRange,
return Result; return Result;
}; };
ParaRun.prototype.Math_Is_End = function(_CurLine, _CurRange)
{
var CurLine = _CurLine - this.StartLine;
var CurRange = ( 0 === CurLine ? _CurRange - this.StartRange : _CurRange );
var EndPos = this.protected_GetRangeEndPos(CurLine, CurRange);
return EndPos == this.Content.length;
};
ParaRun.prototype.Recalculate_Range_OneLine = function(PRS, ParaPr, Depth) ParaRun.prototype.Recalculate_Range_OneLine = function(PRS, ParaPr, Depth)
{ {
// данная функция используется только для мат объектов, которые на строки не разбиваются // данная функция используется только для мат объектов, которые на строки не разбиваются
......
This diff is collapsed.
...@@ -678,6 +678,8 @@ function CMathContent() ...@@ -678,6 +678,8 @@ function CMathContent()
this.InfoPoints = new CInfoPoints(); this.InfoPoints = new CInfoPoints();
/////////////// ///////////////
this.LineMetrics = new CMathLineMetrics();
this.plhHide = false; this.plhHide = false;
this.bRoot = false; this.bRoot = false;
this.bOneLine = false; this.bOneLine = false;
...@@ -4135,6 +4137,35 @@ CMathContent.prototype.Recalculate_Range = function(PRS, ParaPr, Depth) ...@@ -4135,6 +4137,35 @@ CMathContent.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
this.protected_FillRange(CurLine, CurRange, RangeStartPos, RangeEndPos); this.protected_FillRange(CurLine, CurRange, RangeStartPos, RangeEndPos);
}; };
CMathContent.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, _CurRange)
{
var CurLine = _CurLine - this.StartLine;
var CurRange = (0 === CurLine ? _CurRange - this.StartRange : _CurRange);
var StartPos = this.protected_GetRangeStartPos(CurLine, CurRange);
var EndPos = this.protected_GetRangeEndPos(CurLine, CurRange);
if(CurLine == 0 && CurRange == 0)
{
this.LineMetrics.Reset();
}
var ParentContentMetric = PRS.ContentMetrics;
PRS.ContentMetrics = new CMathMetrics();
for(var Pos = StartPos; Pos <= EndPos; Pos++)
{
var Item = this.Content[Pos];
Item.Recalculate_LineMetrics(PRS, ParaPr, _CurLine, _CurRange);
}
this.LineMetrics.UpdateMetrics(CurLine, PRS.ContentMetrics);
ParentContentMetric.UpdateMetrics(PRS.ContentMetrics);
PRS.ContentMetrics = ParentContentMetric;
};
CMathContent.prototype.Get_StartRangePos = function(_CurLine, _CurRange, SearchPos, Depth) CMathContent.prototype.Get_StartRangePos = function(_CurLine, _CurRange, SearchPos, Depth)
{ {
var CurLine = _CurLine - this.StartLine; var CurLine = _CurLine - this.StartLine;
...@@ -4173,7 +4204,6 @@ CMathContent.prototype.Get_StartRangePos = function(_CurLine, _CurRange, SearchP ...@@ -4173,7 +4204,6 @@ CMathContent.prototype.Get_StartRangePos = function(_CurLine, _CurRange, SearchP
if ( true === Result ) if ( true === Result )
SearchPos.Pos.Update(StartPos, Depth ); SearchPos.Pos.Update(StartPos, Depth );
} }
return Result; return Result;
...@@ -4220,6 +4250,24 @@ CMathContent.prototype.Get_EndRangePos = function(_CurLine, _CurRange, SearchPos ...@@ -4220,6 +4250,24 @@ CMathContent.prototype.Get_EndRangePos = function(_CurLine, _CurRange, SearchPos
return Result; return Result;
}; };
CMathContent.prototype.Math_Is_End = function(_CurLine, _CurRange)
{
var CurLine = _CurLine - this.StartLine;
var CurRange = ( 0 === CurLine ? _CurRange - this.StartRange : _CurRange );
var EndPos = this.protected_GetRangeEndPos(CurLine, CurRange);
var Len = this.Content.length;
var result = false;
if(EndPos == Len - 1)
{
result = this.Content[Len - 1].Math_Is_End(_CurLine, _CurRange);
}
return result;
};
CMathContent.prototype.IsFirstLine = function(Line) CMathContent.prototype.IsFirstLine = function(Line)
{ {
var CurLine = Line - this.StartLine; var CurLine = Line - this.StartLine;
......
This diff is collapsed.
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