Commit 757cb4ca authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug #33922

parent adb3f67e
......@@ -1649,6 +1649,9 @@ CParagraphContentWithParagraphLikeContent.prototype.Get_ElementByPos = function(
return this;
var CurPos = ContentPos.Get(Depth);
if (!this.Content[CurPos])
return null;
return this.Content[CurPos].Get_ElementByPos(ContentPos, Depth + 1);
};
CParagraphContentWithParagraphLikeContent.prototype.Get_PosByDrawing = function(Id, ContentPos, Depth)
......
......@@ -3561,6 +3561,8 @@ CMathContent.prototype.Get_ParaContentPos = function(bSelection, bStart, Content
else
{
var nPos = (true !== bSelection ? this.CurPos : (false !== bStart ? this.Selection.StartPos : this.Selection.EndPos));
nPos = Math.max(0, Math.min(nPos, this.Content.length - 1));
ContentPos.Add(nPos);
if (undefined !== this.Content[nPos])
......@@ -3576,17 +3578,20 @@ CMathContent.prototype.Set_ParaContentPos = function(ContentPos, Depth)
if (undefined === CurPos || CurPos < 0)
{
this.CurPos = 0;
this.Content[this.CurPos].Cursor_MoveToStartPos();
if (this.Content[this.CurPos])
this.Content[this.CurPos].Cursor_MoveToStartPos();
}
else if (CurPos > this.Content.length - 1)
{
this.CurPos = this.Content.length - 1;
this.Content[this.CurPos].Cursor_MoveToEndPos(false);
if (this.Content[this.CurPos])
this.Content[this.CurPos].Cursor_MoveToEndPos(false);
}
else
{
this.CurPos = CurPos;
this.Content[this.CurPos].Set_ParaContentPos(ContentPos, Depth + 1);
if (this.Content[this.CurPos])
this.Content[this.CurPos].Set_ParaContentPos(ContentPos, Depth + 1);
}
};
CMathContent.prototype.Selection_IsEmpty = function()
......
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