From 10821a478b5c182643853db6236a115fd247ffa7 Mon Sep 17 00:00:00 2001 From: John Jenko Date: Wed, 30 Aug 2023 10:55:07 -0400 Subject: [PATCH] =?UTF-8?q?=20B2023-078=20=20When=20using=20the=20split=20?= =?UTF-8?q?screen=20PROMS=20was=20crashing=20when=20the=20user=20closed=20?= =?UTF-8?q?a=20procedure=20tab=20on=20the=20other=20split=20screen=20side?= =?UTF-8?q?=20which=20didn=E2=80=99t=20have=20the=20current=20editing=20fo?= =?UTF-8?q?cus.=20=20PROMS=20was=20trying=20to=20reposition=20to=20the=20p?= =?UTF-8?q?rocedure=20tab=20that=20had=20editing=20focus,=20we=20were=20no?= =?UTF-8?q?t=20taking=20into=20account=20that=20saved=20currently=20active?= =?UTF-8?q?=20procedure=20tab=20could=20be=20in=20a=20different=20split=20?= =?UTF-8?q?screen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/Volian.Controls.Library/DisplayTabControl.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PROMS/Volian.Controls.Library/DisplayTabControl.cs b/PROMS/Volian.Controls.Library/DisplayTabControl.cs index 82f08177..90ed2439 100644 --- a/PROMS/Volian.Controls.Library/DisplayTabControl.cs +++ b/PROMS/Volian.Controls.Library/DisplayTabControl.cs @@ -827,7 +827,11 @@ namespace Volian.Controls.Library private DisplayTabItem FindRemainingTab(Bar myBar) { // C2023-004: Proms reverts to first tab rather than active tab/save last selected tab is and use to reset to it - if (LastSelectedDisplayTabItem != null && !_RemovedDisplayTabItems.Contains(LastSelectedDisplayTabItem)) + // B2023-078 Added the check for LastSelectedDisplayTabItem is in myBar. This fixes a crash issue where user has as split screen + // each with procedure tabs and closes a procedure tab in the split screen that does not currently have focus. + // that other screen has its own myBar list which does not contain the LastSelectedDisplayTabItem references. + // In that case we want to run through the foreach loop to find a tab in the currently active split screen side + if (LastSelectedDisplayTabItem != null && myBar.Items.Contains(LastSelectedDisplayTabItem) && !_RemovedDisplayTabItems.Contains(LastSelectedDisplayTabItem)) return LastSelectedDisplayTabItem; foreach (DisplayTabItem itm in myBar.Items) { -- 2.47.2