diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs index 97471622..8eb6645a 100644 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs +++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs @@ -1134,7 +1134,7 @@ namespace Volian.Print.Library plstr = plstr.Replace(token, thisDate2.ToString("H:mm")); break; case "{HLRNO}": - plstr = plstr.Replace(token, HLRNO); + plstr = HLRNO==null?"":plstr.Replace(token, HLRNO); break; case "{HLSTAB}": plstr = plstr.Replace(token, HLSTAB); diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 47f6b562..3fd009f6 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -219,8 +219,8 @@ namespace Volian.Print.Library MyPageHelper.HLSTAB = MyItemInfo.HighLevelStepTabPageList; // find the rno and use it's tab for the HLRNO part. ItemInfo rno = MyItemInfo.RNOs != null && MyItemInfo.RNOs.Count > 0 ? MyItemInfo.RNOs[0] : null; - string rnotab = (rno == null) ? MyItemInfo.MyTab.CleanText : rno.DisplayText; - MyPageHelper.HLRNO = MyItemInfo.FormatStepData.TabData.RNOIdent + rnotab; + string rnotab = (rno == null) ? null : rno.DisplayText; + MyPageHelper.HLRNO = rno == null ? null : MyItemInfo.FormatStepData.TabData.RNOIdent + rnotab; MyPageHelper.ResetSvg(); } @@ -1377,7 +1377,7 @@ namespace Volian.Print.Library } // For background formats, HLS's or Caution or any Notes have tab on line and then text // on line below (with space in between) - if (IsBackgroundStep()) yoff = YOffset = yoff + (2 * SixLinesPerInch); + if (IsBackgroundStep() && itemInfo.MyTab.AltPrintTab.Trim() != "") yoff = YOffset = yoff + (2 * SixLinesPerInch); float yForCheckoff = yoff; //0; - default checkoff row is same as FIRST line of text // if dropCheckoff is true, then the checkoff is place on the same of row as the LAST line of text @@ -1817,7 +1817,6 @@ namespace Volian.Print.Library private void CalculateXOffsetGridOrFigure(ItemInfo itemInfo, int maxRNO, FormatInfo formatInfo) { bool aerTableOrFigure = itemInfo.FormatStepData.Type.Contains("AER"); - // if (itemInfo.ColumnMode == 0) aerTableOrFigure = true; // if in single column mode, treat as an AER table for centering vlnParagraph hls1 = MyParent; while (hls1.MyParent != null && !hls1.MyItemInfo.IsHigh) hls1 = hls1.MyParent; float colR = float.Parse(formatInfo.MyStepSectionLayoutData.ColRTable.Split(",".ToCharArray())[itemInfo.ColumnMode]); @@ -1826,7 +1825,7 @@ namespace Volian.Print.Library float pageWidth = ((float)itemInfo.MyActiveSection.MyDocStyle.Layout.PageWidth); float leftMargin = ((float)itemInfo.MyActiveSection.MyDocStyle.Layout.LeftMargin); //* (float)MyItemInfo.FormatStepData.Font.CPI / 12; - if (itemInfo.IsInRNO) // && itemInfo.ColumnMode != 0) + if (itemInfo.IsInRNO) // if in rno column, the upper limit is width of the page (right margin). Subtract off size of a character xUpperLimit = pageWidth - (72 / (float)MyItemInfo.FormatStepData.Font.CPI); else @@ -1837,19 +1836,13 @@ namespace Volian.Print.Library XOffset = leftMargin + (pageWidth - leftMargin - Width) / 2; else { - //if (TableCenterPos != 0) - //{ - // XOffset = TableCenterPos; - // XOffset = XOffset - (this.Width / 2) + (float)itemInfo.MyDocStyle.Layout.LeftMargin; - //} - //else if (aerTableOrFigure || itemInfo.RNOLevel != 0) // AER or RNO - if (aerTableOrFigure || itemInfo.RNOLevel != 0) // AER or RNO - XOffset = MyParent.XOffset + MyParent.Width / 2 - Width / 2; - else if (TableCenterPos != 0) + if (TableCenterPos != 0) { XOffset = TableCenterPos; XOffset = XOffset - (this.Width / 2) + (float)itemInfo.MyDocStyle.Layout.LeftMargin; } + else if (aerTableOrFigure || itemInfo.RNOLevel != 0) // AER or RNO + XOffset = MyParent.XOffset + MyParent.Width / 2 - Width / 2; else // Centered Table or Figure { // Determine center of hls @@ -2320,7 +2313,7 @@ namespace Volian.Print.Library if (IsBackgroundStep()) { - myTab.XOffset = XOffset; + if (myTab != null ) myTab.XOffset = XOffset; XOffset += (itemInfo.FormatStepData.Font.CharsToTwips * 2); // indent 2 characters for background steps return; } @@ -2627,8 +2620,9 @@ namespace Volian.Print.Library } private float GetWidthFromTemplate(ItemInfo itemInfo, FormatInfo formatInfo) { - float rtnwid = 0; - int tpIndx = itemInfo.GetSmartTemplateIndex(); + float rtnwid= 0; + int topIndx = itemInfo.GetSmartTemplateTopLevelIndx(); + int tpIndx = itemInfo.GetSmartTemplateIndex(topIndx, (int)itemInfo.MyContent.Type); if (tpIndx != -1) { int ncol = formatInfo.PlantFormat.FormatData.Templates[tpIndx].width;