diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index 96146123..9341f80b 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -184,6 +184,12 @@ namespace Volian.Print.Library //if (!ManualPageBreak && mySize + yEndMsg <= yWithinMargins) // Don't Paginate if there is enough room, will fit on page // Pagination Fix - Break1LineShort1 float yExtra = (yWithinMargins == yPageSize ? 0 : SixLinesPerInch - MyItemInfo.MyDocStyle.Layout.FooterLength) ?? 0; + // Adjust yExtra and mySize for Component List items. + if (MyItemInfo.ActiveSection.MyDocStyle.ComponentList && yExtra > 0) + { + yExtra = 0; + if (mySize < Height) mySize = Height * MyPageHelper.YMultiplier; + } float yExtra2 = (SixLinesPerInch - MyItemInfo.MyDocStyle.Layout.FooterLength) ?? 0; if (KeepStepsOnPage && ySizeIncludingFirst > yWithinMargins) KeepStepsOnPage = false; @@ -421,6 +427,21 @@ namespace Volian.Print.Library { throw (new Exception(string.Format("Pagination Infinite Loop {0}",lastBreak.MyItemInfo.ShortPath))); } + // If the paraBreak is in an RNO and the location of the RNO is within the range of the AER parent, then break on the AER. + if (paraBreak.MyItemInfo.IsInRNO) + { + vlnParagraph aerParent = paraBreak.MyParent; + while (aerParent.MyItemInfo.IsInRNO) aerParent = aerParent.MyParent; + if (aerParent.YOffset + aerParent.Height > paraBreak.YOffset) + { + if (aerParent.ChildrenAbove != null && aerParent.ChildrenAbove.Count > 0) // If the aerParent has caution or note + aerParent = aerParent.ChildrenAbove[0];//, break on the caution or note. + if (aerParent != lastBreak) + { + paraBreak = aerParent; + } + } + } // If the break is going to happen on a table, and the tables parent would fit on a page with the table // and the text in the parent includes the word table, then break on the parent //if (lastBreak != paraBreak.MyParent && paraBreak.MyItemInfo.IsTable && paraBreak.YSize < ySpaceOnCurPage && paraBreak.MyParent.MyItemInfo.DisplayText.ToUpper().Contains("TABLE")) diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 54dd16a0..080f73d2 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -1331,7 +1331,12 @@ namespace Volian.Print.Library vlnParagraph para = this; if (!MyItemInfo.ActiveFormat.MyStepSectionLayoutData.PaginateOnFirstSubstep && ChildrenBelow != null && ChildrenBelow.Count > 0) { - para = ChildrenBelow[0].GetFirstPieceLastPart(); + // If the substep has a separator (OR, AND) then return the last substep rather than the first. + string mySep = ChildrenBelow[0].MyItemInfo.FormatStepData.Sep ?? "{Null}"; + if (mySep != "{Null}" && mySep != "") + para = ChildrenBelow[ChildrenBelow.Count - 1].GetFirstPieceLastPart(); + else + para = ChildrenBelow[0].GetFirstPieceLastPart(); } if (ChildrenRight != null && ChildrenRight.Count > 0) {