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

1. Поправила падение при удалении Nary, когда объект однострочный и у Nary есть итераторы

2. Поправила расположение для inline формул CDegree в различных ситуациях (min, Nary и т.д.)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62156 954022d7-b5bf-4e40-9824-e11837661b57
parent 1a472f4d
......@@ -1479,23 +1479,6 @@ CMathBase.prototype.Selection_DrawRange = function(_CurLine, _CurRange, Selectio
}
};
/*CMathBase.prototype.IsContentSelect = function(SelectionStartPos, SelectionEndPos, _CurLine, _CurRange)
{
var CurLine = _CurLine - this.StartLine;
var CurRange = ( 0 === CurLine ? _CurRange - this.StartRange : _CurRange );
var ContentSelect = true;
if(this.bOneLine == false)
{
var StartPos = this.protected_GetRangeStartPos(CurLine, CurRange);
var EndPos = this.protected_GetRangeEndPos(CurLine, CurRange);
ContentSelect = SelectionStartPos >= StartPos && SelectionEndPos <= EndPos;
}
return ContentSelect;
};*/
CMathBase.prototype.Selection_IsEmpty = function()
{
if (true !== this.Selection.Use)
......@@ -1797,6 +1780,7 @@ CMathBase.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
var CurLine = PRS.Line - this.StartLine;
var CurRange = ( 0 === CurLine ? PRS.Range - this.StartRange : PRS.Range );
this.setDistance();
var Numb = this.NumBreakContent;
......
......@@ -291,30 +291,52 @@ CDegreeBase.prototype.GetSizeSubScript = function(oMeasure, Metric)
};
CDegreeBase.prototype.setPosition = function(pos, PRSA, Line, Range, Page)
{
this.UpdatePosBound(pos, PRSA, Line, Range, Page);
var CurLine = Line - this.StartLine;
var CurRange = ( 0 === CurLine ? Range - this.StartRange : Range );
if(this.bOneLine || CurLine == 0 && CurRange == 0)
pos.x += this.BrGapLeft;
if(this.bOneLine)
{
this.pos.x = pos.x;
if(this.bInside === true)
{
this.pos.y = pos.y;
}
else
{
this.pos.y = pos.y - this.size.ascent;
}
this.UpdatePosBound(pos, PRSA, Line, Range, Page);
var PosBase = new CMathPosition();
PosBase.y = this.pos.y;
PosBase.x = this.pos.x;
var CurLine = Line - this.StartLine;
var CurRange = ( 0 === CurLine ? Range - this.StartRange : Range );
if(this.baseContent.Type == para_Math_Content)
PosBase.y += this.size.ascent;
if(this.bOneLine || CurLine == 0 && CurRange == 0)
pos.x += this.BrGapLeft;
this.baseContent.setPosition(PosBase, PRSA, Line, Range, Page);
this.baseContent.setPosition(pos, PRSA, Line, Range, Page);
var PosIter = new CMathPosition();
PosIter.x = this.pos.x + this.baseContent.size.width + this.dW;
PosIter.y = this.pos.y + this.size.ascent + this.upIter + this.iterContent.size.ascent;
pos.x += this.dW;
this.iterContent.setPosition(PosIter, PRSA, Line, Range, Page);
pos.x += this.size.width;
}
else
{
var Y = pos.y;
this.baseContent.setPosition(pos, PRSA, Line, Range, Page);
pos.x += this.dW;
pos.y += this.upIter + this.iterContent.size.ascent;
this.iterContent.setPosition(pos, PRSA, Line, Range, Page);
......@@ -322,6 +344,7 @@ CDegreeBase.prototype.setPosition = function(pos, PRSA, Line, Range, Page)
pos.x += this.BrGapRight;
pos.y = Y;
}
};
CDegreeBase.prototype.getIterator = function()
{
......@@ -441,7 +464,6 @@ CDegree.prototype.setPosition = function(pos, PRSA, Line, Range, Page)
{
CMathBase.prototype.setPosition.call(this, pos, PRSA, Line, Range, Page);
}
};
function CIterators(iterUp, iterDn)
......
......@@ -130,6 +130,12 @@ function CMathPosition()
this.x = 0;
this.y = 0;
}
CMathPosition.prototype.Set = function(Pos)
{
this.x = Pos.x;
this.y = Pos.y;
};
function AmperWidths()
{
this.bEven = true; // является ли текущая точка нечетной
......@@ -4292,6 +4298,16 @@ CMathContent.prototype.IsEndLine = function(Line)
return CurLine == LinesCount - 1;
};
CMathContent.prototype.IsFirstMCompInContent = function(Class)
{
var result = false;
if(this.Content[0].Type == para_Math_Run && this.Content[0].Is_Empty())
{
result = this.Content[1] == Class;
}
return result;
};
CMathContent.prototype.Get_SelectionDirection = function()
{
if (true !== this.Selection.Use)
......
......@@ -486,6 +486,9 @@ CNary.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
else
{
PRS.bMath_OneLine = true;
this.Base.Recalculate_Reset(PRS.Range, PRS.Line);
this.LowerIterator.Recalculate_Reset(PRS.Range, PRS.Line);
this.UpperIterator.Recalculate_Reset(PRS.Range, PRS.Line);
this.Base.Recalculate_Range(PRS, ParaPr, Depth);
}
......@@ -539,8 +542,8 @@ CNary.prototype.Recalculate_Range_Width = function(PRSC, _CurLine, _CurRange)
if(this.Base.IsJustDraw() == false)
{
this.Content[0].Recalculate_Range_Width(PRSC, _CurLine, _CurRange);
this.Content[1].Recalculate_Range_Width(PRSC, _CurLine, _CurRange);
this.LowerIterator.Recalculate_Range_Width(PRSC, _CurLine, _CurRange);
this.UpperIterator.Recalculate_Range_Width(PRSC, _CurLine, _CurRange);
this.Base.Bounds.SetWidth(CurLine, this.Base.size.width);
}
......@@ -608,9 +611,8 @@ CNary.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, _CurRa
else
{
this.Base.Recalculate_LineMetrics(PRS, ParaPr, _CurLine, _CurRange);
this.Content[0].Recalculate_LineMetrics(PRS, ParaPr, _CurLine, _CurRange);
this.Content[1].Recalculate_LineMetrics(PRS, ParaPr, _CurLine, _CurRange);
this.LowerIterator.Recalculate_LineMetrics(PRS, ParaPr, _CurLine, _CurRange);
this.UpperIterator.Recalculate_LineMetrics(PRS, ParaPr, _CurLine, _CurRange);
this.Bounds.UpdateMetrics(CurLine, this.Base.size);
PRS.ContentMetrics.UpdateMetrics(this.Base.size);
......
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