From adc8617aa155c7e5448ca40818921fcc2a3b673e Mon Sep 17 00:00:00 2001 From: Kathy Date: Wed, 2 Mar 2022 14:59:09 +0000 Subject: [PATCH] =?UTF-8?q?B2022-027:=20Barakah=20=E2=80=93=20blank=20line?= =?UTF-8?q?=20not=20printing=20after=20list=20within=20another=20list=20wh?= =?UTF-8?q?en=20in=20caution/note?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/Volian.Print.Library/vlnParagraph.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 8bebe003..db42871d 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -5323,11 +5323,24 @@ namespace Volian.Print.Library // F2021-025: Barakah single column no blank line between last Note/Caution/Warning text and bottom line of box // C2021-049: Barakah no blank line between last Note/Caution/Warning text, include sub-step text by using 'IsInCautionOrNote' // B2022-017: Barakah within note/caution, if note has substeps, there should be a blank line between note & 1st substep + // B2022-027: Barakah blank line not printing after list within another list. Rewrote code for all of these issues so that + // code looks up parents to see if they have next before returning a 0 (no blank line) if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.NoBlankLastNoteCautionWarn && (MyItemInfo.IsInCautionOrNote)) { - if ((MyItemInfo.Steps == null || MyItemInfo.Steps.Count == 0) && ((MyItemInfo.NextItem == null) || (MyItemInfo.MyContent.Type != MyItemInfo.NextItem.MyContent.Type))) return 0; + if ((MyItemInfo.Steps == null || MyItemInfo.Steps.Count == 0) && (MyItemInfo.NextItem == null)) // there are no sub-steps, see if any parents have next + { + ItemInfo par = MyItemInfo.MyParent; + while (par.IsInCautionOrNote) // while in the caution or note, see if there is anything below this item + { + // if there is no next item, or content types are different, go up to see if the parent has any next item. If note + // keep going up tree, otherwise there is a next so don't return 0, i.e. continue on with code to determine + // whether there is a blank line + if ((par.NextItem == null) || (par.MyContent.Type != par.NextItem.MyContent.Type)) par = par.MyParent; + else break; + } + if (!par.IsInCautionOrNote || (par != null && par.MyContent.Type != par.NextItem.MyContent.Type)) return 0; + } } - if (MyItemInfo.Ordinal % everyNLines == 0 || MyItemInfo.NextItem == null) return SixLinesPerInch; // B2022-003: BNPP Alarms (BNPPalr) - incorrect line spacing for substeps off substeps. Added a format flag so as not to affect other plants. if (MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.StepPrintData != null && MyItemInfo.FormatStepData.StepPrintData.BlankAfterSubWithSub && MyItemInfo.NextItem != null && MyItemInfo.HasChildren && MyItemInfo.Steps != null && MyItemInfo.Steps.Count > 0) return SixLinesPerInch;