diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 557514fb..61f3c3d7 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -5595,6 +5595,16 @@ namespace Volian.Print.Library else level = 1; } + // For B2015-014, some migrated data for background documents had the TitleWithTextBelow with associated paragraphs + // as siblings rather than children. Pagination was sometimes putting the TitleWithTextBelow on one page and the + // paragraphs on next. The following code checks thse types, if in enhanced documents but not the Short Form Deviations. + if (paraLoc.MyParagraph.MyItemInfo.ActiveFormat != null + && ((paraLoc.MyParagraph.MyItemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds) + || (((paraLoc.MyParagraph.MyItemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedDeviations) == E_PurchaseOptions.EnhancedDeviations) + && paraLoc.MyParagraph.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.EnhancedShortFormDev)) + { + if (!paraLoc.MyParagraph.MyItemInfo.IsTitle && paraLoc.MyParagraph.MyItemInfo.MyPrevious != null && paraLoc.MyParagraph.MyItemInfo.MyPrevious.FormatStepData.Type == "TitleWithTextBelow") level = 0; + } myList.Add(level, paraLoc.YTop, paraLoc.MyParagraph); } return myList;