B2016-130: Copy and paste replace steps causing missing and duplicate items in tree (problems with ‘NextItems’)

This commit is contained in:
2017-08-07 13:05:02 +00:00
parent e8ae40ef7f
commit 20a07c6a3e
12 changed files with 135 additions and 31 deletions

View File

@@ -2056,9 +2056,7 @@ namespace VEPROMS.CSLA.Library
get
{
if (PrintAllAtOnce) return GetNextItem();
if (NextItemCount > 0 && NextItems != null && NextItems.Count > 0)
return NextItems[0];
return null;
return GetNext();
}
}
private static void ResetOrdinal(int itemID)
@@ -2335,16 +2333,16 @@ namespace VEPROMS.CSLA.Library
newItemInfo.UpdateROText();
newItemInfo.UpdatePastedStepTransitionText();
// Add to tree
if (newItemInfo.NextItemCount > 0)
if (newItemInfo.NextItem != null)
{
using (ItemInfo itm = ItemInfo.Get(newItemInfo.NextItem.ItemID))
using (ItemInfo itm = ItemInfo.GetNonCached(newItemInfo.NextItem.ItemID))
{
itm.OnNewSiblingBefore(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.Before));
}
}
else if (newItemInfo.PreviousID != null)
{
using (ItemInfo itm2 = ItemInfo.Get((int)newItemInfo.PreviousID))
using (ItemInfo itm2 = ItemInfo.GetNonCached((int)newItemInfo.PreviousID))
{
itm2.OnNewSiblingAfter(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.After));
}