Commit 6d63beed authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug with empty selection inside a footnotes.

parent 64b42a90
......@@ -2427,17 +2427,29 @@ CFootnotesController.prototype.GetSelectionBounds = function()
}
else if (1 === this.Selection.Direction)
{
var StartBounds = this.Selection.Start.Footnote.Get_SelectionBounds();
var EndBounds = this.Selection.End.Footnote.Get_SelectionBounds();
if (!StartBounds && !EndBounds)
return null;
var Result = {};
Result.Start = this.Selection.Start.Footnote.Get_SelectionBounds().Start;
Result.End = this.Selection.End.Footnote.Get_SelectionBounds().End;
Result.Start = StartBounds ? StartBounds.Start : EndBounds.Start;
Result.End = EndBounds ? EndBounds.End : StartBounds.End;
Result.Direction = 1;
return Result;
}
else
{
var StartBounds = this.Selection.End.Footnote.Get_SelectionBounds();
var EndBounds = this.Selection.Start.Footnote.Get_SelectionBounds();
if (!StartBounds && !EndBounds)
return null;
var Result = {};
Result.Start = this.Selection.End.Footnote.Get_SelectionBounds().Start;
Result.End = this.Selection.Start.Footnote.Get_SelectionBounds().End;
Result.Start = StartBounds ? StartBounds.Start : EndBounds.Start;
Result.End = EndBounds ? EndBounds.End : StartBounds.End;
Result.Direction = -1;
return Result;
}
......
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