B2017-154 Fixed Pagination when a single substep (orphan) was being placed on the next page. This was only done for steps withtwo sub-steps where the second sub-step had no children.

This commit is contained in:
Rich 2017-07-24 20:01:25 +00:00
parent c1dde58be3
commit 5d94daca0e

View File

@ -468,6 +468,16 @@ namespace Volian.Print.Library
float tableSpaceAvailable = TableSpaceAvailable;// RHM20150525 - Table Scrunch
float ySizeBtmCtnMess1 = GetBottomContinueMessageSize(MyItemInfo.MyDocStyle);
float ySizeBtmEndMess1 = GetBottomEndMessageSize(MyItemInfo.MyDocStyle);
// B2017-154 Don't leave an orphan on the next page if the high level step and first sub-step will fit on the current page
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.NoOrphans1 && KeepStepsOnPage && ChildrenBelow.Count == 2)// Handle Orphans when there are two sub-steps and only one will fit.
{
vlnParagraph orphan = ChildrenBelow[1];// Verify that the orphan has no children
if (orphan.ChildrenBelow.Count == 0 && orphan.ChildrenAbove.Count == 0 && orphan.ChildrenLeft.Count == 0 && orphan.ChildrenRight.Count == 0)
{
//_MyLog.WarnFormat("Orphan Found {0},{1}", MyItemInfo.ItemID, MyItemInfo.ShortPath);
KeepStepsOnPage = false;
}
}
if (KeepStepsOnPage && ySizeIncludingFirst > (yWithinMargins - ySizeBtmCtnMess1 - ySizeBtmEndMess1)) KeepStepsOnPage = false;
if (!KeepWithHeader && !KeepStepsOnPage && mySize - SixLinesPerInch + yEndMsg - tableSpaceAvailable <= yPageSizeNextPage) // if the entire step can fit on one page, do a page break
{