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:
@@ -243,6 +243,12 @@ namespace Volian.Print.Library
|
|||||||
// ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin);
|
// ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin);
|
||||||
if (MyPageHelper.DidFirstPageDocStyle && (MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnAllButFirstPage) > 0)
|
if (MyPageHelper.DidFirstPageDocStyle && (MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnAllButFirstPage) > 0)
|
||||||
yPageSizeNextPage = GetYPageSizeUseOnAllButFirstPage();
|
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
|
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
|
// Don't want extra line before step
|
||||||
@@ -506,6 +512,14 @@ namespace Volian.Print.Library
|
|||||||
ySpaceOnCurPage += SixLinesPerInch;
|
ySpaceOnCurPage += SixLinesPerInch;
|
||||||
accountForSmartTemplateHeader = Height - (2 * 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)
|
while (((YSize - yTop) > (ySpaceOnCurPage - (accountForCalvertAlarmConditionResponseFooter+yEndMsg))) || PageBreakOnStepList.Count > 0)
|
||||||
{
|
{
|
||||||
float ySpaceOnCurPageSave = ySpaceOnCurPage;
|
float ySpaceOnCurPageSave = ySpaceOnCurPage;
|
||||||
|
Reference in New Issue
Block a user