From 5d94daca0ea79e20d41f9a7c5aab4540902145bb Mon Sep 17 00:00:00 2001 From: Rich Date: Mon, 24 Jul 2017 20:01:25 +0000 Subject: [PATCH] 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. --- PROMS/Volian.Print.Library/Pagination.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index af77c46c..3f4bfcfa 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -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 {