A number of pagination improvements.
This commit is contained in:
parent
5a5502d8fc
commit
86bdecd367
@ -148,25 +148,27 @@ namespace Volian.Print.Library
|
||||
//if (ySizeIncludingFirst > (yLocation - yBottomMargin) && ySizeIncludingFirst < yPageSize)
|
||||
vlnParagraph firstStepChild = firstChild;
|
||||
//while (firstStepChild.MyItemInfo.IsSection && firstStepChild.ChildrenBelow.Count > 0) firstStepChild = firstStepChild.ChildrenBelow[0];
|
||||
if(firstStepChild.MyItemInfo.IsNumbered)
|
||||
if (firstStepChild.MyItemInfo.IsNumbered)
|
||||
while (firstStepChild.ChildrenBelow.Count > 0 && (firstStepChild.MyItemInfo.IsSection || firstStepChild.MyItemInfo.IsHigh))
|
||||
{
|
||||
firstStepChild = firstStepChild.ChildrenBelow[0];
|
||||
if (!firstStepChild.MyItemInfo.IsNumbered)
|
||||
{
|
||||
firstStepChild = firstStepChild.MyParent.ChildrenBelow[firstStepChild.MyParent.ChildrenBelow.Count-1];
|
||||
firstStepChild = firstStepChild.MyParent.ChildrenBelow[firstStepChild.MyParent.ChildrenBelow.Count - 1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
firstStepChild = firstStepChild.MyParent.ChildrenBelow[firstStepChild.MyParent.ChildrenBelow.Count-1];
|
||||
firstStepChild = firstStepChild.MyParent.ChildrenBelow[firstStepChild.MyParent.ChildrenBelow.Count - 1];
|
||||
float ySizeIncludingFirstStep = firstStepChild.YSize + (firstStepChild.YTopMost - YTopMost);
|
||||
bool firstSubstepExceedsSpaceAvailable = ySizeIncludingFirstStep > yWithinMargins;
|
||||
if (KeepStepsOnPage && firstSubstepExceedsSpaceAvailable && !isFirstChild)
|
||||
KeepStepsOnPage = false;
|
||||
if (ySizeIncludingFirst == YSize) KeepStepsOnPage = false;
|
||||
float ySectionEndMsg = !_skipEndMessage && MyItemInfo.IsSection && MyItemInfo.Steps != null && MyItemInfo.Steps.Count == 1 && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? 2 * SixLinesPerInch : 0;
|
||||
if (!KeepStepsOnPage && ySizeIncludingFirst + ySectionEndMsg > (yLocation - yBottomMargin)&& ! nearTheTop)
|
||||
if (ySizeIncludingFirstStep < yWithinMargins && ySizeIncludingFirst > yWithinMargins && yWithinMargins > (yPageSize/2))
|
||||
ySizeIncludingFirst = ySizeIncludingFirstStep;
|
||||
if (!KeepStepsOnPage && (ySizeIncludingFirst + ySectionEndMsg) > (yLocation - yBottomMargin)&& ! nearTheTop)
|
||||
{
|
||||
ShowPageBreak(4, "Page Break Before Continuous Step Section", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak);
|
||||
return 1;
|
||||
@ -238,7 +240,8 @@ namespace Volian.Print.Library
|
||||
if (KeepStepsOnPage && !MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PaginateOnLowerStepLevel && ySizeIncludingFirst > yWithinMargins)
|
||||
KeepStepsOnPage = false;
|
||||
bool KeepWithHeader = isFirstChild && nearTheTop;
|
||||
if (!ManualPageBreak && mySize + yEndMsg <= yWithinMargins + yExtra) // Don't Paginate if there is enough room, will fit on page
|
||||
if (!ManualPageBreak && (mySize + yEndMsg <= yWithinMargins + yExtra) || // Don't Paginate if there is enough room, will fit on page
|
||||
(mySize <= yWithinMargins + yExtra && SpecialCaseForRobinson()))
|
||||
//if (!ManualPageBreak && mySize + yEndMsg <= yWithinMargins + SixLinesPerInch) // Don't Paginate if there is enough room, will fit on page
|
||||
{
|
||||
//Console.WriteLine("'PageBreak',1,'No','HLS will fit on page',{0},{1},{2}, {3}, {4},'{5}'", MyItemInfo.ItemID, YSize, yPageSize, yWithinMargins, (int)(100 * yWithinMargins / yPageSize), MyItemInfo.ShortPath);
|
||||
@ -291,7 +294,7 @@ namespace Volian.Print.Library
|
||||
//if (MyItemInfo.ActiveSection.DisplayText.Length < 40) sectionSpace = SixLinesPerInch;
|
||||
yPageSizeNextPage -= sectionSpace;
|
||||
yExtra -= sectionSpace;
|
||||
yExtra2 -= sectionSpace;
|
||||
//yExtra2 -= sectionSpace; // This was removed for Calvert STP O-73H-2 Section 6.3.O.4 and 6.3.R.3
|
||||
}
|
||||
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert && yPageSizeNextPage < yWithinMargins + 108 && MyItemInfo.MyPrevious == null)
|
||||
KeepStepsOnPage = true;
|
||||
@ -388,7 +391,17 @@ namespace Volian.Print.Library
|
||||
//return 2;
|
||||
throw new Exception("PageBreak Logic Missing, vlnParagraph.cs");
|
||||
}
|
||||
|
||||
private bool SpecialCaseForRobinson()
|
||||
{
|
||||
if (MyItemInfo.ActiveFormat.Name.StartsWith("CPL") &&
|
||||
MyItemInfo.MyPrevious == null &&
|
||||
MyItemInfo.NextItem == null &&
|
||||
MyItemInfo.Tables != null &&
|
||||
MyItemInfo.Cautions == null &&
|
||||
MyItemInfo.Notes == null &&
|
||||
MyItemInfo.Steps == null) return true;
|
||||
return false;
|
||||
}
|
||||
private float GetYPageSizeUseOnAllButFirstPage()
|
||||
{
|
||||
float _PointsPerPage = 792;
|
||||
@ -598,7 +611,6 @@ namespace Volian.Print.Library
|
||||
{
|
||||
if (lastBreak != null && lastBreak != paraBreak.MyParent) paraBreak = paraBreak.MyParent;
|
||||
}
|
||||
|
||||
float yLoc = ySpaceOnCurPage - (paraBreak.YOffset - (YTopMost + yTop));
|
||||
if (yLoc <= 0) // Check where it would break if the space on the page was one line shorter
|
||||
{
|
||||
@ -615,6 +627,25 @@ namespace Volian.Print.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
// If the page break is close to the lower limit and the paraBreak is bigger than the upper limit
|
||||
// and increasing the lower limit by two lines
|
||||
// Causes a significant increase (at least 2 inches) in the amount of text placed on the page and
|
||||
// the StepLevel only increases by 1 then use the paraBreak3
|
||||
else if (yLoc <= yLowerLimit + 24)
|
||||
{
|
||||
if (paraBreak.YSize > (yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace))
|
||||
{
|
||||
vlnParagraph paraBreak3 = FindPageBreak(yStart, ySpaceOnCurPage - accountForCalvertAlarmConditionResponseFooter, yLowerLimit + 144,
|
||||
myList, lastBreak, yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace,
|
||||
myBottomMsgSpace, MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[40].ContinueOnly);
|
||||
if (paraBreak3 != null)
|
||||
{
|
||||
float yLoc3 = ySpaceOnCurPage - (paraBreak3.YOffset - (YTopMost + yTop));
|
||||
if (paraBreak.MyItemInfo.StepLevel + 1 >= paraBreak3.MyItemInfo.StepLevel && (yLoc - yLoc3) > 144)//144 is 2 inches
|
||||
paraBreak = paraBreak3;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.WolfcreekCKLFormat)
|
||||
{
|
||||
if (!paraBreak.MyItemInfo.IsHigh // not a high level step
|
||||
@ -888,7 +919,8 @@ namespace Volian.Print.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
while (myPara.MyParent.YTop == myPara.YTop) myPara = myPara.MyParent;
|
||||
//while (myPara.MyParent.YTop == myPara.YTop) myPara = myPara.MyParent;
|
||||
while (myPara.MyParent != null && 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;
|
||||
bool inSameBox = InSameBox(myPara, minPara2); // if this note/caution is in same box as the break, don't break within the notes/cautions in the same box
|
||||
if (!inSameBox && myPara.ChildrenAbove.Count == 0 && wcnChkLstBorder - yLocation < yUpperLimit + yAddForBtmMsg || (everyNLines != 99 && (wcnChkLstBorder - yLocation == yUpperLimit + yAddForBtmMsg))) // Fix for OFN-RJ-23
|
||||
|
Loading…
x
Reference in New Issue
Block a user