Keep pagination code from going into an infinite loop.

Properly handle a Null WidthOverride.
Properly handle a note or caution on a section.
Remove returns from lists of data points.
This commit is contained in:
Rich
2013-12-16 20:13:51 +00:00
parent 8a6e1c1996
commit 768890116c
3 changed files with 124 additions and 114 deletions

View File

@@ -378,6 +378,7 @@ namespace Volian.Print.Library
while (((YSize - yTop) > ySpaceOnCurPage) || PageBreakOnStepList.Count > 0)
{
ySpaceOnCurPage -= myBottomMsgSpace;
vlnParagraph lastBreak = paraBreak;
paraBreak = FindPageBreak(yStart, ySpaceOnCurPage, yLowerLimit, myList, paraBreak, yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace);
if (paraBreak == null)
{
@@ -385,6 +386,10 @@ namespace Volian.Print.Library
, MyItemInfo.ItemID, MyItemInfo.MyDocVersion.MyFolder.Name, MyItemInfo.ShortPath);
break;
}
if (lastBreak == paraBreak)
{
throw (new Exception(string.Format("Pagination Infinite Loop {0}",lastBreak.MyItemInfo.ShortPath)));
}
//paraBreak.ShowPageBreak(999, paraBreak.MyItemInfo.ShortPath, "Yes",paraBreak.YTop, paraBreak.YSize, paraBreak.Height, false);
//_MyLog.InfoFormat("Place to break\r\n==>'Place to Break',{0},'{1}','{2}'"
//, paraBreak.MyItemInfo.ItemID, paraBreak.MyItemInfo.MyDocVersion.MyFolder.Name, paraBreak.MyItemInfo.ShortPath);
@@ -443,7 +448,8 @@ namespace Volian.Print.Library
&& myPara.ChildrenRight[0].YSize <= fullPage && myPara.ChildrenRight[0].YSize > spaceOnPage)
{
//_MyLog.WarnFormat("\r\nMyParaBreak {0},{1},{2},{3},{4}", myPara, myPara.YSize, yUpperLimit, myPara.ChildrenRight[0].YSize, spaceOnPage);
return myPara;
if(myPara != lastBreak)
return myPara;
}
// The following lines were added for Comanche Peak ECA-0.1A.SProcedure Steps.S17 (Printed as Step 12)
vlnParagraph myParent = myPara.MyParent;