MNS Pagination - Mike Weiner Case 1b to keep substeps together on one page

MNS Pagination - Mike Weiner Case 1a to keep step together with any non-sequential substeps (ANDs, EQ List)
This commit is contained in:
Rich 2014-04-03 17:05:05 +00:00
parent 79175138f2
commit decbe11e52
2 changed files with 29 additions and 3 deletions

View File

@ -436,9 +436,28 @@ namespace Volian.Print.Library
{ {
if (aerParent.ChildrenAbove != null && aerParent.ChildrenAbove.Count > 0) // If the aerParent has caution or note 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. aerParent = aerParent.ChildrenAbove[0];//, break on the caution or note.
if (aerParent != lastBreak) if (aerParent != lastBreak)paraBreak = aerParent;
}
}
// MNS Pagination - Mike Weiner Case 1b to keep substeps together on one page
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.PutOnPageByItself && !paraBreak.MyParent.MyItemInfo.IsHigh)
{ {
paraBreak = aerParent; vlnParagraph firstLevel = paraBreak.MyParent;
while (firstLevel.MyItemInfo.IsInRNO) firstLevel = firstLevel.MyParent;
if (!firstLevel.MyItemInfo.IsHigh)
{
while (!firstLevel.MyParent.MyItemInfo.IsHigh) firstLevel = firstLevel.MyParent;
if (firstLevel.MyParent.ChildrenBelow != null && firstLevel.MyParent.ChildrenBelow.Count > 0 && firstLevel.MyParent.ChildrenBelow[0] != firstLevel &&
firstLevel.YSize < yPageSize - (myTopMsgSpace + SixLinesPerInch))
{
vlnParagraph firstLevel1 = firstLevel;
if (firstLevel.ChildrenAbove != null && firstLevel.ChildrenAbove.Count > 0) // If the aerParent has caution or note
firstLevel = firstLevel.ChildrenAbove[0];//, break on the caution or note.
if (firstLevel != lastBreak && paraBreak != firstLevel)
{
//Console.WriteLine("'{0}','{1}','{2}'", firstLevel1.MyParent.MyItemInfo.ShortPath, firstLevel1.MyItemInfo.MyTab.Text, firstLevel1.MyItemInfo.ShortPath);
paraBreak = firstLevel;
}
} }
} }
} }

View File

@ -1335,9 +1335,16 @@ namespace Volian.Print.Library
string mySep = ChildrenBelow[0].MyItemInfo.FormatStepData.Sep ?? "{Null}"; string mySep = ChildrenBelow[0].MyItemInfo.FormatStepData.Sep ?? "{Null}";
if (mySep != "{Null}" && mySep != "") if (mySep != "{Null}" && mySep != "")
para = ChildrenBelow[ChildrenBelow.Count - 1].GetFirstPieceLastPart(); para = ChildrenBelow[ChildrenBelow.Count - 1].GetFirstPieceLastPart();
else
{
// MNS Pagination - Mike Weiner Case 1a to keep step together with any non-sequential substeps (ANDs, EQ List)
bool keepEqListTogether = ChildrenBelow[0].MyItemInfo.ActiveFormat.MyStepSectionLayoutData.PutOnPageByItself;
if (keepEqListTogether && !ChildrenBelow[0].MyItemInfo.IsSequential && !this.MyItemInfo.IsHigh) // Extend to the last Item.
para = ChildrenBelow[ChildrenBelow.Count - 1].GetFirstPieceLastPart();
else else
para = ChildrenBelow[0].GetFirstPieceLastPart(); para = ChildrenBelow[0].GetFirstPieceLastPart();
} }
}
if (ChildrenRight != null && ChildrenRight.Count > 0) if (ChildrenRight != null && ChildrenRight.Count > 0)
{ {
foreach (vlnParagraph paraRight in ChildrenRight) foreach (vlnParagraph paraRight in ChildrenRight)