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

@@ -254,9 +254,7 @@ namespace VEPROMS.CSLA.Library
{
using (Item fromitem = previousInfo == null ? null : previousInfo.Get())
{
ItemInfo nextInfo = null; // Check to see if the item is being inserted in the middle of some items.
if (previousInfo != null && previousInfo.NextItems != null && previousInfo.NextItems.Count > 0)
nextInfo = previousInfo.NextItems[0];
ItemInfo nextInfo = previousInfo.GetNext(); // Check to see if the item is being inserted in the middle of some items.
using (Item itm = Item.MakeItem(fromitem, cont))
{
newitemid = itm.ItemID;
@@ -1986,8 +1984,13 @@ namespace VEPROMS.CSLA.Library
get
{
ItemInfo temp = this;
while (temp.NextItems != null && temp.NextItems.Count > 0) temp = temp.NextItems[0];
return temp;
ItemInfo last = this;
while (temp != null)
{
last = temp;
temp = temp.GetNext();
}
return last;
}
}
public ItemInfo LastChild(E_FromType partType)