allow for sibling paragraphs in template type tables, BGE Valve lists and Farley component lists. Problem was reported by calvert

This commit is contained in:
Kathy Ruffing 2015-03-02 13:56:39 +00:00
parent 5a21d906c1
commit 538046de45

View File

@ -311,6 +311,8 @@ namespace Volian.Print.Library
para.PartsContainer.Add(box);
}
Add(para);
if (didComponentTableRow && iChildItemInfo.Steps != null && iChildItemInfo.Steps.Count > 1)
tableBottomMost = AddComponentTableSiblings(cb, iChildItemInfo.Steps[1], xoff, para.YBottomMost, rnoLevel, maxRNO, formatInfo, yoffRight, pp);
// Calvert Alarm's caution1 is the Annunciator window, i.e. in top right of page. Adjust
// y offset for this caution that is printed BELOW the hls.
@ -372,6 +374,21 @@ namespace Volian.Print.Library
ProfileTimer.Pop(profileDepth);
return yoff;
}
private float AddComponentTableSiblings(PdfContentByte cb, ItemInfo ii, float xoff, float yoff, int rnoLevel, int maxRNO, FormatInfo formatInfo, float yoffRight, PromsPrinter pp)
{
// Some of the data for the valve lists (BGE) and component lists (FARLEY) have
// sibling data within a column, rather than hard returns within the same paragraph.
float tableBottomMost = 0;
while (ii != null)
{
vlnParagraph para = new vlnParagraph(Parent, cb, ii, xoff, yoff, rnoLevel, maxRNO, formatInfo, null, null, yoffRight, true, pp);
tableBottomMost = Math.Max(tableBottomMost, para.YBottomMost);
yoff = para.YBottomMost;
Add(para);
ii = ii.GetNextItem();
}
return tableBottomMost;
}
public float ToPdf(PdfContentByte cb, float yPageStart, ref float yTopMargin, ref float yBottomMargin)
{
foreach (vlnParagraph child in this)