Commit 2fa3339e authored by Ilya Kirillov's avatar Ilya Kirillov Committed by GitHub

Merge pull request #83 from ONLYOFFICE/release/v4.2.0

Fixed bug with deleting the last row in a table.
parents 445c60ba d47c652c
......@@ -6629,25 +6629,32 @@ CTable.prototype =
Selection_Remove : function()
{
if ( false === this.Selection.Use )
if (false === this.Selection.Use)
return;
if ( table_Selection_Text === this.Selection.Type )
if (this.Content.length <= 0)
{
this.CurCell = null;
}
else
{
if (table_Selection_Text === this.Selection.Type)
{
this.CurCell = this.Content[this.Selection.StartPos.Pos.Row].Get_Cell(this.Selection.StartPos.Pos.Cell);
this.CurCell.Content.Selection_Remove();
}
else if ( this.Content.length > 0 && this.Content[0].Get_CellsCount() > 0 )
else if (this.Content.length > 0 && this.Content[0].Get_CellsCount() > 0)
{
this.CurCell = this.Content[0].Get_Cell(0);
this.CurCell.Content.Selection_Remove();
}
}
this.Selection.Use = false;
this.Selection.Start = false;
this.Selection.StartPos.Pos = { Row : 0, Cell : 0 };
this.Selection.EndPos.Pos = { Row : 0, Cell : 0 };
this.Selection.StartPos.Pos = {Row : 0, Cell : 0};
this.Selection.EndPos.Pos = {Row : 0, Cell : 0};
this.Markup.Internal.RowIndex = 0;
this.Markup.Internal.CellIndex = 0;
......
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