Fixed logic so that if the high-level step has an end message and the end message would excede the bottom margin, then the step is placed on the next page.

This commit is contained in:
Rich
2014-10-02 13:13:20 +00:00
parent 183bdf015a
commit 08f2a9f631

View File

@@ -243,6 +243,12 @@ namespace Volian.Print.Library
// ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin);
if (MyPageHelper.DidFirstPageDocStyle && (MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnAllButFirstPage) > 0)
yPageSizeNextPage = GetYPageSizeUseOnAllButFirstPage();
if (KeepStepsOnPage && YSize == ySizeIncludingFirst && YSize + yEndMsg > yWithinMargins)
{
// If the first step is the size of the entire step and the step has an end message then don't try to break the step
KeepStepsOnPage = false;
//_MyLog.WarnFormat("Kick Step to Next Page {0},{1}", MyItemInfo.ItemID, MyItemInfo.ShortPath);
}
if (!KeepWithHeader && !KeepStepsOnPage && YSize - SixLinesPerInch + yEndMsg <= yPageSizeNextPage) // if the entire step can fit on one page, do a page break
{
// Don't want extra line before step
@@ -506,6 +512,14 @@ namespace Volian.Print.Library
ySpaceOnCurPage += SixLinesPerInch;
accountForSmartTemplateHeader = Height - (2 * SixLinesPerInch);
}
// This was added so that if a page break was immediately necessary the code would use the current step.
// However, a better solution was found and put in Paginate()
//if (YSize == Height + SixLinesPerInch && YSize + yEndMsg >= ySpaceOnCurPage)
//{
// _MyLog.WarnFormat("Would have been unable to break {0},{1}",MyItemInfo.ItemID, MyItemInfo.ShortPath);
// MyPageHelper.ParaBreaks.Add(this);
// return;
//}
while (((YSize - yTop) > (ySpaceOnCurPage - (accountForCalvertAlarmConditionResponseFooter+yEndMsg))) || PageBreakOnStepList.Count > 0)
{
float ySpaceOnCurPageSave = ySpaceOnCurPage;