diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index 293e74b5..f3ad2938 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -41,7 +41,7 @@ namespace Volian.Print.Library // line above the end message, thus 2 not 3. This change was made on July 20, 2011 by RHM & KBR. The // procedure in questions was VEWCNEMG\EMGAPP.PRC, ES-01, Step 8. bool ManualPageBreak = false; - float yEndMsg = !MyItemInfo.IsSection && MyItemInfo.MyHLS.NextItem == null && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? 2 * SixLinesPerInch : 0; + float yEndMsg = !MyItemInfo.IsSection && MyItemInfo.MyHLS != null && MyItemInfo.MyHLS.NextItem == null && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? 2 * SixLinesPerInch : 0; // The following code is to fix a pagination issue in SHE. It was decided to not put it into development // because some of the pagination logic may be redesigned. Without this fix, some pages had a page break @@ -384,10 +384,11 @@ namespace Volian.Print.Library { vlnParagraph myPara = myList[stepLevel][yLocation]; // The top of this step will fit onto page (-yLocation < yWithinMargins) - float wcnChkLstBorder = myPara.MyItemInfo.MyHLS.FormatStepData.UseSmartTemplate && + float wcnChkLstBorder = myPara.MyItemInfo.MyHLS != null && myPara.MyItemInfo.MyHLS.FormatStepData.UseSmartTemplate && (myPara.MyItemInfo.MyHLS.FormatStepData.Suffix ?? "") != "" ? 2*SixLinesPerInch : 0; if (minPara == null || minPara.YTop > myPara.YTop) minPara = myPara; + if (myPara.MyParent.YTop == myPara.YTop) myPara = myPara.MyParent; if (wcnChkLstBorder -yLocation <= yUpperLimit) // Fix for OFN-RJ-23 //if (-yLocation < yUpperLimit) // Before //if (-yLocation < yWithinMargins && myList[stepLevel][yLocation].MyItemInfo.MyPrevious != null)