From 318f68e14afe3cd28f54b95376ec52a51b693af8 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 24 Apr 2020 13:11:09 +0000 Subject: [PATCH] B2020-059 pagination fix in fitting last sub-step of a step on its own page. (PaginateOnStepThatWillFitOnBlankPage format flag in Barakah and South Texas formats) --- PROMS/Volian.Print.Library/Pagination.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index 37335725..d4065b4c 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -1579,8 +1579,17 @@ namespace Volian.Print.Library if ((-yLocation + yStart) >= yLowerLimit && !myPara.HasSecondRNOThatWillFit(yStart, yLowerLimit, yUpperLimit ,myList, stepLevel)) // Only if it is more than the lower limit // B2020-013 if it has a second RNO see if it will fit - Callaway OTO-AC-00002 step 2 return myPara; // B2019-103, B2019-114 Break at a step if the step will fit on a page by itself and it will - // not fit in the current pagee - if (StepWillFitOnBlankPageButNotOnCurrentPage(myPara, yLocation, yStart, fullPage)) + // not fit in the current page + float yAdjustLastSubStep = 0; + if ((myPara.MyItemInfo.ActiveParent as ItemInfo).IsHigh && myPara.MyItemInfo.NextItem == null) + { + // B2020-059 Last Substep will fit on page by itself - add the bottom continue message length to the fullpage length. + // fullpage is passed in FindPageBreak() with the bottom continue message length subtracted from the full page length. + // if this is the last sub-step of the HLS then we will not need a continue message, thus we include fullpage by th length of the bottom continue message. + yAdjustLastSubStep = myBottomMsgSpace; + _MyLog.WarnFormat("Last Substep will fit on page by itself {0}", myPara.MyItemInfo.ShortPath); // add information in the error log + } + if (StepWillFitOnBlankPageButNotOnCurrentPage(myPara, yLocation, yStart, fullPage + yAdjustLastSubStep)) if (myPara != lastBreak) return myPara; // If this item will not fit on the current page, put a page break