Logic for page breaks before Condition/Response steps
Logic for page breaks within Condition/Response steps
This commit is contained in:
parent
1aece98d43
commit
8c5703de65
@ -361,6 +361,15 @@ namespace Volian.Print.Library
|
||||
}
|
||||
// Console.WriteLine("{0},{1}", MyItemInfo.DBSequence, IsFirstSubStep(MyItemInfo)); //,instance);
|
||||
}
|
||||
private bool ParentHasCalvertMacro
|
||||
{
|
||||
get
|
||||
{
|
||||
if (HasCalvertMacro) return true;
|
||||
if (MyParent != null) return MyParent.ParentHasCalvertMacro;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private void BuildPageBreakList(float ySpaceOnCurPage, float yPageSize, bool KeepStepsOnPage)
|
||||
{
|
||||
// if this paragraph is flagged to pagebreakonstep (i.e. these are used by background documents
|
||||
@ -452,6 +461,17 @@ namespace Volian.Print.Library
|
||||
, MyItemInfo.ItemID, MyItemInfo.MyDocVersion.MyFolder.Name, MyItemInfo.ShortPath);
|
||||
break;
|
||||
}
|
||||
// if first condition/response and the parent has caution, notes or warnings then move the break to the caution, note or warning
|
||||
if (paraBreak.ParentHasCalvertMacro && paraBreak.MyParent.HasCalvertMacro && paraBreak.MyItemInfo.MyPrevious == null && paraBreak.MyParent.ChildrenAbove.Count > 0)
|
||||
{
|
||||
paraBreak = paraBreak.MyParent.ChildrenAbove[0];
|
||||
}
|
||||
// If the lastbreak was part of a condition response and the location is part of a condition response account for the size of the footer.
|
||||
if (lastBreak != null && lastBreak.ParentHasCalvertMacro && paraBreak.ParentHasCalvertMacro)
|
||||
{
|
||||
paraBreak = FindPageBreak(yStart, ySpaceOnCurPage - 12 * 4, yLowerLimit, myList, paraBreak, yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace,
|
||||
myBottomMsgSpace,MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[40].ContinueOnly);
|
||||
}
|
||||
if (lastBreak == paraBreak)
|
||||
{
|
||||
throw (new Exception(string.Format("Pagination Infinite Loop {0}",lastBreak.MyItemInfo.ShortPath)));
|
||||
|
Loading…
x
Reference in New Issue
Block a user