From 26d500a939cf0f65e8350d150f8580328d1bff15 Mon Sep 17 00:00:00 2001 From: Rich Date: Fri, 22 May 2020 16:07:05 +0000 Subject: [PATCH] B2020-077 Loop through all potential page breaks. Account for gaps in the list based upon step level. --- PROMS/Volian.Print.Library/Pagination.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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 + } } } }