diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index a9c12546..1ce94bd3 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -78,12 +78,22 @@ namespace Volian.Print.Library // location of a pagebreak. if (MyPageHelper.ParaBreaks.Count > 0) { - if (this == MyPageHelper.ParaBreaks[0] || MyPageHelper.ParaBreaks[0].CheckAlternates(this) || (!MyPageHelper.ParaBreaks[0].PageBreakOnStep && this.YTopMost > MyPageHelper.ParaBreaks[0].YTopMost)) + if (this == MyPageHelper.ParaBreaks[0]) { MyPageHelper.ParaBreaks.RemoveAt(0); - //Console.WriteLine("'PageBreak',6,'Yes','Page Break within Step',{0},{1},{2},{3}, {4},'{5}'", MyItemInfo.ItemID, YSize, 0, 0, 0, MyItemInfo.ShortPath); - //Console.WriteLine("Prev = {0}", MyItemInfo.MyPrevious==null ? "''" : MyItemInfo.DBSequence); - ShowPageBreak(1, "Page Break within Step", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); + ShowPageBreak(1, "Page Break within Step 1", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); + return 2; // break on this item within a step + } + else if (MyPageHelper.ParaBreaks[0].CheckAlternates(this)) + { + MyPageHelper.ParaBreaks.RemoveAt(0); + ShowPageBreak(1, "Page Break within Step 2", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); + return 2; // break on this item within a step + } + else if (!MyPageHelper.ParaBreaks[0].PageBreakOnStep && this.YTopMost > MyPageHelper.ParaBreaks[0].YTopMost) + { + MyPageHelper.ParaBreaks.RemoveAt(0); + ShowPageBreak(1, "Page Break within Step 3", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); return 2; // break on this item within a step } return 0; // this is not an item with a break @@ -772,7 +782,7 @@ namespace Volian.Print.Library } while (myPara.MyParent.YTop == myPara.YTop) myPara = myPara.MyParent; int everyNLines = myPara.MyItemInfo.MyPrevious != null && myPara.MyItemInfo.FormatStepData == null ? 1 : myPara.MyItemInfo.FormatStepData.StepLayoutData.EveryNLines ?? 1; - if (wcnChkLstBorder - yLocation < yUpperLimit + yAddForBtmMsg || (everyNLines != 99 && (wcnChkLstBorder - yLocation == yUpperLimit + yAddForBtmMsg))) // Fix for OFN-RJ-23 + if (myPara.ChildrenAbove.Count==0 && wcnChkLstBorder - yLocation < yUpperLimit + yAddForBtmMsg || (everyNLines != 99 && (wcnChkLstBorder - yLocation == yUpperLimit + yAddForBtmMsg))) // Fix for OFN-RJ-23 //if (-yLocation < yUpperLimit) // Before //if (-yLocation < yWithinMargins && myList[stepLevel][yLocation].MyItemInfo.MyPrevious != null) { diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 79133f69..9d36f1c0 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -1187,6 +1187,7 @@ namespace Volian.Print.Library if (MyPageHelper.ParaBreaks != null && MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0] == this) { + if (DebugPagination.IsOpen) DebugPagination.WriteLine("XXXXXXXXXXXXXX Special Page Break (PageBreakOnStep) On Item {0},{1}", MyItemInfo.ItemID, MyItemInfo.ShortPath); OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); MyPageHelper.BottomMessage = null; MyPageHelper.TopMessage = null; @@ -2349,8 +2350,7 @@ namespace Volian.Print.Library //if (itemInfo.IsSection) // Rtf = GetRtf(itemInfo, prefix, " (Continued)"); //else - // The following line may not be necessary RTF is lazyloaded - // BuildRtf(); + // BuildRtf(); // not necessary, RTF is lazyloaded if (itemInfo.IsStep && itemInfo.MyHLS != null && itemInfo.MyHLS.FormatStepData.UseSmartTemplate) { if (itemInfo.FormatStepData.StepLayoutData.AlignWithParentTab