B2020-075 make room for the End message only if we are printing the last step of the section

This commit is contained in:
John Jenko 2020-05-18 19:59:51 +00:00
parent 41aac0b063
commit 0d572f335a

View File

@ -868,7 +868,7 @@ namespace Volian.Print.Library
} }
private void BuildPageBreakList(float ySpaceOnCurPage, float yPageSize, bool KeepStepsOnPage, float yEndMsg, bool doSectionTitleContinued, bool onNewPage) 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"); int profileDepth = ProfileTimer.Push(">>>> BuildPageBreakList");
// if this paragraph is flagged to pagebreakonstep (i.e. these are used by background documents // 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 // 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; float adjustedCurPageYSpace = ySpaceOnCurPage;
if (MyPageHelper.PrintedSectionPage > 0 && MyItemInfo.ActiveSection != null && (MyItemInfo.ActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PrintSectOnFirst) == E_DocStructStyle.DSS_PrintSectOnFirst) 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; float ySpaceAt7LPI = (adjustedCurPageYSpace - (accountForCalvertAlarmConditionResponseFooter + yEndMsg)) * SixLinesPerInch / _SevenLinesPerInch;
if ((YSize - yTop) > (adjustedCurPageYSpace - (accountForCalvertAlarmConditionResponseFooter + yEndMsg)) if ((YSize - yTop) > (adjustedCurPageYSpace - (accountForCalvertAlarmConditionResponseFooter + yEndMsg))
&& (YSize - yTop) < ySpaceAt7LPI ) && (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. // 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. // 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. // 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 _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 (StepWillFitOnBlankPageButNotOnCurrentPage(myPara, yLocation, yStart, fullPage + yAdjustLastSubStep))