diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 39ecb23b..bf99880c 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -3248,22 +3248,7 @@ namespace Volian.Print.Library // Adjust the XOffset before determining if the table will overlap the RNO column RHM 20150529 CalculateXOffsetGridOrFigure(itemInfo, maxRNO, formatInfo); - if (!itemInfo.IsInRNO && yoffRightParent > yoff && itemInfo.FormatStepData.Type.Contains("AER")) - { - // is the width of this table going to cause the table to overlap the RNO - vlnParagraph parRno = FindParentRNO(); - float xMinRno = FindMinXOffsetRno(parRno); - if (XOffset + Width > xMinRno - 12) // 12 = 2 characters, so that tables don't almost touch & look like an overlap - { - if ((float)MyItemInfo.MyDocStyle.Layout.LeftMargin + Width > xMinRno) - { - yoff = yoffRightParent; - YOffset = yoff; - } - else - XOffset = (float)MyItemInfo.MyDocStyle.Layout.LeftMargin; - } - } + yoff = AdjustLocIfLongerRNO(itemInfo, yoff, yoffRightParent); // if the table does not have a border, only move down one line: float yoffForBorder = 2 * SixLinesPerInch; if (MyFlexGrid.BorderStyle == C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None && !MyFlexGrid.TopRowHasBorder()) @@ -3321,6 +3306,7 @@ namespace Volian.Print.Library Width *= (h2/h1); } //yForCheckoff = yoff + Height - SixLinesPerInch; + yoff = AdjustLocIfLongerRNO(itemInfo, yoff, yoffRightParent); if (dropCheckoff) yForCheckoff += Height - SixLinesPerInch; // place checkoff on last row of text bool noborder = MyItemInfo.FormatStepData.Type.ToUpper().Contains("BORDERLESS"); @@ -3739,6 +3725,27 @@ namespace Volian.Print.Library if (XOffsetCenter != null) XOffset = (float)XOffsetCenter; ProfileTimer.Pop(profileDepth); } + + private float AdjustLocIfLongerRNO(ItemInfo itemInfo, float yoff, float yoffRightParent) + { + if (!itemInfo.IsInRNO && yoffRightParent > yoff && itemInfo.FormatStepData.Type.Contains("AER")) + { + // is the width of this table going to cause the table to overlap the RNO + vlnParagraph parRno = FindParentRNO(); + float xMinRno = FindMinXOffsetRno(parRno); + if (XOffset + Width > xMinRno - 12) // 12 = 2 characters, so that tables don't almost touch & look like an overlap + { + if ((float)MyItemInfo.MyDocStyle.Layout.LeftMargin + Width > xMinRno) + { + yoff = yoffRightParent; + YOffset = yoff; + } + else + XOffset = (float)MyItemInfo.MyDocStyle.Layout.LeftMargin; + } + } + return yoff; + } private float FindMinXOffsetRno(vlnParagraph parRno) { // Find the minimum xoffset in the rno column that overlaps in the y direction with