Changed an Error Message to provide the location where the error occured.

Added logic to keep un-numbered child steps together.
Changed the space on the first page to be yWithinMargins.
Changed an Error Message to provide the location where the error occured.
Changed the format of the Pagination Debug file to make comparison easier.
Used YTopMost to correctly determine how much space is left on a page.
Changed an Error Message to provide the location where the error occured.
Changed logic to keep from breaking in a caution or a note.
This commit is contained in:
Rich
2013-05-13 10:44:25 +00:00
parent dbf3129866
commit 11fe928774
4 changed files with 70 additions and 26 deletions

View File

@@ -78,15 +78,15 @@ namespace Volian.Print.Library
{
if (bxIndx != null)
{
if (box != null) box.Height = yoff - box.YOffset; // new height, with children
box = new vlnBox();
box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx];
int ln = 1; // a format flag determines whether there is a space before the note/caution.
if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++;
if (childItemInfo.MixCautionNotesDiffType()) ln += 2;
box.YOffset = yoff + ((ln - 1) * vlnPrintObject.SixLinesPerInch);
yoff += ln * vlnPrintObject.SixLinesPerInch;
}
if (box != null) box.Height = yoff - box.YOffset; // new height, with children
box = new vlnBox();
box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx];
int ln = 1; // a format flag determines whether there is a space before the note/caution.
if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++;
if (childItemInfo.MixCautionNotesDiffType()) ln += 2;
box.YOffset = yoff + ((ln - 1) * vlnPrintObject.SixLinesPerInch);
yoff += ln * vlnPrintObject.SixLinesPerInch;
}
}
bxIndex = bxIndx;
}
@@ -454,7 +454,10 @@ namespace Volian.Print.Library
DebugText.WriteLine("{0},'{1}','{2}','<<END>>',{3}", MyItemInfo.ItemID, MyItemInfo.ShortPath,MyItemInfo.MyContent.Text,XOffset);
float retval = Rtf2Pdf.GridAt(cb, MyGrid, XOffset, yLocation, Width, 100, DebugInfo, yBottomMargin, !MyItemInfo.FormatStepData.Type.Contains("Borderless"));
if (MyGrid.Height > (yTopMargin - yBottomMargin))
_MyLog.InfoFormat("\r\nTable is too big to fit on page, expect pagination problems. Table is in High Level Step {0}\r\n", MyItemInfo.MyHLS);
{
_MyLog.ErrorFormat("<<< ERROR >>> Table is too big to fit on page, expect pagination problems\r\n==>'Table Too Big',{0},'{1}','{2}',{3},{4}"
, MyItemInfo.ItemID, MyItemInfo.MyDocVersion.MyFolder.Name, MyItemInfo.ShortPath, MyGrid.Height,(yTopMargin - yBottomMargin));
}
return retval;
}
@@ -2379,7 +2382,8 @@ namespace Volian.Print.Library
int level = paraLoc.StepLevel;
if (KeepStepsOnPage && paraLoc.MyParagraph.MyItemInfo.MyContent.Type == 20001)
{
if (paraLoc.MyParagraph.MyItemInfo.MyPrevious == null)
if (DontBreakHere(paraLoc))
//if (paraLoc.MyParagraph.MyItemInfo.MyPrevious == null) // First substep
level = 0;
else
level = 1;
@@ -2388,6 +2392,19 @@ namespace Volian.Print.Library
}
return myList;
}
private bool DontBreakHere(ParagraphLocation paraLoc)
{
if (paraLoc.MyParagraph.MyItemInfo.MyPrevious == null) // First substep
return true;
vlnParagraph myPara = paraLoc.MyParagraph;
while (!myPara.MyItemInfo.IsHigh)
{
if (myPara.MyItemInfo.IsCaution) return true;
if (myPara.MyItemInfo.IsNote) return true;
myPara = myPara.MyParent;
}
return false;
}
}
public class ParagraphLocation
{