B2018-081 - Corrected Pagination Loogic to keep High Level Step with High Level RNO

This commit is contained in:
Rich 2018-06-08 17:56:49 +00:00
parent 72b5b45ad2
commit cbd08ed92d

View File

@ -201,7 +201,14 @@ namespace Volian.Print.Library
// B2018-065 Calvert's continue message was not including the substep number in AOP-1A Attachment 1, added AERandRNO check
else if (!MyPageHelper.ParaBreaks[0].PageBreakOnStep && this.YTopMost >= MyPageHelper.ParaBreaks[0].YTopMost && AERandRNO(this.MyItemInfo, MyPageHelper.ParaBreaks[0].MyItemInfo))
{
//vlnParagraph removed = MyPageHelper.ParaBreaks[0];// 2018-081 Remember where the page break was going to be
MyPageHelper.ParaBreaks.RemoveAt(0);
//if (MyParent == removed && MyItemInfo.IsRNOPart && MyParent.MyItemInfo.IsHigh)// B2018-081 If The High Level Step was going to break from the High Level RNO
//{
// reason = AddReason("Partial Step - Case 4B");
// ShowPageBreak(1, reason, "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak);
// return 0;
//}
reason = AddReason("Partial Step - Case 4");
ShowPageBreak(1, reason, "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak);
return 2; // break on this item within a step
@ -571,7 +578,8 @@ namespace Volian.Print.Library
//float yWithinMarginsCM = yWithinMargins - myBottomMsgSpace;
//// **** Adjust yWithinMargins for the bottom continue message
// B2018-080 Don't break if HLS and High Level RNO each have one line of text and there are substeps (keep single line HSL and High Level RNO with their substeps) AEP AOP Unit 1 016-004 steps 36 & 74
if (myFirstPieceSize > 2 * SixLinesPerInch && (KeepWithHeader || (!ManualPageBreak && ((MyItemInfo.ActiveFormat.MyStepSectionLayoutData.SpecialPageBreakFlag && yWithinMargins > yPageSize / 2 &&
// B2018-081 The previous fix caused a different issue
if ((KeepWithHeader || (!ManualPageBreak && ((MyItemInfo.ActiveFormat.MyStepSectionLayoutData.SpecialPageBreakFlag && yWithinMargins > yPageSize / 2 &&
myFirstPieceSize < yWithinMargins) || KeepStepsOnPage))))
{
//Console.WriteLine("'PageBreak',4,'No','HLS will have to split anyway',{0},{1},{2}, {3}, {4},'{5}'", MyItemInfo.ItemID, YSize, yPageSize, yWithinMargins, (int)(100 * yWithinMargins / yPageSize), MyItemInfo.ShortPath);
@ -607,6 +615,14 @@ namespace Volian.Print.Library
}
else
ShowPageBreak(6, CheckForFirstCompression("HLS will have to split on current page"), "Special", YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak);
// B2018-081 - Fix pagination when a Step and it's substeps are so complicated that the high level step is separated from its high level RNO
if(this.MyItemInfo.IsHigh && MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].MyItemInfo.IsHigh)
{
MyPageHelper.ParaBreaks.Clear();
BuildPageBreakList(yPageSize + yExtra, yPageSizeNextPage + yExtra2, KeepStepsOnPage, yEndMsg, doSectionTitleContinued & SectionShowTitles, true); // Case 1 :Works for ES05 Step 15 SubStep 7
ShowPageBreak(6, CheckForFirstCompression("HLS will have to split on next page"), "Special", YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak);
return 1;
}
return 0; // Stay on this page
}
@ -1611,7 +1627,7 @@ namespace Volian.Print.Library
foreach (vlnParagraph pgh in _ChildrenBelow)
retval = pgh.TableSpaceAvailable;
if (MyGrid != null)
retval = MyGrid.SpaceAvailable;
retval = MyGrid.SpaceAvailable + MyGrid.LeadingSpaceAvailable;
return retval;
}
}