diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index addd27e5..96eac9d7 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -1646,13 +1646,18 @@ namespace Volian.Print.Library while (!tmp.MyItemInfo.IsRNOPart) tmp = tmp.MyParent; if (tmp.MyItemInfo.RNOs != null && tmp.MyItemInfo.RNOs.Count > 0) { - for (int i = 1; stepLevel + i < myList.Count; i++) // loop thru the other step levels + // B2020-077 This was changed from a standard for loop using myList.Count since there can be + // gaps in the list of step levels. + foreach (int lev in myList.Keys) // loop thru the other step levels { - foreach (float yLocation in myList[stepLevel + i].Keys) // loop thru yLocation from pagination list + if (lev > stepLevel) { - if ((tmp != myList[stepLevel + i][yLocation] && myList[stepLevel + i][yLocation].MyItemInfo.IsRNOPart) || - (myList[stepLevel + i][yLocation].MyParent != tmp) && myList[stepLevel + i][yLocation].MyParent.MyItemInfo.IsRNOPart) - return true; // has a second RNO that will fit + foreach (float yLocation in myList[lev].Keys) // loop thru yLocation from pagination list + { + if ((tmp != myList[lev][yLocation] && myList[lev][yLocation].MyItemInfo.IsRNOPart) || + (myList[lev][yLocation].MyParent != tmp) && myList[lev][yLocation].MyParent.MyItemInfo.IsRNOPart) + return true; // has a second RNO that will fit + } } } }