Make sure that SearchResults.pdf donot cause a failure.

Calculate Table Location
This commit is contained in:
Rich
2010-10-12 15:01:54 +00:00
parent e278a2ca37
commit c6d2003414
2 changed files with 85 additions and 20 deletions

View File

@@ -772,7 +772,14 @@ namespace Volian.Print.Library
if (rnoLevel < maxRNO && itemInfo.RNOs != null) yOffRight = ChildrenRight.Add(cb, itemInfo.RNOs, XOffset + RnoOffset, YTop, YTop, rnoLevel + 1, maxRNO, formatInfo);
// Need code to determine if the table will overlap the Right Column if it does then
// use YOffRight rather than yoff
if (itemInfo.Tables != null) yoff = ChildrenBelow.Add(cb, itemInfo.Tables, XOffset, yoff, yOffRight, rnoLevel, maxRNO, formatInfo);
if (itemInfo.Tables != null)
{
bool aerTableOrFigure = itemInfo.FormatStepData.Type.Contains("AER");
if(!aerTableOrFigure && itemInfo.RNOLevel == 0) // Centered Table
yoff = ChildrenBelow.Add(cb, itemInfo.Tables, XOffset, yOffRight, yOffRight, rnoLevel, maxRNO, formatInfo);
else // AER or RNO Table
yoff = ChildrenBelow.Add(cb, itemInfo.Tables, XOffset, yoff, yOffRight, rnoLevel, maxRNO, formatInfo);
}
if (itemInfo.Steps != null) yoff = ChildrenBelow.Add(cb, itemInfo.Steps, XOffset, yoff, yOffRight, rnoLevel, maxRNO, formatInfo);
if (itemInfo.Sections != null) yoff = ChildrenBelow.Add(cb, itemInfo.Sections, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo);
if (itemInfo.Procedures != null) yoff = ChildrenBelow.Add(cb, itemInfo.Procedures, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo);
@@ -794,17 +801,26 @@ namespace Volian.Print.Library
private void CalculateXOffset(ItemInfo itemInfo, int maxRNO, FormatInfo formatInfo)
{
bool aerFigure = itemInfo.FormatStepData.Type.Contains("AER");
bool aerTableOrFigure = itemInfo.FormatStepData.Type.Contains("AER");
vlnParagraph hls1 = MyParent;
while (hls1.MyParent != null && !hls1.MyItemInfo.IsHigh) hls1 = hls1.MyParent;
XOffset = hls1.XOffset + hls1.Width / 2 - Width / 2; // xoffset if AER column
if (!aerFigure)
int colR = int.Parse(formatInfo.MyStepSectionLayoutData.ColRTable.Split(",".ToCharArray())[itemInfo.ColumnMode]);
float xLowerLimit = 6; // Adjusted for HLP VE-PROMS
float xUpperLimit = hls1.XOffset + hls1.Width + colR * itemInfo.ColumnMode + 18; // Adjusted for HLP VE-PROMS
if (!aerTableOrFigure && itemInfo.RNOLevel == 0) // Centered Table of Figure
{
// adjust for RNO
int colR = int.Parse(formatInfo.MyStepSectionLayoutData.ColRTable.Split(",".ToCharArray())[itemInfo.ColumnMode]);
XOffset += (colR * maxRNO) / 2;
XOffset += (colR * itemInfo.ColumnMode) / 2;
XOffset -= (hls1.XOffset - (float)itemInfo.MyDocStyle.Layout.LeftMargin) / 2;
}
else // AER or RNO
XOffset = MyParent.XOffset + MyParent.Width / 2 - Width / 2;
//XOffset += colR * itemInfo.RNOLevel;
if (XOffset < xLowerLimit)
XOffset = xLowerLimit;
if (XOffset + Width > xUpperLimit)
XOffset = xUpperLimit - Width;
if (XOffset < (float)itemInfo.MyDocStyle.Layout.LeftMargin)
XOffsetBox = (float)itemInfo.MyDocStyle.Layout.LeftMargin;
}