B2017-197 a Select method was being called in the SplitSelectionRow method all the time. We only need to call the Select method when are processing rows that do not contain any merged rows.

This commit is contained in:
John Jenko 2017-09-08 14:19:50 +00:00
parent 83e13a93ee
commit f2247946e0

View File

@ -885,7 +885,7 @@ namespace Volian.Controls.Library
int profileDepth = ProfileTimer.Push(">>>> VlnFlexGrid.LoadGrid"); int profileDepth = ProfileTimer.Push(">>>> VlnFlexGrid.LoadGrid");
_MyItemInfo = itemInfo; _MyItemInfo = itemInfo;
string str = itemInfo.MyContent.MyGrid.Data; string str = itemInfo.MyContent.MyGrid.Data;
VE_Font vefont = _MyItemInfo.GetItemFont(); VE_Font vefont = _MyItemInfo.GetItemFont();
// the following code is used to be sure that the font used for symbols is the correct font // the following code is used to be sure that the font used for symbols is the correct font
// based on whether the font for non-symbol text is fixed or proportional. Each steprtb has // based on whether the font for non-symbol text is fixed or proportional. Each steprtb has
@ -2678,9 +2678,12 @@ namespace Volian.Controls.Library
Select(r, cr.c1, r, cr.c2); Select(r, cr.c1, r, cr.c2);
InsertRowAfter(); InsertRowAfter();
} }
// B2017-197 move the Select inside if (hasNonMergedRow)
// was getting a selection out of range error when spliting rows that contained mergered rows
// only need to do this if we inserted rows
// include new rows in selection
this.Select(cr.r1, cr.c1, cr.r2 + numSelRows, cr.c2);
} }
// include new rows in selection
this.Select(cr.r1, cr.c1, cr.r2 + numSelRows, cr.c2);
//if a merged range is part of the selectin, try to split it //if a merged range is part of the selectin, try to split it
foreach (CellRange sel in MySelection) foreach (CellRange sel in MySelection)
{ {