Commit 85d670ca authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Классы CMathContent и ParaMath тоже вышли из под гнёта EqArray. Исправлен баг...

Классы CMathContent и ParaMath тоже вышли из под гнёта EqArray. Исправлен баг с добавлением новых строк внутри формулы.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59383 954022d7-b5bf-4e40-9824-e11837661b57
parent dba14bb4
...@@ -1673,13 +1673,6 @@ ParaMath.prototype.Get_ContentSelection = function() ...@@ -1673,13 +1673,6 @@ ParaMath.prototype.Get_ContentSelection = function()
var X = oContent.pos.x + this.X; var X = oContent.pos.x + this.X;
var Y = oContent.pos.y + this.Y; var Y = oContent.pos.y + this.Y;
if(oContent.RecalcInfo.bEqqArray)
{
var PointInfo = new CMathPointInfo();
PointInfo.SetInfoPoints(oContent.InfoPoints);
X += PointInfo.GetAlign();
}
return {X : X, Y : Y, W : oContent.size.width, H : oContent.size.height}; return {X : X, Y : Y, W : oContent.size.width, H : oContent.size.height};
}; };
...@@ -1719,6 +1712,8 @@ ParaMath.prototype.Handle_AddNewLine = function() ...@@ -1719,6 +1712,8 @@ ParaMath.prototype.Handle_AddNewLine = function()
NewContent.Correct_Content(true); NewContent.Correct_Content(true);
CurrContent.Correct_Content(true); CurrContent.Correct_Content(true);
NewContent.Cursor_MoveToStartPos();
NeedRecalculate = true; NeedRecalculate = true;
} }
else if(MATH_MATRIX !== CurrContent.ParentElement.kind) else if(MATH_MATRIX !== CurrContent.ParentElement.kind)
......
...@@ -12836,8 +12836,6 @@ function CParagraphSearchPosXY() ...@@ -12836,8 +12836,6 @@ function CParagraphSearchPosXY()
this.DiffX = 1000000; // километра для ограничения должно хватить this.DiffX = 1000000; // километра для ограничения должно хватить
this.NumberingDiffX = 1000000; // километра для ограничения должно хватить this.NumberingDiffX = 1000000; // километра для ограничения должно хватить
this.EqArrayInfoPoints = null; // Специальный параметр для EqArray в формулах
this.Line = 0; this.Line = 0;
this.Range = 0; this.Range = 0;
......
...@@ -3069,13 +3069,6 @@ CMathContent.prototype.Get_Bounds = function() ...@@ -3069,13 +3069,6 @@ CMathContent.prototype.Get_Bounds = function()
Y = this.ParaMath.Y + this.pos.y; Y = this.ParaMath.Y + this.pos.y;
W = this.size.width; W = this.size.width;
H = this.size.height; H = this.size.height;
if (this.RecalcInfo.bEqqArray)
{
var PointInfo = new CMathPointInfo();
PointInfo.SetInfoPoints(this.InfoPoints);
X += PointInfo.GetAlign();
}
} }
return {X : X, Y : Y, W : W, H : H}; return {X : X, Y : Y, W : W, H : H};
...@@ -3087,14 +3080,10 @@ CMathContent.prototype.Recalculate_CurPos = function(_X, _Y, CurrentRun, _CurRan ...@@ -3087,14 +3080,10 @@ CMathContent.prototype.Recalculate_CurPos = function(_X, _Y, CurrentRun, _CurRan
if(this.RecalcInfo.bEqqArray) if(this.RecalcInfo.bEqqArray)
{ {
var PointInfo = new CMathPointInfo();
PointInfo.SetInfoPoints(this.InfoPoints);
X += PointInfo.GetAlign();
for(var nPos = 0; nPos < this.CurPos; nPos++) for(var nPos = 0; nPos < this.CurPos; nPos++)
{ {
if(para_Math_Run === this.Content[nPos].Type) if(para_Math_Run === this.Content[nPos].Type)
X = this.Content[nPos].Recalculate_CurPos(X, Y, false, _CurRange, _CurLine, _CurPage, UpdateCurPos, UpdateTarget, ReturnTarget, PointInfo).X; X = this.Content[nPos].Recalculate_CurPos(X, Y, false, _CurRange, _CurLine, _CurPage, UpdateCurPos, UpdateTarget, ReturnTarget).X;
else else
X += this.Content[nPos].size.width; X += this.Content[nPos].size.width;
} }
...@@ -3102,7 +3091,7 @@ CMathContent.prototype.Recalculate_CurPos = function(_X, _Y, CurrentRun, _CurRan ...@@ -3102,7 +3091,7 @@ CMathContent.prototype.Recalculate_CurPos = function(_X, _Y, CurrentRun, _CurRan
else else
X += this.WidthToElement[this.CurPos]; X += this.WidthToElement[this.CurPos];
return this.Content[this.CurPos].Recalculate_CurPos(X, Y, CurrentRun, _CurRange, _CurLine, _CurPage, UpdateCurPos, UpdateTarget, ReturnTarget, PointInfo); return this.Content[this.CurPos].Recalculate_CurPos(X, Y, CurrentRun, _CurRange, _CurLine, _CurPage, UpdateCurPos, UpdateTarget, ReturnTarget);
}; };
CMathContent.prototype.Get_ParaContentPosByXY = function(SearchPos, Depth, _CurLine, _CurRange, StepEnd) CMathContent.prototype.Get_ParaContentPosByXY = function(SearchPos, Depth, _CurLine, _CurRange, StepEnd)
{ {
...@@ -3111,14 +3100,6 @@ CMathContent.prototype.Get_ParaContentPosByXY = function(SearchPos, Depth, _CurL ...@@ -3111,14 +3100,6 @@ CMathContent.prototype.Get_ParaContentPosByXY = function(SearchPos, Depth, _CurL
if (nLength <= 0) if (nLength <= 0)
return false; return false;
if (this.RecalcInfo.bEqqArray)
{
SearchPos.EqArrayInfoPoints = new CMathPointInfo();
SearchPos.EqArrayInfoPoints.SetInfoPoints(this.InfoPoints);
}
else
SearchPos.EqArrayInfoPoints = null;
var bResult = false; var bResult = false;
for (var nPos = 0; nPos < nLength; nPos++) for (var nPos = 0; nPos < nLength; nPos++)
{ {
...@@ -3580,13 +3561,6 @@ CMathContent.prototype.Draw_HighLights = function(PDSH, bAll) ...@@ -3580,13 +3561,6 @@ CMathContent.prototype.Draw_HighLights = function(PDSH, bAll)
{ {
PDSH.X = this.ParaMath.X + this.pos.x; PDSH.X = this.ParaMath.X + this.pos.x;
var PointsInfo = new CMathPointInfo();
PointsInfo.SetInfoPoints(this.InfoPoints);
/*if(this.RecalcInfo.bEqqArray)
PDSH.X += PointsInfo.GetAlign();*/
var len = this.Content.length; var len = this.Content.length;
for ( var CurPos = 0; CurPos < len; CurPos++ ) for ( var CurPos = 0; CurPos < len; CurPos++ )
...@@ -3652,14 +3626,6 @@ CMathContent.prototype.Selection_DrawRange = function(_CurLine, _CurRange, Selec ...@@ -3652,14 +3626,6 @@ CMathContent.prototype.Selection_DrawRange = function(_CurLine, _CurRange, Selec
var PointsInfo = new CMathPointInfo(); var PointsInfo = new CMathPointInfo();
PointsInfo.SetInfoPoints(this.InfoPoints); PointsInfo.SetInfoPoints(this.InfoPoints);
if(this.RecalcInfo.bEqqArray)
{
if(SelectionDraw.FindStart == true)
SelectionDraw.StartX += PointsInfo.GetAlign();
else
SelectionDraw.W += PointsInfo.GetAlign();
}
var bDrawSelection = false; var bDrawSelection = false;
for(var nPos = 0, nCount = this.Content.length; nPos < nCount; nPos++) for(var nPos = 0, nCount = this.Content.length; nPos < nCount; nPos++)
{ {
......
...@@ -687,6 +687,7 @@ CEqArray.prototype.addRow = function() ...@@ -687,6 +687,7 @@ CEqArray.prototype.addRow = function()
{ {
var NewContent = new CMathContent(); var NewContent = new CMathContent();
this.protected_AddToContent(this.CurPos + 1, [NewContent], true); this.protected_AddToContent(this.CurPos + 1, [NewContent], true);
this.CurPos++;
return NewContent; return NewContent;
} }
......
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