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

Улучшена проверка на попадание в Select (Selection_CheckParaContentPos) для формул

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@67829 954022d7-b5bf-4e40-9824-e11837661b57
parent fe173dc4
...@@ -2852,20 +2852,18 @@ ParaMath.prototype.Get_Bounds = function() ...@@ -2852,20 +2852,18 @@ ParaMath.prototype.Get_Bounds = function()
ParaMath.prototype.Get_JointSize = function() ParaMath.prototype.Get_JointSize = function()
{ {
var W = 0, H = 0; var W = 0, H = 0;
if(this.bFirstRecalculate == true)
var _bounds = this.Get_Bounds();
for(var Line = 0; Line < _bounds.length; Line++)
{ {
var _bounds = this.Get_Bounds(); if(_bounds[Line] === undefined)
break;
for(var Line = 0; Line < _bounds.length; Line++) for(var Range = 0; Range < _bounds[Line].length; Range++)
{ {
if(_bounds[Line] == undefined) W += _bounds[Line][Range].W;
break; H += _bounds[Line][Range].H;
for(var Range = 0; Range < _bounds[Line].length; Range++)
{
W += _bounds[Line][Range].W;
H += _bounds[Line][Range].H;
}
} }
} }
......
...@@ -3749,10 +3749,27 @@ CMathContent.prototype.Selection_CheckParaContentPos = function(ContentPos, Dept ...@@ -3749,10 +3749,27 @@ CMathContent.prototype.Selection_CheckParaContentPos = function(ContentPos, Dept
{ {
var CurPos = ContentPos.Get(Depth); var CurPos = ContentPos.Get(Depth);
if (this.Selection.StartPos <= CurPos && CurPos <= this.Selection.EndPos) var bStartPos = this.Selection.StartPos,
return this.Content[CurPos].Selection_CheckParaContentPos(ContentPos, Depth + 1, bStart && this.Selection.StartPos === CurPos, bEnd && CurPos === this.Selection.EndPos); bEndPos = this.Selection.EndPos;
else if (this.Selection.EndPos <= CurPos && CurPos <= this.Selection.StartPos)
return this.Content[CurPos].Selection_CheckParaContentPos(ContentPos, Depth + 1, bStart && this.Selection.EndPos === CurPos, bEnd && CurPos === this.Selection.StartPos); if(bStartPos > bEndPos)
{
var temp = bStartPos;
bStartPos = bEndPos;
bEndPos = temp;
}
if(bStartPos < CurPos)
bStart = false;
if(CurPos < bEndPos)
bEnd = false;
if(bStart === false && bEnd === false)
return true;
else if((bStartPos <= CurPos || bStart === false) && (CurPos <= bEndPos || bEnd === false))
return this.Content[CurPos].Selection_CheckParaContentPos(ContentPos, Depth + 1, bStart, bEnd);
return false; return false;
}; };
......
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