If the pagebreak is occuring at a location in the AER and RNO columns, use the maximum step level to determine the proper place to break.

This commit is contained in:
Rich 2014-09-02 15:18:34 +00:00
parent c99b216e51
commit 0808404bea

View File

@ -490,6 +490,8 @@ namespace Volian.Print.Library
myList, lastBreak, yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace, myList, lastBreak, yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace,
myBottomMsgSpace,MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[40].ContinueOnly); myBottomMsgSpace,MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[40].ContinueOnly);
//Console.WriteLine("Break at {0}", paraBreak.MyItemInfo.ShortPath);//Comment Out before release //Console.WriteLine("Break at {0}", paraBreak.MyItemInfo.ShortPath);//Comment Out before release
if (lastBreak != null && lastBreak.MyItemInfo.InList(80091))
Console.WriteLine("After 80091 {0}",paraBreak.ToString());
if (paraBreak == null) if (paraBreak == null)
{ {
if (DebugPagination.IsOpen) DebugPagination.WriteLine("<<< ERROR >>> Cannot find a place to break ==>,{0},'{1}','{2}',{3},{4}" if (DebugPagination.IsOpen) DebugPagination.WriteLine("<<< ERROR >>> Cannot find a place to break ==>,{0},'{1}','{2}',{3},{4}"
@ -678,6 +680,11 @@ namespace Volian.Print.Library
{ {
float spaceOnPage = yUpperLimit + yLocation; float spaceOnPage = yUpperLimit + yLocation;
vlnParagraph myPara = myList[stepLevel][yLocation]; vlnParagraph myPara = myList[stepLevel][yLocation];
if (MaxBreakLevel(yLocation, myList) > stepLevel)
{
//DebugPagination.WriteLine("Adjust for Max StepLevel");
break;
}
if (RNOContinueOnly && !myPara.MyItemInfo.IsInRNO) if (RNOContinueOnly && !myPara.MyItemInfo.IsInRNO)
yAddForBtmMsg = myBottomMsgSpace; yAddForBtmMsg = myBottomMsgSpace;
else else
@ -787,7 +794,15 @@ namespace Volian.Print.Library
//if(minPara2 != null) DebugPagination.WriteLine("### n222222 {0}", minPara2); //if(minPara2 != null) DebugPagination.WriteLine("### n222222 {0}", minPara2);
return minPara ?? minPara2; return minPara ?? minPara2;
} }
private static int MaxBreakLevel(float yLocation, StepLevelList myList)
{
int maxLevel = 0;
foreach (int stepLevel in myList.Keys)
foreach (float yLoc in myList[stepLevel].Keys)
if (yLocation == yLoc)
maxLevel = Math.Max(stepLevel, maxLevel);
return maxLevel;
}
//private void WalkStepLevel(float yTopMost) //private void WalkStepLevel(float yTopMost)
//{ //{
// foreach (vlnParagraph child in ChildrenAbove) // foreach (vlnParagraph child in ChildrenAbove)