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

@@ -949,7 +949,8 @@ namespace Volian.Controls.Library
{
if (lookAtSub && ii.Sections != null) return TopPart(ii.Sections[0]);
if (lookAtSub && ii.Steps != null) return TopPart(ii.Steps[0]);
if (ii.IsSection && ii.NextItems != null && ii.NextItems.Count > 0) return TopPart(ii.NextItems[0]);
ItemInfo nxt = ii.GetNext();
if (nxt != null) return TopPart(nxt);
}
else
{
@@ -972,7 +973,8 @@ namespace Volian.Controls.Library
if (lookAtRNO && ii.RNOs != null && ii.RNOLevel >= ii.ColumnMode) return TopPart(ii.RNOs[0]);
// Nextsibling - go to top part of sibling
// TODO: RHM - NextItems was not null when it should have been after delete of a note below a caution
if (ii.NextItems != null && ii.NextItems.Count > 0) return TopPart(ii.NextItems[0]);
ItemInfo nxt = ii.GetNext();
if (nxt != null) return TopPart(nxt);
// If on caution, if parent has note - go to note
if (ii.IsCautionPart && ii.MyParent.Notes != null) return ii.MyParent.Notes[0];
// If on caution, if parent !has note or if on note go to parent
@@ -1001,7 +1003,7 @@ namespace Volian.Controls.Library
ii = ii.LastSibling;
break;
case Keys.PageDown:
ii = ii.NextItems != null && ii.NextItems.Count > 0 ? ii.NextItems[0] : null;
ii = ii.GetNext();
break;
case Keys.PageUp:
ii = ii.MyPrevious;