From 0be8261cc41197042d2fce2aae2cd0e9365b42dc Mon Sep 17 00:00:00 2001 From: Rich Date: Fri, 20 Oct 2017 13:16:05 +0000 Subject: [PATCH] B2017-237 Fixed logic to find prevvious sup info step. Used IsCautionPart rather than IsCaution, since BGE has mixed cautuions and notes, The logic was runiing into an infiinite loop since the second note part was a caution, and this was causing the code to loop for the parents notes. --- PROMS/Volian.Controls.Library/EditItem.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PROMS/Volian.Controls.Library/EditItem.cs b/PROMS/Volian.Controls.Library/EditItem.cs index ce081b03..75369528 100644 --- a/PROMS/Volian.Controls.Library/EditItem.cs +++ b/PROMS/Volian.Controls.Library/EditItem.cs @@ -3441,14 +3441,15 @@ namespace Volian.Controls.Library private EditItem FindFirstChildWithSupInfo(ItemInfo itm) { // If on a caution, see if there are any notes below me on the screen that have supinfo. - if (itm.IsCaution && (itm.ActiveParent as ItemInfo).Notes != null && (itm.ActiveParent as ItemInfo).Notes.Count > 0) + // B2017-237 Should use isCautionPart rather than IsCaution for BGE Mixed Cautions and Notes + if (itm.IsCautionPart && (itm.ActiveParent as ItemInfo).Notes != null && (itm.ActiveParent as ItemInfo).Notes.Count > 0) { foreach (ItemInfo inote in (itm.ActiveParent as ItemInfo).Notes) { - if (inote.SupInfos != null && inote.SupInfos.Count > 0) - return GetEditItemFromItemID(inote.ItemID); + if (inote.SupInfos != null && inote.SupInfos.Count > 0) + return GetEditItemFromItemID(inote.ItemID); EditItem chld = FindFirstChildWithSupInfo(inote); - if (chld != null) return CheckForExpanded(chld); + if (chld != null) return CheckForExpanded(chld); } } // if on a caution or note check the step below me, which is really my activeparent (cautions/notes are above their respective parent)