From d045205d16b314591b7cb070fd2be6f01316b879 Mon Sep 17 00:00:00 2001 From: mschill Date: Thu, 1 Oct 2026 07:32:44 -0400 Subject: [PATCH] B2026-084 Spell Check crashing --- PROMS/Volian.Controls.Library/StepRTB.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index 5728cf6e..cea369ea 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -3538,7 +3538,23 @@ namespace Volian.Controls.Library // C2015-028 Add Editorial Mode to PROMS Step Editor // if in Editorial Mode, treat it the same as if the EditorialSpellCheck flag is set in the Format file - bool editorialmode = (this.Parent.Parent.Parent as StepTabPanel).MyDisplayTabControl.IsInEditorialMode; + bool editorialmode; + try + { + StepTabPanel pnl = null; + Control tempcntrl = Parent; + while (tempcntrl != null && pnl == null) + { + tempcntrl = tempcntrl.Parent; + pnl = tempcntrl as StepTabPanel; + } + + editorialmode = pnl.MyDisplayTabControl.IsInEditorialMode; + } + catch + { + editorialmode = false; + } if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.EditData.EditoralSpellCheck || editorialmode) DidEditorialSpellCheck = MySpellCheckDlg.DidCorrectSpelling; // B2015-024 spell checker in editoral mode