From 3f87a0e39d809c1c9acfe283d44bee5c706b6bab Mon Sep 17 00:00:00 2001 From: Rich Date: Thu, 14 Nov 2013 16:20:54 +0000 Subject: [PATCH] Handle long complicated RNO in pagination. --- PROMS/Volian.Print.Library/Pagination.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index 48c9eb1f..dd28ff2a 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -366,10 +366,11 @@ namespace Volian.Print.Library // while the amount to print is larger than one page, i.e. ((YSize - yTop) > ySpaceOnCurPage)) // OR there are page breaks for HLS/cautions/notes remaining, typically for backgrounds (PageBreakOnStepList.Count > 0) + vlnParagraph paraBreak = null; while (((YSize - yTop) > ySpaceOnCurPage) || PageBreakOnStepList.Count > 0) { ySpaceOnCurPage -= myBottomMsgSpace; - vlnParagraph paraBreak = FindPageBreak(yStart, ySpaceOnCurPage, yLowerLimit, myList); + paraBreak = FindPageBreak(yStart, ySpaceOnCurPage, yLowerLimit, myList, paraBreak); if (paraBreak == null) { _MyLog.ErrorFormat("<<< ERROR >>> Cannot find a place to break\r\n==>'Cannot Find Place to Break',{0},'{1}','{2}'" @@ -417,7 +418,7 @@ namespace Volian.Print.Library /// /// /// - private static vlnParagraph FindPageBreak(float yStart, float yUpperLimit, float yLowerLimit, StepLevelList myList) + private static vlnParagraph FindPageBreak(float yStart, float yUpperLimit, float yLowerLimit, StepLevelList myList, vlnParagraph lastBreak) { vlnParagraph minPara = null; foreach (int stepLevel in myList.Keys) // loop thru StepLevels, starting with lowest. @@ -425,6 +426,16 @@ namespace Volian.Print.Library foreach (float yLocation in myList[stepLevel].Keys) // loop thru yLocation { vlnParagraph myPara = myList[stepLevel][yLocation]; + // The following lines were added for Comanche Peak ECA-TP-11-001A.SProcedure Steps.S17 (Printed as Step 12) + if (myPara.YSize > yUpperLimit && myPara.ChildrenRight != null && myPara.ChildrenRight.Count > 0 && myPara.ChildrenRight[0].YSize <= yUpperLimit) + return myPara; + // The following lines were added for Comanche Peak ECA-0.1A.SProcedure Steps.S17 (Printed as Step 12) + // ******************** NEEDS TO BE FIXED ********************** + //vlnParagraph myParent = myPara.MyParent; + //if (myParent != lastBreak && myParent.YSize > yUpperLimit && myParent.ChildrenRight != null && myParent.ChildrenRight.Count > 0 && myParent.ChildrenRight[0].YSize <= yUpperLimit) + // _MyLog.WarnFormat("\r\nMyParentBreak {0},{1},{2},{3}", myParent, myParent.YSize, yUpperLimit,myParent.ChildrenRight[0].YSize); + //Console.WriteLine("Here"); + //return myParent; // The top of this step will fit onto page (-yLocation < yWithinMargins) float wcnChkLstBorder = myPara.MyItemInfo.MyHLS != null && myPara.MyItemInfo.MyHLS.FormatStepData.UseSmartTemplate && (myPara.MyItemInfo.MyHLS.FormatStepData.Suffix ?? "") != "" ? 2*SixLinesPerInch : 0;