Commit d47c652c authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug with deleting the last row in a table.

parent af2c04cc
...@@ -6629,25 +6629,32 @@ CTable.prototype = ...@@ -6629,25 +6629,32 @@ 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 = 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 = this.Content[this.Selection.StartPos.Pos.Row].Get_Cell(this.Selection.StartPos.Pos.Cell);
this.CurCell.Content.Selection_Remove(); 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 = this.Content[0].Get_Cell(0);
this.CurCell.Content.Selection_Remove(); 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;
......
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