From 2b74bd52abb87f8193869664dd87d7c716d94a5d Mon Sep 17 00:00:00 2001 From: Kathy Date: Thu, 1 Aug 2019 15:01:32 +0000 Subject: [PATCH] B2019-100: UCF check off & check off header issues --- PROMS/VEPROMS User Interface/frmSectionProperties.cs | 6 +++++- PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs | 4 ++-- PROMS/Volian.Base.Library/PropGridCollEditor.cs | 9 +++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmSectionProperties.cs b/PROMS/VEPROMS User Interface/frmSectionProperties.cs index dd146cbc..434f97f5 100644 --- a/PROMS/VEPROMS User Interface/frmSectionProperties.cs +++ b/PROMS/VEPROMS User Interface/frmSectionProperties.cs @@ -775,7 +775,11 @@ namespace VEPROMS lblCheckoffHeading.Enabled = true; ppCmbxCheckoffHeading.Enabled = true; ppCmbxCheckoffHeading.DataSource = chkoffHeaderList; - ppCmbxCheckoffHeading.SelectedIndex = _SectionConfig.Section_CheckoffHeaderSelection; + // B2019-100: the checkoffselection may be larger than number in the list if elements of list were made inactive from UCF. Adjust as necessary: + if (_SectionConfig.Section_CheckoffHeaderSelection >= ppCmbxCheckoffHeading.Items.Count) + ppCmbxCheckoffHeading.SelectedIndex = -1; + else + ppCmbxCheckoffHeading.SelectedIndex = _SectionConfig.Section_CheckoffHeaderSelection; } else { diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs index 02a7a9c3..5bc5a397 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs @@ -1672,8 +1672,8 @@ namespace VEPROMS.CSLA.Library if (!MyFormat.PlantFormat.FormatData.ProcData.CheckOffUCF || fc==null) { _CheckOffList = new CheckOffList(SelectNodes("CheckOffList/CheckOff"), MyFormat); - // If Ignoring the UCF data, just return the entire list. Also, return entire list if there is no UCF data (fc == null) - if (!PlantFormat.IgnoreUCF || fc == null) return _CheckOffList; + // B2019-100: If Ignoring the UCF data, just return the entire list. Also, return entire list if there is no UCF data (fc == null) + if (PlantFormat.IgnoreUCF || fc == null) return _CheckOffList; // If not ignoring UCF settings, only return those that are active foreach (FormatConfig.CheckOff co in fc.PlantFormat.FormatData.CheckOffList) { diff --git a/PROMS/Volian.Base.Library/PropGridCollEditor.cs b/PROMS/Volian.Base.Library/PropGridCollEditor.cs index 72b9209e..d582b2a4 100644 --- a/PROMS/Volian.Base.Library/PropGridCollEditor.cs +++ b/PROMS/Volian.Base.Library/PropGridCollEditor.cs @@ -87,10 +87,11 @@ namespace Volian.Base.Library ResetValue(propertyGrid.SelectedGridItem.Parent.Value, "PageLength"); else if (SelectedGridField.Contains("WindowsFont")) ResetValue(propertyGrid.SelectedGridItem.Parent.Value, "WindowsFont"); - else if (SelectedGridField.Contains("Inactive CheckOff Header")) - ResetValue(propertyGrid.SelectedGridItem.Parent.Value, "Inactive"); - else if (SelectedGridField.Contains("Inactive CheckOff")) - ResetValue(propertyGrid.SelectedGridItem.Parent.Parent.Value, "Inactive"); + // B2019-100: for headers, use Parent's parent and also for both header & checkoffs the field name is 'Active' (not 'Inactive') + else if (SelectedGridField.Contains("Active CheckOff Header")) + ResetValue(propertyGrid.SelectedGridItem.Parent.Parent.Value, "Active"); + else if (SelectedGridField.Contains("Active CheckOff")) + ResetValue(propertyGrid.SelectedGridItem.Parent.Parent.Value, "Active"); } private void ShowReflection(Object data) {