From 2f32c42a77ffc8195144ca79d15bd51d7fb957da Mon Sep 17 00:00:00 2001 From: Kathy Date: Thu, 8 Mar 2012 14:24:51 +0000 Subject: [PATCH] --- PROMS/Volian.Controls.Library/EditItem.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/PROMS/Volian.Controls.Library/EditItem.cs b/PROMS/Volian.Controls.Library/EditItem.cs index 5fb2dfd3..84d141a9 100644 --- a/PROMS/Volian.Controls.Library/EditItem.cs +++ b/PROMS/Volian.Controls.Library/EditItem.cs @@ -215,8 +215,10 @@ namespace Volian.Controls.Library // see if change in subsections to be displayed, i.e. if the user made a change to editable data // on the section properties form, we may have to display steps or remove steps. By design, - // steps are the first children from a section. - if (MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections) + // steps are the first children from a section. Also, this will only occur if the format has + // metasections AND there are subsections. + if (MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections + && MyItemInfo.Sections != null && MyItemInfo.Sections.Count > 0) { // find out what the editable flag is to determine if change. bool showSteps = MyItemInfo.MyConfig is SectionConfig && (MyItemInfo.MyConfig as SectionConfig).SubSection_Edit == "Y"; @@ -2355,11 +2357,16 @@ namespace Volian.Controls.Library location = new PointF(ri.MyStepRTB.Left + ri.MyStepRTB.Width + 2, ri.MyStepRTB.Top); } CheckOff co = MyItemInfo.GetCheckOffStep(); - if (co != null) + // There may have been a data change in the setting of which checkoff to use (property + // change in the config data), or whether a checkoff is used at all. Need to set the + // 'UserCheckOff' or 'UserCheckOffChar' properties to reflect that. + if (co != null && co.UIMark != null) { + UserCheckOffChar = (char)co.UIMark; Font myFont = new Font("VolianDraw", MyItemInfo.MyTab.MyFont.WindowsFont.Size); g.DrawString(UserCheckOffChar.ToString(), myFont, Brushes.DarkGreen, new RectangleF(location, MyStepPanel.MyStepPanelSettings.NumberSize), StringFormat.GenericDefault); } + else if (co == null) UserCheckOff = false; } } }