Fixed NextItems logic
Replaced duplicate logic in GetChildren with MyItems Fixed logic to check for Sections = null
This commit is contained in:
@@ -778,7 +778,7 @@ 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) return TopPart(ii.NextItems[0]);
|
||||
if (ii.IsSection && ii.NextItems != null && ii.NextItems.Count > 0) return TopPart(ii.NextItems[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -793,7 +793,7 @@ 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.NextItemCount > 0) return TopPart(ii.NextItems[0]);
|
||||
if (ii.NextItems != null && ii.NextItems.Count > 0) return TopPart(ii.NextItems[0]);
|
||||
// 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
|
||||
@@ -822,7 +822,7 @@ namespace Volian.Controls.Library
|
||||
ii = ii.LastSibling;
|
||||
break;
|
||||
case Keys.PageDown:
|
||||
ii = ii.NextItems == null ? null : ii.NextItems[0];
|
||||
ii = ii.NextItems != null && ii.NextItems.Count > 0 ? ii.NextItems[0] : null;
|
||||
break;
|
||||
case Keys.PageUp:
|
||||
ii = ii.MyPrevious;
|
||||
|
Reference in New Issue
Block a user