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 ...@@ -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() CMathBase.prototype.Selection_IsEmpty = function()
{ {
if (true !== this.Selection.Use) if (true !== this.Selection.Use)
...@@ -1797,6 +1780,7 @@ CMathBase.prototype.Recalculate_Range = function(PRS, ParaPr, Depth) ...@@ -1797,6 +1780,7 @@ CMathBase.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
var CurLine = PRS.Line - this.StartLine; var CurLine = PRS.Line - this.StartLine;
var CurRange = ( 0 === CurLine ? PRS.Range - this.StartRange : PRS.Range ); var CurRange = ( 0 === CurLine ? PRS.Range - this.StartRange : PRS.Range );
this.setDistance(); this.setDistance();
var Numb = this.NumBreakContent; var Numb = this.NumBreakContent;
......
...@@ -291,37 +291,60 @@ CDegreeBase.prototype.GetSizeSubScript = function(oMeasure, Metric) ...@@ -291,37 +291,60 @@ CDegreeBase.prototype.GetSizeSubScript = function(oMeasure, Metric)
}; };
CDegreeBase.prototype.setPosition = function(pos, PRSA, Line, Range, Page) 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) if(this.bOneLine)
{ {
this.pos.x = pos.x; this.pos.x = pos.x;
if(this.bInside === true) if(this.bInside === true)
{
this.pos.y = pos.y; this.pos.y = pos.y;
}
else else
{
this.pos.y = pos.y - this.size.ascent; 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; if(this.baseContent.Type == para_Math_Content)
var CurRange = ( 0 === CurLine ? Range - this.StartRange : Range ); PosBase.y += this.size.ascent;
if(this.bOneLine || CurLine == 0 && CurRange == 0) this.baseContent.setPosition(PosBase, PRSA, Line, Range, Page);
pos.x += this.BrGapLeft;
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;
this.baseContent.setPosition(pos, PRSA, Line, Range, Page); this.iterContent.setPosition(PosIter, PRSA, Line, Range, Page);
pos.x += this.dW; pos.x += this.size.width;
}
else
{
var Y = pos.y;
var Y = pos.y; this.baseContent.setPosition(pos, PRSA, Line, Range, Page);
pos.y += this.upIter + this.iterContent.size.ascent; pos.x += this.dW;
this.iterContent.setPosition(pos, PRSA, Line, Range, Page); pos.y += this.upIter + this.iterContent.size.ascent;
pos.x += this.BrGapRight; this.iterContent.setPosition(pos, PRSA, Line, Range, Page);
pos.y = Y; pos.x += this.BrGapRight;
pos.y = Y;
}
}; };
CDegreeBase.prototype.getIterator = function() CDegreeBase.prototype.getIterator = function()
{ {
...@@ -441,7 +464,6 @@ CDegree.prototype.setPosition = function(pos, PRSA, Line, Range, Page) ...@@ -441,7 +464,6 @@ CDegree.prototype.setPosition = function(pos, PRSA, Line, Range, Page)
{ {
CMathBase.prototype.setPosition.call(this, pos, PRSA, Line, Range, Page); CMathBase.prototype.setPosition.call(this, pos, PRSA, Line, Range, Page);
} }
}; };
function CIterators(iterUp, iterDn) function CIterators(iterUp, iterDn)
......
...@@ -130,6 +130,12 @@ function CMathPosition() ...@@ -130,6 +130,12 @@ function CMathPosition()
this.x = 0; this.x = 0;
this.y = 0; this.y = 0;
} }
CMathPosition.prototype.Set = function(Pos)
{
this.x = Pos.x;
this.y = Pos.y;
};
function AmperWidths() function AmperWidths()
{ {
this.bEven = true; // является ли текущая точка нечетной this.bEven = true; // является ли текущая точка нечетной
...@@ -4292,6 +4298,16 @@ CMathContent.prototype.IsEndLine = function(Line) ...@@ -4292,6 +4298,16 @@ CMathContent.prototype.IsEndLine = function(Line)
return CurLine == LinesCount - 1; 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() CMathContent.prototype.Get_SelectionDirection = function()
{ {
if (true !== this.Selection.Use) if (true !== this.Selection.Use)
......
...@@ -486,6 +486,9 @@ CNary.prototype.Recalculate_Range = function(PRS, ParaPr, Depth) ...@@ -486,6 +486,9 @@ CNary.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
else else
{ {
PRS.bMath_OneLine = true; 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); this.Base.Recalculate_Range(PRS, ParaPr, Depth);
} }
...@@ -539,8 +542,8 @@ CNary.prototype.Recalculate_Range_Width = function(PRSC, _CurLine, _CurRange) ...@@ -539,8 +542,8 @@ CNary.prototype.Recalculate_Range_Width = function(PRSC, _CurLine, _CurRange)
if(this.Base.IsJustDraw() == false) if(this.Base.IsJustDraw() == false)
{ {
this.Content[0].Recalculate_Range_Width(PRSC, _CurLine, _CurRange); this.LowerIterator.Recalculate_Range_Width(PRSC, _CurLine, _CurRange);
this.Content[1].Recalculate_Range_Width(PRSC, _CurLine, _CurRange); this.UpperIterator.Recalculate_Range_Width(PRSC, _CurLine, _CurRange);
this.Base.Bounds.SetWidth(CurLine, this.Base.size.width); this.Base.Bounds.SetWidth(CurLine, this.Base.size.width);
} }
...@@ -608,9 +611,8 @@ CNary.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, _CurRa ...@@ -608,9 +611,8 @@ CNary.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, _CurRa
else else
{ {
this.Base.Recalculate_LineMetrics(PRS, ParaPr, _CurLine, _CurRange); this.Base.Recalculate_LineMetrics(PRS, ParaPr, _CurLine, _CurRange);
this.Content[0].Recalculate_LineMetrics(PRS, ParaPr, _CurLine, _CurRange); this.LowerIterator.Recalculate_LineMetrics(PRS, ParaPr, _CurLine, _CurRange);
this.Content[1].Recalculate_LineMetrics(PRS, ParaPr, _CurLine, _CurRange); this.UpperIterator.Recalculate_LineMetrics(PRS, ParaPr, _CurLine, _CurRange);
this.Bounds.UpdateMetrics(CurLine, this.Base.size); this.Bounds.UpdateMetrics(CurLine, this.Base.size);
PRS.ContentMetrics.UpdateMetrics(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