Changed logic for ComponentList Page Breaks

If a page break in the RNO column falls within the range of an AER step, use the AER Step for the page break.
Dont break at the first substep if the first substep is an OR or Explicit AND
This commit is contained in:
Rich 2014-03-31 16:39:26 +00:00
parent d7e88e247a
commit ac7083febd
2 changed files with 27 additions and 1 deletions

View File

@ -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"))

View File

@ -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)
{