Fix B2013-125: crash when adding SHE procedures

Modify 'AND' range transition to actual selection of user
This commit is contained in:
2013-06-27 12:51:55 +00:00
parent f77ebed326
commit 45fdbc4fe3
3 changed files with 16 additions and 32 deletions

View File

@@ -195,7 +195,7 @@ namespace Volian.Controls.Library
// figure out whether at same level, have same parent and have same HLS:
ItemInfo itm1 = _CurTrans.MyItemToID;
ItemInfo itm2 = _CurTrans.MyItemRangeID;
if (_CurTrans.TranType == 2 && itm1.ItemID == itm2.ItemID) itm2 = itm1.LastSibling;
//if (_CurTrans.TranType == 2 && itm1.ItemID == itm2.ItemID) itm2 = itm1.LastSibling;
bool samHLS = itm1.MyHLS.ItemID == itm2.MyHLS.ItemID;
int lev1 = 0;
int lev2 = 0;
@@ -914,21 +914,24 @@ namespace Volian.Controls.Library
}
if (_RangeNode2 == null) _RangeNode2 = (VETreeNode)tvTran.SelectedNode;
rangeItem = (ItemInfo)_RangeNode2.VEObject;
// The following code was commented out in June 2013 based on a discussion with
// HVJ & PAL stating that the range transition should be specific as to what they
// enter, not set to end of list.
// If this is Transition type 2, then make 'rangenode2' same as rangenode1
// This will get resolved when transition text is resolved. This case represents
// range from rangenode1 to last sibling. Note that this is only done if within
// the same sibling group. Otherwise, get the second item in the
// range, based on current tree view selection.
if (listBoxTranFmt.SelectedIndex == 2)
{
// if type 2 and not a HLS and the range is within the same hls, then set
// to and range to be equal. When text gets resolved, this case generates
// a list represent the toid,,,lastsibling.
if (!toItem.IsHigh && toItem.MyHLS.ItemID == rangeItem.MyHLS.ItemID)
rangeItem = toItem;
else
rangeItem = rangeItem.MyHLS;
}
//if (listBoxTranFmt.SelectedIndex == 2)
//{
// // if type 2 and not a HLS and the range is within the same hls, then set
// // to and range to be equal. When text gets resolved, this case generates
// // a list represent the toid,,,lastsibling.
// if (!toItem.IsHigh && toItem.MyHLS.ItemID == rangeItem.MyHLS.ItemID)
// rangeItem = toItem;
// else
// rangeItem = rangeItem.MyHLS;
//}
// Check that the two items are of the below the section type.
if (toItem.MyContent.Type < 20000 || rangeItem.MyContent.Type < 20000)
{