B2022-027: Barakah – blank line not printing after list within another list when in caution/note

This commit is contained in:
Kathy Ruffing 2022-03-02 14:59:09 +00:00
parent b43df02d49
commit adc8617aa1

View File

@ -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;