B2017-066 fixed an index out of range when doing a right arrow to walk through table cells where the first column of the table had merged rows

This commit is contained in:
John Jenko 2017-03-29 18:48:01 +00:00
parent 4d5dc34210
commit 2d23a5e6da

View File

@ -4709,7 +4709,7 @@ namespace Volian.Controls.Library
CellRange crDest = _owner.GetMergedRange(cr.r2 + 1, 0); CellRange crDest = _owner.GetMergedRange(cr.r2 + 1, 0);
if (cr.r2 < crDest.r1) // It will move to the correct place if (cr.r2 < crDest.r1) // It will move to the correct place
_owner.Select(crDest); _owner.Select(crDest);
else if (crDest.r2 < _owner.Rows.Count) else if (crDest.r2 < _owner.Rows.Count -1) //B2017066 check against count -1 to avoid index out of range error
_owner.Select(_owner.GetMergedRange(crDest.r2 + 1, 0)); _owner.Select(_owner.GetMergedRange(crDest.r2 + 1, 0));
else else
_owner.OnCursorMovement(this, new VlnFlexGridCursorMovementEventArgs(args.Key)); _owner.OnCursorMovement(this, new VlnFlexGridCursorMovementEventArgs(args.Key));