Commit d47c652c authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug with deleting the last row in a table.

parent af2c04cc
...@@ -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