From 0d572f335a2328d20bd2d843ce780289febcaa3e Mon Sep 17 00:00:00 2001 From: John Date: Mon, 18 May 2020 19:59:51 +0000 Subject: [PATCH] B2020-075 make room for the End message only if we are printing the last step of the section --- PROMS/Volian.Print.Library/Pagination.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index 22fa4b20..92bc7fce 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -868,7 +868,7 @@ namespace Volian.Print.Library } private void BuildPageBreakList(float ySpaceOnCurPage, float yPageSize, bool KeepStepsOnPage, float yEndMsg, bool doSectionTitleContinued, bool onNewPage) { - float topContinueHeight=2 * SixLinesPerInch; + float topContinueHeight = 2 * SixLinesPerInch; int profileDepth = ProfileTimer.Push(">>>> BuildPageBreakList"); // if this paragraph is flagged to pagebreakonstep (i.e. these are used by background documents // to get each hls/caution/note to be on its own page), then any of the children above should @@ -1354,7 +1354,12 @@ namespace Volian.Print.Library { float adjustedCurPageYSpace = ySpaceOnCurPage; if (MyPageHelper.PrintedSectionPage > 0 && MyItemInfo.ActiveSection != null && (MyItemInfo.ActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PrintSectOnFirst) == E_DocStructStyle.DSS_PrintSectOnFirst) - adjustedCurPageYSpace -= MyPageHelper.PrintedSectionPage; //B2020-064 FNP-1-ECP-0.0 Attachment 6 not enough room for end message + { + ItemInfo ii = paraBreak.MyItemInfo; + while (!ii.IsHigh) ii = ii.MyParent; + if (ii == ii.LastSibling) //B2020-075 only adjust the Farley section page length to make room for END message if this is the last step of the section. + adjustedCurPageYSpace -= MyPageHelper.PrintedSectionPage; //B2020-064 FNP-1-ECP-0.0 Attachment 6 not enough room for end message + } float ySpaceAt7LPI = (adjustedCurPageYSpace - (accountForCalvertAlarmConditionResponseFooter + yEndMsg)) * SixLinesPerInch / _SevenLinesPerInch; if ((YSize - yTop) > (adjustedCurPageYSpace - (accountForCalvertAlarmConditionResponseFooter + yEndMsg)) && (YSize - yTop) < ySpaceAt7LPI ) @@ -1589,7 +1594,7 @@ namespace Volian.Print.Library // 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; + 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))