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
...@@ -6627,32 +6627,39 @@ CTable.prototype = ...@@ -6627,32 +6627,39 @@ CTable.prototype =
} }
}, },
Selection_Remove : function() Selection_Remove : function()
{ {
if ( false === this.Selection.Use ) if (false === this.Selection.Use)
return; return;
if ( table_Selection_Text === this.Selection.Type ) if (this.Content.length <= 0)
{ {
this.CurCell = this.Content[this.Selection.StartPos.Pos.Row].Get_Cell(this.Selection.StartPos.Pos.Cell); this.CurCell = null;
this.CurCell.Content.Selection_Remove(); }
} else
else if ( this.Content.length > 0 && this.Content[0].Get_CellsCount() > 0 ) {
{ if (table_Selection_Text === this.Selection.Type)
this.CurCell = this.Content[0].Get_Cell(0); {
this.CurCell.Content.Selection_Remove(); 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)
{
this.CurCell = this.Content[0].Get_Cell(0);
this.CurCell.Content.Selection_Remove();
}
}
this.Selection.Use = false; this.Selection.Use = false;
this.Selection.Start = false; this.Selection.Start = false;
this.Selection.StartPos.Pos = { Row : 0, Cell : 0 }; this.Selection.StartPos.Pos = {Row : 0, Cell : 0};
this.Selection.EndPos.Pos = { Row : 0, Cell : 0 }; this.Selection.EndPos.Pos = {Row : 0, Cell : 0};
this.Markup.Internal.RowIndex = 0; this.Markup.Internal.RowIndex = 0;
this.Markup.Internal.CellIndex = 0; this.Markup.Internal.CellIndex = 0;
this.Markup.Internal.PageNum = 0; this.Markup.Internal.PageNum = 0;
}, },
Selection_Check : function(X, Y, CurPage, NearPos) Selection_Check : function(X, Y, CurPage, NearPos)
{ {
......
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