B2017-109: Supplemental Information preferred page breaks causes incorrect pagination of following substeps
This commit is contained in:
@@ -99,7 +99,6 @@ namespace Volian.Print.Library
|
||||
}
|
||||
else if (MyItemInfo.MyDocStyle.SupplementalInformation && MyItemInfo.IsStep)
|
||||
{
|
||||
//if (MyItemInfo.IsHigh && MyItemInfo.MyPrevious == null) return 1; // appears we don't need this line any more Forced Pagination on OR substep Ginna SAG-8 Step 1 jsj/RHM 05-19-2017
|
||||
StepConfig sci = MyItemInfo.MyConfig as StepConfig;
|
||||
if (sci.Step_PreferredPagebreak)
|
||||
{
|
||||
@@ -765,6 +764,7 @@ namespace Volian.Print.Library
|
||||
ParagraphLocations myLocations = new ParagraphLocations();
|
||||
BuildLocationList(YTopMost, myLocations);
|
||||
StepLevelList myList = myLocations.BuildStepLevelList(KeepStepsOnPage);
|
||||
SortedList<float, vlnParagraph> myPreferredBreaks = GetMyPreferredBreaks(myList);
|
||||
// Find Break Locations in the list based upon StepLevel and yLocation
|
||||
float yTop = 0;
|
||||
float yLowerLimit = (yPageSize - 2 * SixLinesPerInch) / 2;
|
||||
@@ -871,9 +871,17 @@ namespace Volian.Print.Library
|
||||
if (PageBreakOnStepList.Count > 0 && (PageBreakOnStepList[0].YTop - (lastBreak == null ? 0 : lastBreak.YTop) <= ySpaceOnCurPage))
|
||||
paraBreak = PageBreakOnStepList[0];
|
||||
else
|
||||
{
|
||||
paraBreak = FindPageBreak(yStart, ySpaceOnCurPage - accountForCalvertAlarmConditionResponseFooter - yAccountForBottomMsg, yLowerLimit,
|
||||
myList, lastBreak, yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace,
|
||||
myBottomMsgSpace, MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[40].ContinueOnly);
|
||||
// B2017-109: for supplemental information, if there is a preferred page break, account for it.
|
||||
if (myPreferredBreaks != null && myPreferredBreaks.Count > 0 && myPreferredBreaks.Keys[0] < paraBreak.YOffset)
|
||||
{
|
||||
paraBreak = myPreferredBreaks[myPreferredBreaks.Keys[0]];
|
||||
myPreferredBreaks.RemoveAt(0);
|
||||
}
|
||||
}
|
||||
yAccountForBottomMsg = 0;
|
||||
// Do Not Remove: The following is used for debug - useful place to debug
|
||||
//if (paraBreak.MyItemInfo.InList(207, 211, 214, 219, 221, 216, 197)) Console.WriteLine("BUILD2: Break at {0}", paraBreak.MyItemInfo.ShortPath);//Comment Out before release
|
||||
@@ -1194,6 +1202,30 @@ namespace Volian.Print.Library
|
||||
ProfileTimer.Pop(profileDepth);
|
||||
}
|
||||
|
||||
// The following finds all of the preferred page breaks for this step & if found adds them to a
|
||||
// list of the location & the paragraph it is on. This is used so that pagination calculations
|
||||
// occur for steps following the preferred page break rather than starting on the page after
|
||||
// substep with preferred page break (B207-109)
|
||||
private SortedList<float, vlnParagraph> GetMyPreferredBreaks(StepLevelList myList)
|
||||
{
|
||||
if (!MyItemInfo.MyDocStyle.SupplementalInformation) return null;
|
||||
SortedList<float, vlnParagraph> sdpara = null;
|
||||
foreach (int stepLevel in myList.Keys) // loop thru StepLevels, starting with lowest.
|
||||
{
|
||||
foreach (float yLocation in myList[stepLevel].Keys) // loop thru yLocation
|
||||
{
|
||||
vlnParagraph myPara = myList[stepLevel][yLocation];
|
||||
StepConfig sci = myPara.MyItemInfo.MyConfig as StepConfig;
|
||||
if (sci != null && sci.Step_PreferredPagebreak)
|
||||
{
|
||||
if (sdpara == null) sdpara = new SortedList<float, vlnParagraph>();
|
||||
sdpara.Add(-yLocation, myPara);
|
||||
}
|
||||
}
|
||||
}
|
||||
return sdpara;
|
||||
}
|
||||
|
||||
private float GetBottomContinueMessageSize(DocStyle docstyle)
|
||||
{
|
||||
float myBottomMsgSpace = 0;
|
||||
|
Reference in New Issue
Block a user