diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index a960cdf5..76162c62 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -378,6 +378,7 @@ namespace Volian.Print.Library while (((YSize - yTop) > ySpaceOnCurPage) || PageBreakOnStepList.Count > 0) { ySpaceOnCurPage -= myBottomMsgSpace; + vlnParagraph lastBreak = paraBreak; paraBreak = FindPageBreak(yStart, ySpaceOnCurPage, yLowerLimit, myList, paraBreak, yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace); if (paraBreak == null) { @@ -385,6 +386,10 @@ namespace Volian.Print.Library , MyItemInfo.ItemID, MyItemInfo.MyDocVersion.MyFolder.Name, MyItemInfo.ShortPath); break; } + if (lastBreak == paraBreak) + { + throw (new Exception(string.Format("Pagination Infinite Loop {0}",lastBreak.MyItemInfo.ShortPath))); + } //paraBreak.ShowPageBreak(999, paraBreak.MyItemInfo.ShortPath, "Yes",paraBreak.YTop, paraBreak.YSize, paraBreak.Height, false); //_MyLog.InfoFormat("Place to break\r\n==>'Place to Break',{0},'{1}','{2}'" //, paraBreak.MyItemInfo.ItemID, paraBreak.MyItemInfo.MyDocVersion.MyFolder.Name, paraBreak.MyItemInfo.ShortPath); @@ -443,7 +448,8 @@ namespace Volian.Print.Library && myPara.ChildrenRight[0].YSize <= fullPage && myPara.ChildrenRight[0].YSize > spaceOnPage) { //_MyLog.WarnFormat("\r\nMyParaBreak {0},{1},{2},{3},{4}", myPara, myPara.YSize, yUpperLimit, myPara.ChildrenRight[0].YSize, spaceOnPage); - return myPara; + if(myPara != lastBreak) + return myPara; } // The following lines were added for Comanche Peak ECA-0.1A.SProcedure Steps.S17 (Printed as Step 12) vlnParagraph myParent = myPara.MyParent; diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index fc87195c..88d97303 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -53,11 +53,11 @@ namespace Volian.Print.Library public bool IsEnhancedBackgroundFormat(ItemInfo itminfo) { - return ((itminfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds); + return ((itminfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds); } public bool IsEnhancedDeviationFormat(ItemInfo itminfo) { - return ((itminfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedDeviations) == E_PurchaseOptions.EnhancedDeviations); + return ((itminfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedDeviations) == E_PurchaseOptions.EnhancedDeviations); } public float Add(PdfContentByte cb, ItemInfoList itemInfoList, float xoff, float yoff, float yoffRight, int rnoLevel, int maxRNO, FormatInfo formatInfo) @@ -72,17 +72,17 @@ namespace Volian.Print.Library float xoffBase = xoff; foreach (ItemInfo iChildItemInfo in itemInfoList) { - if (iChildItemInfo.IsSection && (iChildItemInfo as SectionInfo).ColumnMode != maxRNO) + if (iChildItemInfo.IsSection && (iChildItemInfo as SectionInfo).ColumnMode != maxRNO) maxRNO = (iChildItemInfo as SectionInfo).ColumnMode; ItemInfo childItemInfo = iChildItemInfo; int? bxIndx = childItemInfo.FormatStepData == null ? -1 : childItemInfo.FormatStepData.StepLayoutData.STBoxindex; // if the Caution or Note is not boxed, then use ColT to set the starting column of the Note or Caution - if (((bxIndx ?? -1) == -1) && (childItemInfo.IsCaution || childItemInfo.IsNote) && !childItemInfo.IsInRNO && - !childItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.Dev_Format && + if (((bxIndx ?? -1) == -1) && (childItemInfo.IsCaution || childItemInfo.IsNote) && !childItemInfo.IsInRNO && + !childItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.Dev_Format && !IsEnhancedBackgroundFormat(childItemInfo) && !IsEnhancedDeviationFormat(childItemInfo)) //xoff += (float)childItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColT; - xoff = xoffBase + (float)childItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColT; + xoff = xoffBase + (float)childItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColT; // if in a ComponentTableFormat (FNP sub format 1, component list), column headers are defined // by the first level of children. The data for the column is the child of the column header. @@ -124,7 +124,7 @@ namespace Volian.Print.Library yoff = Add(cb, childItemInfo.Notes, xoff, yoff, yoffRight, rnoLevel, maxRNO, formatInfo); //int? bxIndx = childItemInfo.FormatStepData == null ? -1 : childItemInfo.FormatStepData.StepLayoutData.STBoxindex; bool boxHLS = false; - + // If this step has a previous, and its header is different than the previous's header. Allow it to go // into the box code. Without this check, none of the box code is run. This caused a problem // for VCS where two different type notes where not getting separate boxes. @@ -309,7 +309,7 @@ namespace Volian.Print.Library // For McGuire and Catawba, they use CustomSpacing which inserts a blank line before high level steps // if we paginate on one of these blank lines, we want to skip that blank line so that there isn't an // extra blank line at the top of the page. - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.CustomSpacing && + if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.CustomSpacing && PartsAbove[0].YOffset + yTopMargin == yPageStart && PartsAbove[0].IParagraph.Content == " ") yPageStart = yTopMargin + YOffset; else @@ -348,8 +348,8 @@ namespace Volian.Print.Library retval = DrawText(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation); } - else if (!MyItemInfo.IsStepSection - || (ShowSectionTitles + else if (!MyItemInfo.IsStepSection + || (ShowSectionTitles && !MyItemInfo.MyDocStyle.CancelSectTitle && !MyItemInfo.MyDocStyle.SpecialStepsFoldout)) // Don't ouput the Step Section title { @@ -362,7 +362,7 @@ namespace Volian.Print.Library // && !MyItemInfo.MyDocStyle.SpecialStepsFoldout // && !MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections) // && - if (sch != null && sch.Section_PrintHdr != "Y") doprint = false; + if (sch != null && sch.Section_PrintHdr != "Y") doprint = false; } if (MyItemInfo.MyContent.MyGrid != null) retval = DrawGrid(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation); @@ -370,13 +370,13 @@ namespace Volian.Print.Library if (doprint) retval = DrawText(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation); if (MyItemInfo.IsHigh) { - MyPageHelper.PageBookmarks.Add(MyItemInfo, (MyItemInfo.MyTab == null)?"":MyItemInfo.MyTab.CleanText + " " + MyItemInfo.DisplayText, + MyPageHelper.PageBookmarks.Add(MyItemInfo, (MyItemInfo.MyTab == null) ? "" : MyItemInfo.MyTab.CleanText + " " + MyItemInfo.DisplayText, new PdfDestination(PdfDestination.FITBH, yLocation + YVeryTop - YTopMost + SixLinesPerInch)); } } if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.WolfcreekCKLFormat) { - DrawChkOrValveTableLines(cb, MyItemInfo, yPageStart, yTopMargin, yBottomMargin, yLocation); + DrawChkOrValveTableLines(cb, MyItemInfo, yPageStart, yTopMargin, yBottomMargin, yLocation); } if (MyItemInfo.IsSection) { @@ -405,7 +405,7 @@ namespace Volian.Print.Library private void DrawChkOrValveTableLines(PdfContentByte cb, ItemInfo ii, float yPageStart, float yTopMargin, float yBottomMargin, float yLocation) { if (!ii.IsStep || ii.IsCaution || ii.IsNote) return; - + Box bx = ii.ActiveFormat.PlantFormat.FormatData.BoxList[0]; float lpi = MyPageHelper.YMultiplier == 1.0 ? SixLinesPerInch : _SevenLinesPerInch; bool savedebug = Rtf2Pdf.PdfDebug; @@ -434,7 +434,7 @@ namespace Volian.Print.Library // just list the headers and the prefix can be 'empty'. if (ii.FormatStepData.Font.FontIsProportional()) { - float yLocVertLine = yLocation + (lpi/2); + float yLocVertLine = yLocation + (lpi / 2); // Prefix, i.e. Top line: Paragraph topLeftLine = new Paragraph(bx.BXULC, iSymblFont); Rtf2Pdf.TextAt(cb, topLeftLine, float.Parse(vertPos[0]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin); @@ -463,11 +463,11 @@ namespace Volian.Print.Library //countLine = (int)(this.Height / lpi); Paragraph sideLeftLine = new Paragraph(bx.BXMLS, iSymblFont); Rtf2Pdf.TextAt(cb, sideLeftLine, float.Parse(vertPos[0]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin); - Rtf2Pdf.TextAt(cb, sideLeftLine, float.Parse(vertPos[0]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine-(2*lpi), lWidth, 100, null, yBottomMargin); + Rtf2Pdf.TextAt(cb, sideLeftLine, float.Parse(vertPos[0]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine - (2 * lpi), lWidth, 100, null, yBottomMargin); Paragraph sideRightLine = new Paragraph(bx.BXMRS, iSymblFont); Rtf2Pdf.TextAt(cb, sideRightLine, float.Parse(vertPos[6]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin); Rtf2Pdf.TextAt(cb, sideRightLine, float.Parse(vertPos[6]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine - (2 * lpi), lWidth, 100, null, yBottomMargin); - + // now do the lines with the 'T' type lines for top/bottom of vertical lines. thPos = float.Parse(vertPos[0]) + csize; while (thPos < float.Parse(vertPos[cntVertPos - 1])) @@ -479,7 +479,7 @@ namespace Volian.Print.Library // now do the vertical bar between header words and the column header words. yLocVertLine -= lpi; - string [] colHdrs = _MyItemInfo.FormatStepData.Suffix.Substring(_MyItemInfo.FormatStepData.Suffix.IndexOf(";")+1).Split(",".ToCharArray()); + string[] colHdrs = _MyItemInfo.FormatStepData.Suffix.Substring(_MyItemInfo.FormatStepData.Suffix.IndexOf(";") + 1).Split(",".ToCharArray()); iTextSharp.text.Font iHdrFont = Volian.Svg.Library.VolianPdf.GetFont(_MyItemInfo.FormatStepData.Font.WindowsFont); iHdrFont.Color = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Black)); @@ -491,7 +491,7 @@ namespace Volian.Print.Library // do vertical line: Rtf2Pdf.TextAt(cb, paraVertLine, float.Parse(vertPos[i]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin); // do the column header text - center it: - if (i (yTopMargin - yBottomMargin)) { _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)); + , MyItemInfo.ItemID, MyItemInfo.MyDocVersion.MyFolder.Name, MyItemInfo.ShortPath, MyGrid.Height, (yTopMargin - yBottomMargin)); } return retval; } @@ -651,14 +651,14 @@ namespace Volian.Print.Library } return retval; } - private static List myAttributes =new List(); + private static List myAttributes = new List(); private static void AddAttribute(string attr) - { - if (myAttributes.Contains(attr)) - return; - //Console.WriteLine("Attribute = \"{0}\"", attr); - myAttributes.Add(attr); - } + { + if (myAttributes.Contains(attr)) + return; + //Console.WriteLine("Attribute = \"{0}\"", attr); + myAttributes.Add(attr); + } private void CheckAttributes(System.Collections.Hashtable attributes) { foreach (string attr in attributes.Keys) @@ -683,8 +683,8 @@ namespace Volian.Print.Library CheckAttributes(chk.Attributes); if (chk.Font.BaseFont != null && chk.Font.BaseFont.PostscriptFontName.ToUpper().Contains("BOLD")) { - prefix += "\xD5"; - suffix = "\xD6" + suffix; + prefix += "\xD5"; + suffix = "\xD6" + suffix; } if (chk.Attributes.ContainsKey("SUBSUPSCRIPT")) { @@ -699,7 +699,7 @@ namespace Volian.Print.Library prefix += "\xD1"; suffix = "\xA6" + suffix; } - + } if (chk.Attributes.ContainsKey("UNDERLINE")) { @@ -741,8 +741,8 @@ namespace Volian.Print.Library { get { - return string.Format("DebugID = {0}, ID={1} Type={2} TypeName='{3}' StepLevel={4} DBSequence={5} Width={6} Left={7}", - DebugId, MyItemInfo.ItemID, MyItemInfo.FormatStepType, MyItemInfo.FormatStepData==null?"NoStepData":MyItemInfo.FormatStepData.Type, MyItemInfo.StepLevel, MyItemInfo.DBSequence, Width, XOffset); + return string.Format("DebugID = {0}, ID={1} Type={2} TypeName='{3}' StepLevel={4} DBSequence={5} Width={6} Left={7}", + DebugId, MyItemInfo.ItemID, MyItemInfo.FormatStepType, MyItemInfo.FormatStepData == null ? "NoStepData" : MyItemInfo.FormatStepData.Type, MyItemInfo.StepLevel, MyItemInfo.DBSequence, Width, XOffset); } } private void ResetDocStyleAndValues(ref float yTopMargin, ref float yBottomMargin) @@ -899,7 +899,7 @@ namespace Volian.Print.Library break; } if (!PageBreakOnStep) - MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, docstyle.Layout.LeftMargin + XOffsetBox + docstyle.Continue.Bottom.Margin ?? 0, msg_yLocation, docstyle.Continue.Bottom.Font);// MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font); + MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, docstyle.Layout.LeftMargin + XOffsetBox + docstyle.Continue.Bottom.Margin ?? 0, msg_yLocation, docstyle.Continue.Bottom.Font);// MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font); } if (PageBreakOnStep) MyPageHelper.BottomMessage = null; cb.PdfDocument.NewPage(); @@ -915,7 +915,7 @@ namespace Volian.Print.Library cb.PdfDocument.NewPage(); _MyLog.InfoFormat("NewPage Break within step blank {0}", cb.PdfWriter.CurrentPageNumber); } - + // if there is a 'container vlnbox' around the HLS, flag that the drawn box must also break: if (MyHighLevelParagraph != null && MyHighLevelParagraph.PartsContainer != null && MyHighLevelParagraph.PartsContainer.Count > 0) { @@ -933,7 +933,7 @@ namespace Volian.Print.Library // If there is a box, adjust the yTopMost to include it. float yTopMost = YTopMost; //if (YVeryTop < yTopMost) Console.WriteLine("{0},{1},{2}", MyItemInfo.DBSequence, yTopMost, YVeryTop); - yTopMost = Math.Min(yTopMost,YVeryTop); + yTopMost = Math.Min(yTopMost, YVeryTop); yPageStart = yTopMargin + yTopMost;// -2 * SixLinesPerInch; DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart); if (EmptyTopMostPart) yPageStart += SixLinesPerInch; @@ -944,7 +944,7 @@ namespace Volian.Print.Library if (myMsg.IndexOf(@"%d") > -1) myMsg = myMsg.Replace(@"%d", MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols.Trim(" .".ToCharArray())); if (!PageBreakOnStep) - MyPageHelper.TopMessage = new vlnText(cb, this, myMsg, myMsg, docstyle.Layout.LeftMargin + XOffsetBox + docstyle.Continue.Top.Margin ?? 0, yTopMargin + 0.1F, docstyle.Continue.Top.Font);// MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font); + MyPageHelper.TopMessage = new vlnText(cb, this, myMsg, myMsg, docstyle.Layout.LeftMargin + XOffsetBox + docstyle.Continue.Top.Margin ?? 0, yTopMargin + 0.1F, docstyle.Continue.Top.Font);// MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font); else MyPageHelper.TopMessage = null; } @@ -1009,7 +1009,7 @@ namespace Volian.Print.Library DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart); break; } - + // If "doSectionTitleContinued" is true then print the section title with "(Continued)" appended to it // format must have ContinueSectinHeader format flag set to true if (doSectionTitleContinued) @@ -1068,8 +1068,8 @@ namespace Volian.Print.Library if (myMsg.Contains("{Section Number}")) myMsg = myMsg.Replace("{Section Number}", MyItemInfo.ActiveSection.DisplayNumber); //jcb code - if(myMsg.Contains("%-8s")) - myMsg = myMsg.Replace("%-8s",MyItemInfo.MyProcedure.DisplayNumber.PadRight(8)); + if (myMsg.Contains("%-8s")) + myMsg = myMsg.Replace("%-8s", MyItemInfo.MyProcedure.DisplayNumber.PadRight(8)); //end jb code // center the message. float wtpm = (float)docstyle.Layout.PageWidth - (float)docstyle.Layout.LeftMargin; @@ -1109,7 +1109,7 @@ namespace Volian.Print.Library { get { - if (ChildrenAbove.Count>0) return ChildrenAbove[0].TopMostChild; + if (ChildrenAbove.Count > 0) return ChildrenAbove[0].TopMostChild; return this; } } @@ -1145,15 +1145,15 @@ namespace Volian.Print.Library private float _YVeryTop = -1; public float YVeryTop { - get + get { if (_YVeryTop == -1) { _YVeryTop = YTop; - _YVeryTop = VeryTop(PartsAbove,_YVeryTop); - _YVeryTop = VeryTop(PartsContainer,_YVeryTop); + _YVeryTop = VeryTop(PartsAbove, _YVeryTop); + _YVeryTop = VeryTop(PartsContainer, _YVeryTop); } - return _YVeryTop; + return _YVeryTop; } } @@ -1228,7 +1228,7 @@ namespace Volian.Print.Library } if (ChildrenRight != null && ChildrenRight.Count > 0) { - foreach(vlnParagraph paraRight in ChildrenRight) + foreach (vlnParagraph paraRight in ChildrenRight) { vlnParagraph paraRightLast = paraRight.GetFirstPieceLastPart(); if (paraRightLast.YBottom > para.YBottom) @@ -1249,10 +1249,10 @@ namespace Volian.Print.Library // the original list because list items cannot be removed in a // 'foreach'. List CleanupListStepLevel = new List(); - foreach(int stepLevel in myList.Keys) + foreach (int stepLevel in myList.Keys) { List CleanupListYLocation = new List(); - SortedList AdjustYLocation = new SortedList(); + SortedList AdjustYLocation = new SortedList(); foreach (float yLocation in myList[stepLevel].Keys) { if (-yLocation <= yTop) @@ -1271,7 +1271,7 @@ namespace Volian.Print.Library // from the beginning of the step. // Note that yLocation is negative to have items in descending // order so that adding yTop decrements their values. - myList[stepLevel].Add(yTop-yLocation, para); + myList[stepLevel].Add(yTop - yLocation, para); } if (myList[stepLevel].Count == 0) CleanupListStepLevel.Add(stepLevel); @@ -1412,7 +1412,7 @@ namespace Volian.Print.Library } MetaLevel = MetaLevel <= 2 ? 1 : MetaLevel - 1; if (MetaLevel == 1) - offset += (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos; + offset += (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos; else { xMetaAdj = (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[0].ColSByLevel; @@ -1435,7 +1435,7 @@ namespace Volian.Print.Library if (itemInfo.MyTab.AltPrintTab != null) mytab = new vlnTab(cb, this, itemInfo.MyTab.AltPrintTab, itemInfo.MyTab.AltPrintTab, localXOffset, yoff, itemInfo.MyTab.MyFont, doSectTab, StepRTB.MySymbolFontName, itemInfo.MyTab.RemovedStyleUnderline); else - mytab = new vlnTab(cb, this, itemInfo.MyTab.Text, itemInfo.MyTab.CleanText, localXOffset, yoff, itemInfo.MyTab.MyFont, doSectTab, StepRTB.MySymbolFontName, itemInfo.MyTab.RemovedStyleUnderline); + mytab = new vlnTab(cb, this, itemInfo.MyTab.Text, itemInfo.MyTab.CleanText, localXOffset, yoff, itemInfo.MyTab.MyFont, doSectTab, StepRTB.MySymbolFontName, itemInfo.MyTab.RemovedStyleUnderline); PartsLeft.Add(mytab); if (mytab.MyMacro != null) PartsLeft.Add(mytab.MyMacro); } @@ -1458,7 +1458,7 @@ namespace Volian.Print.Library Width -= (float)itemInfo.ActiveFormat.MyStepSectionLayoutData.SingleColumnRNOIndent; offset -= Width; float inc = offset - XOffset; - if(mytab != null) + if (mytab != null) mytab.XOffset += inc;// +(itemInfo.MyParent.IsHigh ? 6.8f : 0); XOffset += inc; adjustAgain = false; @@ -1484,13 +1484,13 @@ namespace Volian.Print.Library if (adjusttab != 0) Width += (mytab.Width); } } - if(adjustAgain) - AdjustXOffsetForTab(itemInfo, maxRNO, formatInfo, mytab, xMetaAdj); + if (adjustAgain) + AdjustXOffsetForTab(itemInfo, maxRNO, formatInfo, mytab, xMetaAdj); if (UseTemplateWidthOrXOff(itemInfo)) XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + GetWidthOrStartFromTemplate(itemInfo, itemInfo.ActiveFormat, false); if (itemInfo.MyHeader != null && itemInfo.MyHeader.Text != null && !doSectTab) yoff += SetHeader(this, cb, itemInfo, formatInfo); float yoffLeft = yoff; - if (ChildrenAbove != null) + if (ChildrenAbove != null) ChildrenAbove.StepDesignator = null; //reset StepDesignator if (itemInfo.Cautions != null && !(itemInfo.IsCaution || itemInfo.IsNote)) { @@ -1518,8 +1518,8 @@ namespace Volian.Print.Library if (ChildrenAbove.StepDesignator != null) { string pref = ChildrenAbove.StepDesignator; - float colOvrd = (float)(ChildrenAbove.StepDesignatorColumn??0); - float xPref = (colOvrd > 0)? colOvrd : mytab.XOffset - (pref.Length * (72 / (float)_MyItemInfo.FormatStepData.Font.CPI)); + float colOvrd = (float)(ChildrenAbove.StepDesignatorColumn ?? 0); + float xPref = (colOvrd > 0) ? colOvrd : mytab.XOffset - (pref.Length * (72 / (float)_MyItemInfo.FormatStepData.Font.CPI)); PartsLeft.Add(new vlnText(cb, this, pref, pref, xPref, yoff, ChildrenAbove.StepDesignatorFont)); ChildrenAbove.StepDesignator = null; ChildrenAbove.StepDesignatorColumn = null; @@ -1538,7 +1538,7 @@ namespace Volian.Print.Library float addExtraSpace = 0; if (MyItemInfo.FormatStepData != null && MyItemInfo.ActiveFormat.MyStepSectionLayoutData.CustomSpacing) addExtraSpace = MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace ?? 0; - if (MyItemInfo.MyParent != null && MyItemInfo.MyParent.FormatStepData != null && + if (MyItemInfo.MyParent != null && MyItemInfo.MyParent.FormatStepData != null && MyItemInfo.MyParent.FormatStepData.Type != "TitleWithTextRight") addExtraSpace = (MyItemInfo.FormatStepData == null) ? 0 : MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace ?? 0; // If a high level step, the 16bit code uses the value of the extra space @@ -1554,7 +1554,7 @@ namespace Volian.Print.Library //if (YOffset != 0 && MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.CustomSpacing) if (YOffset != 0 && MyItemInfo.IsSection && MyItemInfo.ActiveFormat.MyStepSectionLayoutData.CustomSpacing) addExtraSpace = (float)MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[25].StepLayoutData.STExtraSpace; - if (YOffset != 0 && MyItemInfo.FormatStepData != null && + if (YOffset != 0 && MyItemInfo.FormatStepData != null && MyItemInfo.MyPrevious == null && MyItemInfo.FormatStepData.ThreeBlanksAbove) addExtraSpace = 24; // already has one blank line above, added two more //if (YOffset != 0 && MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace > 0) @@ -1563,10 +1563,10 @@ namespace Volian.Print.Library // extra space: if (itemInfo.IsHigh && (itemInfo.Cautions != null || itemInfo.Notes != null)) { - if ((itemInfo.Cautions != null && itemInfo.Cautions[0].FormatStepData.AlwaysUseExtraLines) || (itemInfo.Notes != null && itemInfo.Notes[0].FormatStepData.AlwaysUseExtraLines)) + if ((itemInfo.Cautions != null && itemInfo.Cautions[0].FormatStepData.AlwaysUseExtraLines) || (itemInfo.Notes != null && itemInfo.Notes[0].FormatStepData.AlwaysUseExtraLines)) addExtraSpace = 0; } - if (addExtraSpace > 0 && MyItemInfo.FormatStepData != null) + if (addExtraSpace > 0 && MyItemInfo.FormatStepData != null) this.PartsAbove.Add(new vlnText(cb, this, " ", " ", 72, yoff, MyItemInfo.FormatStepData.Font)); yoff += addExtraSpace; @@ -1586,7 +1586,7 @@ namespace Volian.Print.Library // the '-24' in x-direction & '+4' in y-direction was used for the SHE format to get the continuous // HLS's asterisk to match 16bit. The font size was set at 16 to make it match also: VE_Font astFont = new VE_Font(MyItemInfo.FormatStepData.TabData.Font.Family, 16, E_Style.Bold, 10); - vlnText myAsterisk = new vlnText(cb, this, "*", "*", mytab.XOffset - 24, YOffset+4, astFont); + vlnText myAsterisk = new vlnText(cb, this, "*", "*", mytab.XOffset - 24, YOffset + 4, astFont); PartsLeft.Add(myAsterisk); } if (itemInfo.IsRNOPart && rnoLevel > maxRNO) @@ -1605,7 +1605,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() && itemInfo.MyTab.AltPrintTab.Trim() != "") + 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 @@ -1791,7 +1791,7 @@ namespace Volian.Print.Library { // if this item's content is empty, and the flag is set to 'notonempty', don't print out the // checkoff - this was added for shearon harris: - if (!(co.NotOnEmpty && itemInfo.MyContent.Text.Replace(@"\u160?"," ").TrimEnd() == "")) + if (!(co.NotOnEmpty && itemInfo.MyContent.Text.Replace(@"\u160?", " ").TrimEnd() == "")) { float xloc_co = (float)itemInfo.MyDocStyle.Layout.LeftMargin; // if the format has 'SkipSpaces', look at the tab, and back up the macros to the number of @@ -1820,7 +1820,7 @@ namespace Volian.Print.Library float RnoOffset = ToInt(formatInfo.MyStepSectionLayoutData.ColRTable, maxRNO); 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) @@ -1860,14 +1860,14 @@ namespace Volian.Print.Library 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); // Don't add the RNO to print if doing backgrounds. That piece of data is part of the pagelist item. - if (rnoLevel >= maxRNO && itemInfo.RNOs != null && + if (rnoLevel >= maxRNO && itemInfo.RNOs != null && !itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.WolfCreekBackgroundFormat && - !itemInfo.RNOs[0].FormatStepData.InPageList) + !itemInfo.RNOs[0].FormatStepData.InPageList) yoff = ChildrenBelow.Add(cb, itemInfo.RNOs, XOffset, yoff, yoff, rnoLevel + 1, maxRNO, formatInfo); yoff = Math.Max(yoff, yOffRight); // TODO - use RNOSepAfterAER flag too: string tmpRnoSepStr = formatInfo.MyStepSectionPrintData.RNOSepString; - float tmpRnoSepLen = formatInfo.MyStepSectionPrintData.RNOSepLineLength??0; + float tmpRnoSepLen = formatInfo.MyStepSectionPrintData.RNOSepLineLength ?? 0; if (rnoLevel < maxRNO && itemInfo.RNOs != null && (tmpRnoSepStr != null || tmpRnoSepLen != 0)) { vlnParagraph rno = ChildrenRight[0]; @@ -1946,7 +1946,7 @@ namespace Volian.Print.Library // 2) If a continuous section, and it doesn't start at 'top' of the page, then the checkoff header is // printed on the same line as the continuous section. Support for this is here, the check off header is added // to the 'PartRight' off of the section's VlnParagraph. - + // First see if there is any checkoff data in the format file and that there // is a pagelist item for the checkoff header. if (itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffList.Count <= 0) return; @@ -1967,7 +1967,7 @@ namespace Volian.Print.Library } } else - mySubSectionInfo = (mySectionInfo.Sections == null)?null:mySectionInfo.Sections[0]; + mySubSectionInfo = (mySectionInfo.Sections == null) ? null : mySectionInfo.Sections[0]; if (mySectionInfo == mySubSectionInfo) mySubSectionInfo = null; @@ -1978,23 +1978,23 @@ namespace Volian.Print.Library // If no subsections, output with section // If subsections and continuous section, put out on same line as subsection. (done here) // If subsections and starts at top of page, (on top of page, use pagelist code in VlnSvgPageHelper) - + // Get SectionInfos to access specific section config items... - SectionInfo si = SectionInfo.Get(mySectionInfo.ItemID); + SectionInfo si = SectionInfo.Get(mySectionInfo.ItemID); int sindx = si.CheckOffHeadingIndex(); SectionInfo subi = mySubSectionInfo == null ? null : SectionInfo.Get(mySubSectionInfo.ItemID); - int subindx = subi==null?-1:subi.CheckOffHeadingIndex(); + int subindx = subi == null ? -1 : subi.CheckOffHeadingIndex(); // if there is no subsections & the main section doesn't use a header OR // if there is a subsection, & it does not use a header... Return. - if ((subi==null&&sindx < 1) || (subi!=null&&subindx<1)) return; + if ((subi == null && sindx < 1) || (subi != null && subindx < 1)) return; // figure out location now: // if step, it uses pagelist logic to locate it (this is a page break condition). // if continuous, put out with subsection if there is one, otherwise section. // otherwise, use pagelist logic. bool usePageListCOHdr = false; - + if (itemInfo.IsStep) usePageListCOHdr = true; else if (subi == null) //no subsection @@ -2008,7 +2008,7 @@ namespace Volian.Print.Library } // grab the string from the format, depending on whether it should get it from the section or subsection. - string cohead = (mySubSectionInfo!=null)?mySubSectionInfo.SectionCheckOffHeader:mySectionInfo.SectionCheckOffHeader; + string cohead = (mySubSectionInfo != null) ? mySubSectionInfo.SectionCheckOffHeader : mySectionInfo.SectionCheckOffHeader; if (cohead == "" || cohead == null) return; // PageListCheckOffHeader is an svgtext - but really we only need the x/y location for this (pagelist support) @@ -2074,7 +2074,7 @@ namespace Volian.Print.Library // in the following calculation, the hls width (hls1.Width) == rno column width, so xUpperLimit is // the around the right margin, i.e. 'hls xoffset' + 'location of rno (colR) * columnmode' + 'width of rno' xUpperLimit = hls1.XOffset + hls1.Width + colR * itemInfo.ColumnMode; - + float TableCenterPos = float.Parse(formatInfo.MyStepSectionLayoutData.TableCenterPos.Split(",".ToCharArray())[itemInfo.ColumnMode]); if (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel) XOffset = leftMargin + (pageWidth - leftMargin - Width) / 2; @@ -2112,7 +2112,7 @@ namespace Volian.Print.Library // the amount of difference from a 10 CPI to a 12 CPI font. See comment above. float posAdjust = (float)(itemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0); if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.StepPrintData != null && - posAdjust>0) + posAdjust > 0) { if (Width < hls1.Width - posAdjust) XOffset += posAdjust; @@ -2137,7 +2137,7 @@ namespace Volian.Print.Library { if (MyParent != null && MyParent.MyItemInfo.FormatStepData != null && MyParent.MyItemInfo.FormatStepData.Type == "TitleWithTextRight") return 0; if (MyItemInfo.MyDocStyle.SpecialStepsFoldout) return 0; - if (MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.Prefix != null && MyItemInfo.FormatStepData.Suffix != null && MyItemInfo.FormatStepData.UseSmartTemplate) return 0; + if (MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.Prefix != null && MyItemInfo.FormatStepData.Suffix != null && MyItemInfo.FormatStepData.UseSmartTemplate) return 0; int everyNLines = MyItemInfo.FormatStepData == null ? 1 : MyItemInfo.FormatStepData.StepLayoutData.EveryNLines ?? 1; if (everyNLines == -99) return 0; if (MyItemInfo.Ordinal % everyNLines == 0 || MyItemInfo.NextItem == null) return SixLinesPerInch; @@ -2185,11 +2185,11 @@ namespace Volian.Print.Library ChangeBarData cbd = formatInfo.PlantFormat.FormatData.ProcData.ChangeBarData; float cols = formatInfo.MyStepSectionLayoutData.ColS ?? 0; float colr = ToInt(formatInfo.MyStepSectionLayoutData.ColRTable, maxRNO); -// FixedChangeColumn + - Column location for change bars + // FixedChangeColumn + - Column location for change bars // 0 - Separate AER and RNO change bars to the right of the text // -10 to -1 - Change bars on left (specify # of columns from the text) // <-10 - AER change bars on the left and RNO change bars on the right. -// FixedAERChangeColumn overrides the -5 default setting in chgbar.c, value is converted to a negative by the code + // FixedAERChangeColumn overrides the -5 default setting in chgbar.c, value is converted to a negative by the code float col = (cbd.AbsoluteFixedChangeColumn) ? ((cbd.FixedAERChangeColumn ?? 0) > 0) ? @@ -2213,14 +2213,14 @@ namespace Volian.Print.Library } else if (myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.RevNum) { - + string lRev = myPageHelper.Rev; // Now check the format flags to determine if/how the Rev string should be parsed. if ((itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate && lRev.Contains("/")) || (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash && lRev.Contains("\\"))) { int indx = lRev.IndexOf(itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate ? '/' : '\\'); - cbMess = lRev.Substring(0, indx>-1?indx:lRev.Length); + cbMess = lRev.Substring(0, indx > -1 ? indx : lRev.Length); } else cbMess = lRev; @@ -2246,7 +2246,7 @@ namespace Volian.Print.Library Box bxCautNote = null; // used for notes and cautions in the Prairie Island Alarms format if (MyItemInfo.IsCaution || MyItemInfo.IsNote) { - // Temporary fix for change bars on Notes and Cautions where the FixedChgCol < -10 + // Temporary fix for change bars on Notes and Cautions where the FixedChgCol < -10 tmpc = (float)formatInfo.MyStepSectionLayoutData.ColT + (float)formatInfo.MyStepSectionLayoutData.WidT; // end position of Caution / Note int typ = (int)(MyItemInfo.MyContent.Type % 10000); int? bxIndx = formatInfo.PlantFormat.FormatData.StepDataList[typ].StepLayoutData.STBoxindex; @@ -2321,7 +2321,7 @@ namespace Volian.Print.Library _RtfSB.Append(AddFontTable(myFont)); _RtfSB.Append(vlntxt.StartText); if (_MyItemInfo.IsStep && !itemInfo.FormatStepData.UseSmartTemplate && _MyItemInfo.FormatStepData.Suffix != null && _MyItemInfo.FormatStepData.Suffix != "") - _RtfSB.Append(_MyItemInfo.FormatStepData.Suffix.Replace("{ulnone}",@"\ulnone ")); + _RtfSB.Append(_MyItemInfo.FormatStepData.Suffix.Replace("{ulnone}", @"\ulnone ")); _RtfSB.Append("}"); string rtf = _RtfSB.ToString(); UnderlineTerminateList utl = MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.UnderlineTerminateList; @@ -2354,7 +2354,7 @@ namespace Volian.Print.Library float hdrWidth = (itemInfo.MyHeader.CleanText == null) ? 0 : itemInfo.MyHeader.CleanText.Length * 6; int typ = ((int)itemInfo.MyContent.Type) % 10000; int? bxIndx = formatInfo.PlantFormat.FormatData.StepDataList[typ].StepLayoutData.STBoxindex; - + if (itemInfo.MyHeader.Justify == System.Drawing.ContentAlignment.MiddleCenter) { if (bxIndx != null) @@ -2374,7 +2374,7 @@ namespace Volian.Print.Library xoff = XOffset; // XOffset has left margin included vlnHeader myHeader = new vlnHeader(this, cb, itemInfo.MyHeader.Text, itemInfo.MyHeader.CleanText.TrimStart(" ".ToCharArray()), xoff, YOffset, itemInfo.MyHeader.MyFont); PartsAbove.Add(myHeader); - return myHeader.Height + (!MyItemInfo.MyDocStyle.SpecialStepsFoldout || (MyItemInfo.MyDocStyle.ExtraLineHeader&&(MyItemInfo.IsCaution||MyItemInfo.IsNote)) ? SixLinesPerInch : 0); + return myHeader.Height + (!MyItemInfo.MyDocStyle.SpecialStepsFoldout || (MyItemInfo.MyDocStyle.ExtraLineHeader && (MyItemInfo.IsCaution || MyItemInfo.IsNote)) ? SixLinesPerInch : 0); } private float AdjustToCharPosition(float position, float? CPI) { @@ -2475,7 +2475,7 @@ namespace Volian.Print.Library private vlnTab _MyTab; public vlnTab MyTab { - get + get { if (_MyTab == null) { @@ -2488,7 +2488,7 @@ namespace Volian.Print.Library } } } - return _MyTab; + return _MyTab; } } private vlnPrintObjects _PartsAbove; @@ -2587,7 +2587,7 @@ namespace Volian.Print.Library iilvl = iilvl.MyParent; } level = level <= 2 ? 1 : level - 1; - if (level==1) + if (level == 1) XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (level * (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos); else { @@ -2604,13 +2604,13 @@ namespace Volian.Print.Library if (IsBackgroundStep()) { - if (myTab != null ) myTab.XOffset = XOffset; + if (myTab != null) myTab.XOffset = XOffset; XOffset += (itemInfo.FormatStepData.Font.CharsToTwips * 2); // indent 2 characters for background steps return; } else if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.Type == "TitleWithTextBelow") { - if ((colOvrd??0) != 0) + if ((colOvrd ?? 0) != 0) XOffset = (float)colOvrd; else XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin; @@ -2618,7 +2618,7 @@ namespace Volian.Print.Library } else if (itemInfo.MyParent.FormatStepData != null && itemInfo.MyParent.FormatStepData.Type == "TitleWithTextBelow") { - float childindent = itemInfo.MyParent.FormatStepData.ChildIndent??0; + float childindent = itemInfo.MyParent.FormatStepData.ChildIndent ?? 0; if (myTab != null) { float delta = childindent + MyParent.XOffset - myTab.XOffset; @@ -2631,7 +2631,7 @@ namespace Volian.Print.Library } else if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.Type == "TitleWithTextRight") { - if ((colOvrd??0) != 0) + if ((colOvrd ?? 0) != 0) XOffset = (float)colOvrd; else XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin; @@ -2647,11 +2647,11 @@ namespace Volian.Print.Library { float x = 0; float xoff = 0; - if ((colOvrd??0)!=0) + if ((colOvrd ?? 0) != 0) x = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)colOvrd; else x = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS; - + xoff = x - XOffset; // ColSByLevel will specify the column in which the High Level Step starts with // respect to the overall level calculation based on sections & meta-sections. @@ -2663,7 +2663,7 @@ namespace Volian.Print.Library float colsbylevel = (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].ColSByLevel; float seclvlindent = colsbylevel - (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS; float adjCols = (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS + seclvlindent; - float xtabcol = adjCols - ((myTab==null||myTab.Text==null)?0:(myTab.Text.Length * 7.2f)); + float xtabcol = adjCols - ((myTab == null || myTab.Text == null) ? 0 : (myTab.Text.Length * 7.2f)); if (indxLevel > 1 && myTab != null) myTab.XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + xtabcol; else if (myTab != null) myTab.XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + colsbylevel; if (myTab != null) @@ -2823,7 +2823,8 @@ namespace Volian.Print.Library if (itemInfo.IsStep && itemInfo.MyHLS != null && UseTemplateWidthOrXOff(itemInfo) && (xwid = GetWidthOrStartFromTemplate(itemInfo, formatInfo, true)) > 0) widOvrd = xwid; else - widOvrd = itemInfo.FormatStepData == null ? null : (float?)ToInt(itemInfo.FormatStepData.WidthOverride, maxRNO); + widOvrd = itemInfo.FormatStepData == null ? null : itemInfo.FormatStepData.WidthOverride == null ? null : + (float?)ToInt(itemInfo.FormatStepData.WidthOverride, maxRNO); //widOvrd = itemInfo.FormatStepData == null ? null : itemInfo.FormatStepData.WidthOverride; // Don't adjust the RNO width if in single column mode: if (itemInfo.IsRNOPart && itemInfo.MyParent.IsHigh && itemInfo.MyActiveSection.ColumnMode != 0 && itemInfo.ActiveFormat.MyStepSectionLayoutData.RNOWidthAlt != null) @@ -2833,7 +2834,7 @@ namespace Volian.Print.Library if (ovrd > 0) widOvrd = ovrd; // + 6; // Change bars on RNO column (signoff line) would not line up with 16-bit without this - NSP Alarms } - if ((widOvrd??0) != 0) + if ((widOvrd ?? 0) != 0) { Width = (float)widOvrd; // if there's a box, we may need to do an adjustment on the width, if the tab data was changed @@ -2912,8 +2913,8 @@ namespace Volian.Print.Library Width = (float)formatInfo.MyStepSectionLayoutData.WidT - 6 - mycolT; XOffset += mycolT; // adjust caution/note text position if (PartsLeft != null)// adjust tab position - foreach(vlnPrintObject vpo in PartsLeft) - vpo.XOffset += mycolT; + foreach (vlnPrintObject vpo in PartsLeft) + vpo.XOffset += mycolT; } else if (itemInfo.IsSection) { @@ -2960,11 +2961,12 @@ namespace Volian.Print.Library private bool UseTemplateWidthOrXOff(ItemInfo itemInfo) { if (!itemInfo.IsStep) return false; + if (itemInfo.MyHLS == null) return false; if (itemInfo.MyHLS.FormatStepData.UseSmartTemplate) return false; if (!itemInfo.MyDocStyle.ComponentList) return false; if (itemInfo.MyHLS.FormatStepData.UseOldTemplate) { - ItemInfo useForTemplate = itemInfo.IsHigh?itemInfo:itemInfo.MyParent; + ItemInfo useForTemplate = itemInfo.IsHigh ? itemInfo : itemInfo.MyParent; int topIndx = useForTemplate.GetSmartTemplateTopLevelIndx(); int tpIndx = useForTemplate.GetSmartTemplateIndex(topIndx, (int)useForTemplate.MyContent.Type); if (tpIndx > -1) return true; @@ -3002,7 +3004,7 @@ namespace Volian.Print.Library // -1 below code, +1 for '.' and -2 for standard wid of tab // standard wid of this tab is 2 (ex: '1.') // so adjust width if longer than normal - return (float)(sectTab.Length - 1) * 72/(float)MyItemInfo.FormatStepData.Font.CPI; + return (float)(sectTab.Length - 1) * 72 / (float)MyItemInfo.FormatStepData.Font.CPI; } private bool HasCheckOffHeading(ItemInfo itemInfo, FormatInfo formatInfo) { @@ -3036,7 +3038,8 @@ namespace Volian.Print.Library /// public class StepLevelList : SortedDictionary> { - public StepLevelList() : base() + public StepLevelList() + : base() { } public void Add(int stepLevel, float yLocation, vlnParagraph para) @@ -3060,7 +3063,7 @@ namespace Volian.Print.Library ParagraphLocation foundOverlap = FindOverlap(myParagraph); if (foundOverlap == null) { - this.Add(new ParagraphLocation(yTopMost,myParagraph)); + this.Add(new ParagraphLocation(yTopMost, myParagraph)); return; } ParagraphLocation doubleOverlap = FindOverlap(foundOverlap); @@ -3096,12 +3099,12 @@ namespace Volian.Print.Library if (KeepStepsOnPage && paraLoc.MyParagraph.MyItemInfo.MyContent.Type == 20001) { if (DontBreakHere(paraLoc)) - //if (paraLoc.MyParagraph.MyItemInfo.MyPrevious == null) // First substep + //if (paraLoc.MyParagraph.MyItemInfo.MyPrevious == null) // First substep level = 0; else level = 1; } - myList.Add(level , paraLoc.YTop, paraLoc.MyParagraph); + myList.Add(level, paraLoc.YTop, paraLoc.MyParagraph); } return myList; } @@ -3149,9 +3152,9 @@ namespace Volian.Print.Library get { return _MyParagraph; } set { _MyParagraph = value; } } - public ParagraphLocation(float yTopMost,vlnParagraph myParagraph) + public ParagraphLocation(float yTopMost, vlnParagraph myParagraph) { - MyParagraph =myParagraph; + MyParagraph = myParagraph; YTop = myParagraph.YVeryTop - yTopMost; YBottom = myParagraph.YBottom - yTopMost; StepLevel = myParagraph.MyItemInfo.StepLevel; @@ -3160,8 +3163,8 @@ namespace Volian.Print.Library { if (Between(otherParagraph.YTop, YTop, YBottom)) return true; if (Between(otherParagraph.YBottom, YTop, YBottom)) return true; - if(Between(YTop,otherParagraph.YVeryTop,otherParagraph.YBottom)) return true; - if(Between(YBottom,otherParagraph.YVeryTop,otherParagraph.YBottom)) return true; + if (Between(YTop, otherParagraph.YVeryTop, otherParagraph.YBottom)) return true; + if (Between(YBottom, otherParagraph.YVeryTop, otherParagraph.YBottom)) return true; return false; } public static bool Between(float x, float lower, float higher) @@ -3170,8 +3173,8 @@ namespace Volian.Print.Library { if (Between(otherParagraphLocation.YTop, YTop, YBottom)) return true; // The top is within the other if (Between(otherParagraphLocation.YBottom, YTop, YBottom)) return true; // The bottom is within the other - if(Between(YTop,otherParagraphLocation.YTop,otherParagraphLocation.YBottom)) return true; // the other top is within this one - if(Between(YBottom,otherParagraphLocation.YTop,otherParagraphLocation.YBottom)) return true;// I believe this is unnecessary + if (Between(YTop, otherParagraphLocation.YTop, otherParagraphLocation.YBottom)) return true; // the other top is within this one + if (Between(YBottom, otherParagraphLocation.YTop, otherParagraphLocation.YBottom)) return true;// I believe this is unnecessary return false; } public void Merge(vlnParagraph otherParagraph) diff --git a/PROMS/XYPlots/XYPlots.cs b/PROMS/XYPlots/XYPlots.cs index 52c6582f..acfdf997 100644 --- a/PROMS/XYPlots/XYPlots.cs +++ b/PROMS/XYPlots/XYPlots.cs @@ -499,6 +499,7 @@ namespace XYPlots Buff = Buff.Substring(0, Buff.Length - 2) + " \r\n\0x00"; // needs to end with null else if (Buff.EndsWith(">")) // doesn't end with return chars... Buff = Buff.Substring(0, Buff.Length - 1) + " \r\n\0x00"; // needs to end with null + Buff = Regex.Replace(Buff, @"([0-9])\r\n([0-9])", "$1 $2"); } private void CloseGraph() {