From 9458f378e2af932f0097686bb449672d13fc05cd Mon Sep 17 00:00:00 2001 From: Rich Date: Tue, 26 Sep 2017 17:57:48 +0000 Subject: [PATCH] B2017-224 Top Continue Messages were not printing. Logic for background printing was running when it should not. --- PROMS/Volian.Print.Library/vlnParagraph.cs | 368 ++++++++++----------- 1 file changed, 184 insertions(+), 184 deletions(-) diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index db7102e0..3f6f878c 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -79,10 +79,10 @@ namespace Volian.Print.Library int maxRnoSav = maxRNO; foreach (ItemInfo iChildItemInfo in itemInfoList) { - if(pp != null) pp.OnStatusChanged((iChildItemInfo.DisplayNumber ?? "") == "" ? iChildItemInfo.DisplayText : iChildItemInfo.DisplayNumber, PromsPrinterStatusType.LoadVlnParagraph); + if (pp != null) pp.OnStatusChanged((iChildItemInfo.DisplayNumber ?? "") == "" ? iChildItemInfo.DisplayText : iChildItemInfo.DisplayNumber, PromsPrinterStatusType.LoadVlnParagraph); if (iChildItemInfo.IsFootnote) { - vlnParagraph para = new vlnParagraph(Parent, cb, iChildItemInfo, xoff, yoff, rnoLevel, maxRNO, formatInfo, null, null, yoffRight, true, iChildItemInfo.IsSection ? pp :null); + vlnParagraph para = new vlnParagraph(Parent, cb, iChildItemInfo, xoff, yoff, rnoLevel, maxRNO, formatInfo, null, null, yoffRight, true, iChildItemInfo.IsSection ? pp : null); continue; // don't add it, vlnParagraph adds this item to the footnote list in ToPdf. } maxRNO = maxRnoSav; @@ -90,7 +90,7 @@ namespace Volian.Print.Library if (iChildItemInfo.IsSection && (iChildItemInfo as SectionInfo).ColumnMode != maxRNO) maxRNO = (iChildItemInfo as SectionInfo).ColumnMode; int maxRnoTemplate = iChildItemInfo.TemplateChildColumnMode; - if (maxRnoTemplate >= 0) maxRNO = maxRnoTemplate-1; + if (maxRnoTemplate >= 0) maxRNO = maxRnoTemplate - 1; 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 @@ -104,7 +104,7 @@ namespace Volian.Print.Library // by the first level of children. The data for the column is the child of the column header. // Sometimes the column will not have data, the following handles that case. Also, use // the boolean didComponentTableRow to keep track of the bottom most yoff of the table row. - if ((childItemInfo.MyDocStyle.ComponentList) && childItemInfo.MyParent.IsInTemplate()|| + if ((childItemInfo.MyDocStyle.ComponentList) && childItemInfo.MyParent.IsInTemplate() || (childItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && childItemInfo.IsInTemplate())) { if (childItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) @@ -116,7 +116,7 @@ namespace Volian.Print.Library // find the indexes into the template for this item. The index must be for the HLS this is // or this is under. int tindx = childItemInfo.TemplateIndex; - if (tindx == -1) + if (tindx == -1) xoff = (float)childItemInfo.MyDocStyle.Layout.LeftMargin; else if (childItemInfo.ActiveFormat.PlantFormat.FormatData.Templates[tindx].row < 0 || childItemInfo.ActiveFormat.PlantFormat.FormatData.Templates[tindx].width > 0) @@ -184,7 +184,7 @@ namespace Volian.Print.Library (childItemInfo.MyHeader == null && childItemInfo.MyPrevious.MyHeader != null || childItemInfo.MyHeader != null && childItemInfo.MyPrevious.MyHeader == null))) doSeparateBoxHdrChg = childItemInfo.MyPrevious.MyContent.Type != childItemInfo.MyContent.Type;//true; - bool alwaysBox = (childItemInfo.IsHigh && childItemInfo.FormatStepData.BoxIt); + bool alwaysBox = (childItemInfo.IsHigh && childItemInfo.FormatStepData.BoxIt); if ((alwaysBox || (bxIndx ?? -1) != -1) && (bxIndex != bxIndx || childItemInfo.FormatStepData.BoxIt || childItemInfo.MyHeader != null || doSeparateBoxHdrChg || childItemInfo.FormatStepData.SeparateBox)) { if (childItemInfo.FormatStepData.BoxIt) // this is a boxed HLS @@ -231,7 +231,7 @@ namespace Volian.Print.Library if (box != null) { box.Height = yoff - box.YOffset; // new height, with children - if (formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm || + if (formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm || formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvert) { if (childItemInfo.MyHeader != null && childItemInfo.MyPrevious != null @@ -294,7 +294,7 @@ namespace Volian.Print.Library { if (childItemInfo is SectionInfo) formatInfo = (childItemInfo as SectionInfo).LocalFormat ?? formatInfo; if (rnoLevel < maxRNO && childItemInfo.RNOs != null) yoff = Math.Max(yoff, yoffRight); - if (childItemInfo.ActiveSection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.ContActBoxOnSubSteps && + if (childItemInfo.ActiveSection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.ContActBoxOnSubSteps && box != null && box.MyBox != null && bxIndx == null) // point beach boxed substeps { box.Height = yoff - box.YOffset - (1F * vlnPrintObject.SixLinesPerInch); @@ -331,7 +331,7 @@ namespace Volian.Print.Library else if (!para.UseTemplateKeepOnCurLine(childItemInfo)) yoff = para.YBottomMost; // don't adjust YBottomost until after yoff is set for the RNO Separator - para.YBottomMost += para.YBottomMostAdjust; + para.YBottomMost += para.YBottomMostAdjust; if (box != null && childItemInfo.FormatStepData != null && childItemInfo.FormatStepData.BoxIt) { box.Height = yoff - box.YOffset - (1.1F * vlnPrintObject.SixLinesPerInch); @@ -386,7 +386,7 @@ namespace Volian.Print.Library if (box.MyParent.MyItemInfo.MyContent.Text.StartsWith(@"\u160?") && box.MyParent.MyItemInfo.DisplayText.Length == 1) { box.Height -= 3 * vlnPrintObject.SixLinesPerInch; - yoff -= vlnPrintObject.SixLinesPerInch; + yoff -= vlnPrintObject.SixLinesPerInch; } else yoff += 2 * vlnPrintObject.SixLinesPerInch; @@ -454,7 +454,7 @@ namespace Volian.Print.Library get { return _IsWordDocPara; } set { _IsWordDocPara = value; } } - public static bool HasPrefPageBreak = false; // use to track page breaks for supp info + public static bool HasPrefPageBreak = false; // use to track page breaks for supp info public bool PrefPageBreak = false; private bool _ShowSectionTitles; public bool ShowSectionTitles @@ -473,7 +473,7 @@ namespace Volian.Print.Library // //if((PartsLeft[0] as vlnTab).Text[0] != '\u25CF') // _MyLog.WarnFormat("NoteTab '{0}','{1}','{2}','{3}','{4}','{5}','{6}'", (PartsAbove[0] as vlnHeader).Text, (PartsLeft[0] as vlnTab).Text, MyItemInfo.MyProcedure.DisplayNumber, MyItemInfo.MyHLS.DisplayText, // MyItemInfo.ShortPath, MyItemInfo.FormatStepData.TabData.IdentPrint, MyItemInfo.FormatStepData.TabData.IdentEdit); -// + // // B2017-105 if a symbol character was set to a bigger font size, then the positioning of the larger symbol character was printing too high on the line // found with Wolf Creek use of the empty box symbol foreach (Chunk chk in IParagraph.Chunks) @@ -512,7 +512,7 @@ namespace Volian.Print.Library yPageStart = yTopMargin + YTopMost; } else - yPageStart = yTopMargin + YOffset; + yPageStart = yTopMargin + YOffset; } else yPageStart = PartsAbove.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); @@ -620,12 +620,12 @@ namespace Volian.Print.Library if (pc.Total == 0) { pc.Total = MyPageHelper.CurrentTOCPageNumber + 1; - pc.DrawTemplates(); + pc.DrawTemplates(); + } } } } - } if (!doprint) return yPageStart; if (_PartsLeft != null && _PartsLeft.Count > 0) yPageStart = PartsLeft.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); if (_PartsRight != null && _PartsRight.Count > 0) yPageStart = PartsRight.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); @@ -889,10 +889,10 @@ namespace Volian.Print.Library private float DrawGrid(PdfContentByte cb, ref float yPageStart, float yTopMargin, float yBottomMargin, ref float yLocation) { //DebugText.WriteLine("{0},'{1}','{2}','<>'", MyItemInfo.ItemID, MyItemInfo.ShortPath, FormattedText); - if(DebugText.IsOpen)DebugText.WriteLine("{0},'{1}','{2}','<>',{3}", MyItemInfo.ItemID, MyItemInfo.ShortPath, MyItemInfo.MyContent.Text, XOffset); - //if (MyItemInfo.InList(11019,11024,111026)) // RHM20150507 Table Scrunch - // Console.WriteLine("here"); - float heightBefore = MyGrid.Height+4 * MyPageHelper.YMultiplier; + if (DebugText.IsOpen) DebugText.WriteLine("{0},'{1}','{2}','<>',{3}", MyItemInfo.ItemID, MyItemInfo.ShortPath, MyItemInfo.MyContent.Text, XOffset); + //if (MyItemInfo.InList(11019,11024,111026)) // RHM20150507 Table Scrunch + // Console.WriteLine("here"); + float heightBefore = MyGrid.Height + 4 * MyPageHelper.YMultiplier; if (Rtf2Pdf.GetTableScrunchingStatus(TableScrunching.Phase1) && heightBefore > (yLocation - yBottomMargin)) { //MyGrid.TooBig = (MyItemInfo.MyDocStyle.Layout.FooterLength ?? 0) + SixLinesPerInch + MyGrid.Height - (yLocation - yBottomMargin); @@ -920,7 +920,7 @@ namespace Volian.Print.Library } } } - MyPageHelper.BottomContent=yLocation-(MyGrid.Height + 4 * MyPageHelper.YMultiplier); + MyPageHelper.BottomContent = yLocation - (MyGrid.Height + 4 * MyPageHelper.YMultiplier); float retval = Rtf2Pdf.GridAt(cb, MyGrid, XOffset, yLocation, Width, 100, DebugInfo, yBottomMargin, !MyItemInfo.FormatStepData.Type.Contains("Borderless")); if (MyGrid.Height > (yTopMargin - yBottomMargin)) { @@ -933,16 +933,16 @@ namespace Volian.Print.Library private void FixMessages(vlnChangeBar vcb, float heightDif) { SortedDictionary msd = vcb.Messages; - vcb.Messages = new SortedDictionary(); + vcb.Messages = new SortedDictionary(); foreach (float key in msd.Keys) { - vcb.Messages.Add(key+heightDif, msd[key]); + vcb.Messages.Add(key + heightDif, msd[key]); } } private float DrawText(PdfContentByte cb, ref float yPageStart, float yTopMargin, float yBottomMargin, ref float yLocation) { - if(DebugText.IsOpen)DebugText.WriteLine("{0},'{1}','{2}','<>'", MyItemInfo.ItemID, MyItemInfo.DBSequence, FormattedText); + if (DebugText.IsOpen) DebugText.WriteLine("{0},'{1}','{2}','<>'", MyItemInfo.ItemID, MyItemInfo.DBSequence, FormattedText); //Console.WriteLine("{0},{1},'{2}','<>'", MyItemInfo.ItemID, MyItemInfo.DBSequence, IParagraph.Content); float retval = yLocation; if (MyItemInfo.IsRtfRaw) @@ -954,7 +954,7 @@ namespace Volian.Print.Library // Calvert Alarms have a special case, center text if the next/previous is not the same type of caution or note. // Calvert Alarms have a note1 that is a warning. if a regular note preceeded it, this regular note was not centered. bool doAlign = false; - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert && (MyItemInfo.IsCaution || MyItemInfo.IsNote || MyItemInfo.IsNote1)) + if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert && (MyItemInfo.IsCaution || MyItemInfo.IsNote || MyItemInfo.IsNote1)) { bool diffAsPrev = MyItemInfo.MyPrevious == null || (MyItemInfo.MyPrevious != null && MyItemInfo.MyContent.Type != MyItemInfo.MyPrevious.MyContent.Type); bool diffAsNext = MyItemInfo.NextItem == null || (MyItemInfo.NextItem != null && MyItemInfo.MyContent.Type != MyItemInfo.NextItem.MyContent.Type); @@ -981,14 +981,14 @@ namespace Volian.Print.Library } // if printing checklist header, adjust ypagestart & ylocation so that won't get forced pagination (pagination is already ok) //Console.WriteLine("'Q1',{0},'{1}',{2},{3},{4},{5},{6}", MyItemInfo.ItemID, MyItemInfo.ShortPath, yTopMargin, yPageStart, yLocation, YTopMost, YOffset); - if (PrintHeader) + if (PrintHeader) { yPageStart = yTopMargin + YVeryTop; yLocation = yPageStart - YOffset; // yLocation is physical location from bottom of page. } if (yLocation - Height < 24) { - if (DebugPagination.IsOpen) + if (DebugPagination.IsOpen) DebugPagination.WriteLine("Very Low {0},{1},{2},{3},{4},{5}", MyItemInfo.ShortPath, MyItemInfo.ItemID, yLocation, Height, yLocation - Height, yTopMargin - MyItemInfo.MyDocStyle.Layout.PageLength); } int profileDepth = ProfileTimer.Push(">>>> Rtf2Pdf.TextAt"); @@ -1011,14 +1011,14 @@ namespace Volian.Print.Library Chunk chk1 = IParagraph.Chunks[0] as Chunk; //Console.WriteLine("\"Desination\"\t{0}", MyItemInfo.ItemID); if (MyItemInfo.MyContent.Text.ToUpper().Contains("LINK:TR")) - Console.WriteLine("Missing Transition {0}",MyItemInfo.ItemID); + Console.WriteLine("Missing Transition {0}", MyItemInfo.ItemID); chk1.SetLocalDestination(string.Format("ItemID={0}", MyItemInfo.ItemID)); // Destination if (MyItemInfo.MyContent.ContentTransitionCount > 0) { TransitionInfo ti = MyItemInfo.MyContent.ContentTransitions[0]; ItemInfo tiDefault = GetDefaultItemInfo(ti.MyItemToID); - if (ti.MyItemToID.MyProcedure.ItemID == MyItemInfo.MyProcedure.ItemID && - ! MyItemInfo.ActiveSection.DisplayNumber.ToUpper().StartsWith("FOLDOUT")) + if (ti.MyItemToID.MyProcedure.ItemID == MyItemInfo.MyProcedure.ItemID && + !MyItemInfo.ActiveSection.DisplayNumber.ToUpper().StartsWith("FOLDOUT")) { // Local Go To if (ti.MyItemToID.MyContent.Type > 19999) foreach (Chunk chk in IParagraph.Chunks) @@ -1082,7 +1082,7 @@ namespace Volian.Print.Library { if (MyItemInfo.IsStepSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert && (MyItemInfo.ActiveSection as SectionInfo).HasInitials) { - if (MyPageHelper.PrintInitials(cb,yLocation,(float) MyItemInfo.MyDocStyle.Layout.LeftMargin)) + if (MyPageHelper.PrintInitials(cb, yLocation, (float)MyItemInfo.MyDocStyle.Layout.LeftMargin)) { //if(yLocation != yTopMargin) // Console.WriteLine("'{0}',{1},'{2}',{3},{4},{5},{6}", MyItemInfo.MyProcedure.DisplayNumber, MyItemInfo.ItemID @@ -1115,7 +1115,7 @@ namespace Volian.Print.Library } private ItemInfo GetDefaultItemInfo(ItemInfo myItemInfo) { - if (myItemInfo.IsProcedure &&myItemInfo.Sections != null) + if (myItemInfo.IsProcedure && myItemInfo.Sections != null) { SectionInfo siProcedureSteps = null; foreach (SectionInfo si in myItemInfo.Sections) @@ -1150,7 +1150,7 @@ namespace Volian.Print.Library get { return vlnParagraph._MissingInitials; } set { vlnParagraph._MissingInitials = value; } } - public static void TextAt(PdfContentByte cb,VlnSvgPageHelper myPageHelper,PageItem pi,float yloc, float leftMargin) + public static void TextAt(PdfContentByte cb, VlnSvgPageHelper myPageHelper, PageItem pi, float yloc, float leftMargin) { System.Drawing.Color sysColor = PrintOverride.OverrideSvgColor(System.Drawing.Color.Black); cb.SaveState(); @@ -1160,7 +1160,7 @@ namespace Volian.Print.Library int fontStyle = 0; bool underline = false; if (pi == null) // The header for the signoffs is missing in the current section format. - // An Example can currently be found in Calvert OI-34 + // An Example can currently be found in Calvert OI-34 { if (!MissingInitials) // Only show this once. { @@ -1182,11 +1182,11 @@ namespace Volian.Print.Library { ct.SetSimpleColumn((float)pi.Col + leftMargin, yloc + 6.9F, (float)pi.Col + 100 + leftMargin, yloc - 50); fontStyle = (pi.Font.WindowsFont.Bold ? iTextSharp.text.Font.BOLD : 0) + (pi.Font.WindowsFont.Italic ? iTextSharp.text.Font.ITALIC : 0); - font = FontFactory.GetFont(pi.Font.Family, BaseFont.IDENTITY_H, BaseFont.EMBEDDED,(float) pi.Font.Size,fontStyle); + font = FontFactory.GetFont(pi.Font.Family, BaseFont.IDENTITY_H, BaseFont.EMBEDDED, (float)pi.Font.Size, fontStyle); underline = pi.Font.WindowsFont.Underline; } Chunk chk = new Chunk("INITIALS", font); - if(underline) + if (underline) chk.SetUnderline(new iTextSharp.text.Color(sysColor), 0, 0.05F, 0, -.131F, PdfContentByte.LINE_CAP_ROUND); // Relative Based upon font size Phrase ph = new Phrase(chk); ct.AddElement(ph); @@ -1354,7 +1354,7 @@ namespace Volian.Print.Library Height = sc.Step_ImageHeight; } retval = Rtf2Pdf.FigureAt(cb, it_image, XOffset + MyItemInfo.FormatStepData.Font.CharsToTwips, yLocation, Width * MyPageHelper.YMultiplier, Height * MyPageHelper.YMultiplier, DebugInfo, yBottomMargin, !MyItemInfo.FormatStepData.Type.Contains("Borderless")); - } + } } // The following code was added to fix B2016-219 (for VCS, the centerline drew through a figure). The 'top' value was taken from the code // that draws the vlnBoxes (Caution/Note, etc) @@ -1362,7 +1362,7 @@ namespace Volian.Print.Library // numbers were determined by trial and error. // only add gap if centered, i.e. in 2 column mode & table is centered - if (MyItemInfo.ColumnMode > 0 && (!MyItemInfo.FormatStepData.Type.Contains("AER") && !MyItemInfo.IsInRNO)) + if (MyItemInfo.ColumnMode > 0 && (!MyItemInfo.FormatStepData.Type.Contains("AER") && !MyItemInfo.IsInRNO)) { float top = CalculateYOffset(yPageStart, yTopMargin) - (7 * MyPageHelper.YMultiplier); float adjtop = 0; @@ -1384,7 +1384,7 @@ namespace Volian.Print.Library if (!Rtf2Pdf.PdfDebug) return "No Path"; int profileDepth = ProfileTimer.Push(">>>> vlnParagraph.DebugInfo"); string retval = string.Format("DebugID = {0}, ID={1} Type={2} TypeName='{3}' StepLevel={4} ShortPath={5} Width={6} Left={7} YOffset={8}", - DebugId, MyItemInfo.ItemID, MyItemInfo.FormatStepType, MyItemInfo.FormatStepData == null ? "NoStepData" : MyItemInfo.FormatStepData.Type, MyItemInfo.StepLevel, MyItemInfo.ShortPath, Width, XOffset, YOffset); + DebugId, MyItemInfo.ItemID, MyItemInfo.FormatStepType, MyItemInfo.FormatStepData == null ? "NoStepData" : MyItemInfo.FormatStepData.Type, MyItemInfo.StepLevel, MyItemInfo.ShortPath, Width, XOffset, YOffset); ProfileTimer.Pop(profileDepth); return retval; } @@ -1474,7 +1474,7 @@ namespace Volian.Print.Library return (prTab + thisTab.Trim()).TrimEnd(".".ToCharArray()); } private static bool DoSubs = true; // flag whether to print substeps (don't if doing continued checklist header) - protected float _ContinueHeight=0; + protected float _ContinueHeight = 0; public virtual float ContinueHeight { get @@ -1485,7 +1485,7 @@ namespace Volian.Print.Library && MyItemInfo.MyDocStyle.Continue.Top.Message.Contains("%s") && MyItemInfo.MyDocStyle.Continue.Top.Message.ToUpper().EndsWith(" (Continued)".ToUpper())) { - string suffix = MyItemInfo.MyDocStyle.Continue.Top.Message.Replace("%sR","").Replace("%s",""); + string suffix = MyItemInfo.MyDocStyle.Continue.Top.Message.Replace("%sR", "").Replace("%s", ""); _ContinueHeight = GetParagraphHeight(MyContentByte, IParagraph, suffix, Width); } ProfileTimer.Pop(profileDepth); @@ -1561,7 +1561,7 @@ namespace Volian.Print.Library // out the variable that flags a continue message MyPageHelper.OldTemplateContMsg = false; - if(DebugText.IsOpen) DebugText.WriteLine("ToPdf1:{0},'{1}',{2},{3},{4},{5}", MyItemInfo.ItemID, MyItemInfo.ShortPath, XOffset, yLocation, yPageStart, YTopMost); + if (DebugText.IsOpen) DebugText.WriteLine("ToPdf1:{0},'{1}',{2},{3},{4},{5}", MyItemInfo.ItemID, MyItemInfo.ShortPath, XOffset, yLocation, yPageStart, YTopMost); int profileDepth1 = ProfileTimer.Push(">>>> vlnParagraph.Paginate"); int paginate = Paginate(yLocation, yTopMargin, yBottomMargin); ProfileTimer.Pop(profileDepth1); @@ -1577,7 +1577,7 @@ namespace Volian.Print.Library // if this has a caution/note with supinfo, that is id that needs to go in pagination list, unless it is in there. int aboveSupinfoId = ChildrenAboveHaveSupInfo(); if (supInfoSect.StepSectPageBreaksForSupInfo.Contains(aboveSupinfoId)) aboveSupinfoId = -1; - supInfoSect.StepSectPageBreaksForSupInfo.Add(aboveSupinfoId!=-1?aboveSupinfoId:MyItemInfo.SupInfos[0].ItemID); + supInfoSect.StepSectPageBreaksForSupInfo.Add(aboveSupinfoId != -1 ? aboveSupinfoId : MyItemInfo.SupInfos[0].ItemID); MyPromsPrinter.NeedSupInfoBreak = false; } bool itemIsPrinted = false; @@ -1655,19 +1655,19 @@ namespace Volian.Print.Library yPageStart -= SixLinesPerInch; if (MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].CompressFirstPartOfStep) MyPageHelper.YMultiplier = _SevenLinesPerInch / SixLinesPerInch; - if(CompressFoldout) + if (CompressFoldout) MyPageHelper.YMultiplier = _SevenLinesPerInch / SixLinesPerInch; - + ///else /// MyPageHelper.YMultiplier = 1; break; - // .oooooo. .o - // d8P' `Y8b o888 - //888 .oooo. .oooo.o .ooooo. 888 - //888 `P )88b d88( "8 d88' `88b 888 - //888 .oP"888 `"Y88b. 888ooo888 888 - //`88b ooo d8( 888 o. )88b 888 .o 888 - // `Y8bood8P' `Y888""8o 8""888P' `Y8bod8P' o888o + // .oooooo. .o + // d8P' `Y8b o888 + //888 .oooo. .oooo.o .ooooo. 888 + //888 `P )88b d88( "8 d88' `88b 888 + //888 .oP"888 `"Y88b. 888ooo888 888 + //`88b ooo d8( 888 o. )88b 888 .o 888 + // `Y8bood8P' `Y888""8o 8""888P' `Y8bod8P' o888o case 1: // Break on High Level Step if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.DoPageBreaks) { @@ -1678,10 +1678,10 @@ namespace Volian.Print.Library else MyPromsPrinter.NeedSupInfoBreak = true; supInfoSect.StepSectPageBreaks.Add(MyItemInfo.ItemID); } - YTopMost=OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); + YTopMost = OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); docstyle = MyItemInfo.MyDocStyle; if (MyPageHelper.NotesToFootNotes != null && MyPageHelper.NotesToFootNotes.Count > 0) MyPageHelper.NotesToFootNotesYoffset = CalculateYLocation(yLocation, yTopMargin); - bool doSectionContinue = !MyItemInfo.IsSection && ((docstyle.StructureStyle.Style & E_DocStructStyle.BottomSectionContinue) == E_DocStructStyle.BottomSectionContinue); + bool doSectionContinue = !MyItemInfo.IsSection && ((docstyle.StructureStyle.Style & E_DocStructStyle.BottomSectionContinue) == E_DocStructStyle.BottomSectionContinue); if (doSectionContinue) DoBottomContinueMsg(cb, yBottomMargin, yLocation, docstyle, false); MyPromsPrinter.NewPage(); //_MyLog.InfoFormat("NewPage 10 {0}", cb.PdfWriter.CurrentPageNumber); @@ -1703,7 +1703,7 @@ namespace Volian.Print.Library { SectionInfo si = MyItemInfo as SectionInfo; MyPageHelper.PageBookmarks.Add(MyItemInfo, ((si.DisplayNumber ?? "") == "" ? "" : si.DisplayNumber + " - ") + si.DisplayText, null); - + } // Only do foldout page if not done for section break, i.e. check the there's a previous step. if (MyItemInfo.MyPrevious != null && MyItemInfo.FoldoutIndex() > -1) @@ -1715,10 +1715,10 @@ namespace Volian.Print.Library // preceeding foldout. if (MyItemInfo.FoldoutIndex() <= -1) { - MyPageHelper.OnBlankPage = true; - cb.PdfDocument.Add(new iTextSharp.text.Table(1)); - MyPromsPrinter.NewPage(); - //_MyLog.InfoFormat("NewPage 10 blank {0}", cb.PdfWriter.CurrentPageNumber); + MyPageHelper.OnBlankPage = true; + cb.PdfDocument.Add(new iTextSharp.text.Table(1)); + MyPromsPrinter.NewPage(); + //_MyLog.InfoFormat("NewPage 10 blank {0}", cb.PdfWriter.CurrentPageNumber); } } // See comments under case 0 explaining supinfo/facing page processing. @@ -1746,14 +1746,14 @@ namespace Volian.Print.Library DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart); SectionTopMessage(cb, yTopMargin, yLocation); // does wcntraining & suppinfo section title if (MyPageHelper.CreatingSupInfoPage) yPageStart -= (2 * SixLinesPerInch); - if (doSectionContinue ) DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle , null); + if (doSectionContinue) DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle, null); // If "ContinueSectionHeader" (format flag) is true then print the section title with "(Continued)" appended to it if (!MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader && (!MyItemInfo.IsSection || MyItemInfo.IsSeparateSubsection)) { SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig; doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle; } - + if (MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].CompressFirstPartOfStep) MyPageHelper.YMultiplier = _SevenLinesPerInch / SixLinesPerInch; else @@ -1773,7 +1773,7 @@ namespace Volian.Print.Library else MyPromsPrinter.NeedSupInfoBreak = true; supInfoSect.StepSectPageBreaks.Add(MyItemInfo.ItemID); } - YTopMost=OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); + YTopMost = OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); docstyle = MyItemInfo.MyDocStyle; bool doAlarmBox = false; if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) @@ -1804,15 +1804,15 @@ namespace Volian.Print.Library if (MyPageHelper.NotesToFootNotes != null && MyPageHelper.NotesToFootNotes.Count > 0) MyPageHelper.NotesToFootNotesYoffset = CalculateYLocation(yLocation, yTopMargin); DoBottomContinueMsg(cb, yBottomMargin, yLocation, docstyle, doThreeContinues); MyPromsPrinter.NewPage(); - if (MyItemInfo.IsStep && ((MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd)) - { + if (MyItemInfo.IsStep && ((MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd)) + { // check if parent (can be HLS, Caution or Note) has the UseOldTemplate. If so, // flag that a continue message should be printed as part of a pagelist header (if pagelist // has CM: page list item) ItemInfo itm = MyItemInfo; while (itm.IsStep && !itm.FormatStepData.UseOldTemplate) itm = itm.MyParent; // don't put out continue if the page break item is the same as background step item (caution/note or hls) - if (itm.IsStep && itm.ItemID != MyItemInfo.ItemID) + if (itm.IsStep && itm.ItemID != MyItemInfo.ItemID) { MyPageHelper.OldTemplateContMsg = true; MyPageHelper.ResetSvg(); @@ -1878,24 +1878,24 @@ namespace Volian.Print.Library // in the document style that includes 'Continued' if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert) { - string myMsg = MyItemInfo.MyDocStyle.Continue.Top.Message; - if (myMsg == null || myMsg == "") - { - // There is no message, but still need to check if there is a Section Title Continued message: - // This was added for BGE OI34 (if break was within step, no section title continue message was printed) - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader) - { - SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig; - doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle; - } - else - doSectionTitleContinued = false; - } - else + string myMsg = MyItemInfo.MyDocStyle.Continue.Top.Message; + if (myMsg == null || myMsg == "") + { + // There is no message, but still need to check if there is a Section Title Continued message: + // This was added for BGE OI34 (if break was within step, no section title continue message was printed) + if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader) { SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig; doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle; } + else + doSectionTitleContinued = false; + } + else + { + SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig; + doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle; + } } else { @@ -1903,12 +1903,12 @@ namespace Volian.Print.Library doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle; } } - addExtraLines = SectionTopMessage(cb, yTopMargin, yLocation); // this does wcntraining top section continue message and supplemental info message + addExtraLines = SectionTopMessage(cb, yTopMargin, yLocation); // this does wcntraining top section continue message and supplemental info message if (MyPageHelper.CreatingSupInfoPage) yPageStart -= (2 * SixLinesPerInch); if (!addExtraLines && (!doSectionTitleContinued || !SectionShowTitles)) addExtraLines = DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle, doThreeContinues && MyItemInfo.MyParent != null && MyItemInfo.MyParent.MyTab != null ? MyItemInfo.MyParent.MyTab.CleanText : null); - if (CompressPartOfStep) + if (CompressPartOfStep) { MyPageHelper.YMultiplier = _SevenLinesPerInch / SixLinesPerInch; CompressPartOfStep = false; @@ -1935,13 +1935,13 @@ namespace Volian.Print.Library if (MyItemInfo.MyPrevious != null && MyItemInfo.MyPrevious.TemplateIndex > 0 && MyItemInfo.ActiveFormat.PlantFormat.FormatData.Templates[MyItemInfo.MyPrevious.TemplateIndex].hmacro > 0) yPageStart += (3 * SixLinesPerInch); } - // Now check if this is a template type step & if so, add the HLS's prefix/suffix to it. + // Now check if this is a template type step & if so, add the HLS's prefix/suffix to it. // Since the entire checklist HLS (checklist table header) is printed as part of the // continue, create a new paragraph to handle pagination and printing. if (MyItemInfo.MyHLS != null && MyItemInfo.MyHLS.FormatStepData.UseSmartTemplate) { DoSubs = false; - vlnParagraph smartPara = new vlnParagraph(MyParent.MyParent, cb, MyItemInfo.MyHLS, MyParent.XOffset, yPageStart, 0, 0, MyParent.MyItemInfo.ActiveFormat, null, " (Continued)", 0,false, MyPromsPrinter); + vlnParagraph smartPara = new vlnParagraph(MyParent.MyParent, cb, MyItemInfo.MyHLS, MyParent.XOffset, yPageStart, 0, 0, MyParent.MyItemInfo.ActiveFormat, null, " (Continued)", 0, false, MyPromsPrinter); smartPara.PrintHeader = true; float mytmpfloat = smartPara.ParagraphToPdf(cb, yPageStart, yTopMargin, yBottomMargin); yPageStart -= smartPara.Height; @@ -1966,7 +1966,7 @@ namespace Volian.Print.Library } if (!firstHighLevelStep) { - YTopMost=OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); + YTopMost = OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); if (MyPageHelper.NotesToFootNotes != null && MyPageHelper.NotesToFootNotes.Count > 0) MyPageHelper.NotesToFootNotesYoffset = CalculateYLocation(yLocation, yTopMargin); MyPromsPrinter.NewPage(); // HLS (7 lpi) breakif (MyItemInfo.IsSection) //_MyLog.InfoFormat("NewPage 12 {0}", cb.PdfWriter.CurrentPageNumber); @@ -2025,7 +2025,7 @@ namespace Volian.Print.Library ShowSectionTitles && !MyItemInfo.MyDocStyle.CancelSectTitle && !MyItemInfo.MyDocStyle.SpecialStepsFoldout) - yPageStart = yPageStart; + yPageStart = yPageStart; else yPageStart = yTopMargin + YTopMost; MyPageHelper.YMultiplier = _SevenLinesPerInch / SixLinesPerInch; @@ -2059,7 +2059,7 @@ namespace Volian.Print.Library // get to the correct section for the message, i.e. if on a section, the message should be the parent // section (not the activesection which is myself); if on a step, the message should be the active section ItemInfo sectForCont = MyItemInfo.IsSection && MyItemInfo.MyParent.IsSection ? MyItemInfo.MyParent : MyItemInfo.ActiveSection; - sectContPara = new vlnParagraph(MyParent.MyParent, cb, sectForCont, MyParent.XOffset, 0, 0, 0, MyParent.MyItemInfo.ActiveFormat, null, (contMsg == null || contMsg == "") ? " (Continued)" : contMsg, 0, false,MyPromsPrinter); + sectContPara = new vlnParagraph(MyParent.MyParent, cb, sectForCont, MyParent.XOffset, 0, 0, 0, MyParent.MyItemInfo.ActiveFormat, null, (contMsg == null || contMsg == "") ? " (Continued)" : contMsg, 0, false, MyPromsPrinter); if (sectContPara.PartsLeft.Count > 0) { vlnTab vt = sectContPara.MyTab; @@ -2076,13 +2076,13 @@ namespace Volian.Print.Library sectContPara.XOffset += dif; sectContPara.Width -= dif; } - + } float mytmpfloat = sectContPara.ParagraphToPdf(cb, yTopMargin, yTopMargin, yBottomMargin); if (sectContPara.SectionContinuePrinted) yPageStart -= sectContPara.Height + SixLinesPerInch; else - Console.WriteLine("'No Header 1','{0}',{1},{2}",MyItemInfo.ShortPath,MyItemInfo.MyDocStyle.CancelSectTitle,MyItemInfo.MyDocStyle.SpecialStepsFoldout); + Console.WriteLine("'No Header 1','{0}',{1},{2}", MyItemInfo.ShortPath, MyItemInfo.MyDocStyle.CancelSectTitle, MyItemInfo.MyDocStyle.SpecialStepsFoldout); } else { @@ -2107,7 +2107,7 @@ namespace Volian.Print.Library if (supInfoSect.StepSectPageBreaksForSupInfo.Contains(aboveSupinfoId)) aboveSupinfoId = -1; supInfoSect.StepSectPageBreaksForSupInfo.Add(MyItemInfo.SupInfos[0].ItemID); MyPromsPrinter.NeedSupInfoBreak = false; - } + } yPageStart = ChildrenLeft.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); // Handle the PageBreakOnStep flag for a HLS. This will put out the page break right before @@ -2115,10 +2115,10 @@ namespace Volian.Print.Library // 'this' below is a highlevel step, and the only time that ParaBreaks[0] will == 'this' is // when the PageBreakOnStep flag is true. if (MyPageHelper.ParaBreaks != null && MyPageHelper.ParaBreaks.Count > 0 && - MyPageHelper.ParaBreaks[0] == this) + MyPageHelper.ParaBreaks[0] == this && this.MyItemInfo.FormatStepData.PageBreakOnStep)// B2017-224 Top Continue Messages Add check for PageBreakOnStep 9/26/2017 Ginna SAMGs SAG-8 Step 4 { ShowPageBreak(1, CheckForCompression("PageBreakOnStep/Caution/Note HLS"), "Yes", YTop - YBottomMost, yTopMargin - yBottomMargin, yTopMargin - yBottomMargin, false); - YTopMost=OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); + YTopMost = OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); MyPageHelper.BottomMessage.Clear(); MyPageHelper.TopMessage = null; MyPromsPrinter.NewPage(); @@ -2209,7 +2209,7 @@ namespace Volian.Print.Library if (myMsg.Contains("%-12s")) myMsg = myMsg.Replace("%-12s", MyItemInfo.MyProcedure.DisplayNumber.PadRight(12)); float xpos = 0; - if (yTopMargin-docstyle.Layout.PageLength>=msg_yLocation && docstyle.End.Message != null && docstyle.End.Message != "" && docstyle.End.Flag<=2) _MyLog.WarnFormat("End Message LOW on page: {0}, {1}, {2}, Page {3}",msg_yLocation, MyItemInfo.ItemID, MyItemInfo.ShortPath, MyPageHelper.CurrentPageNumber+1); + if (yTopMargin - docstyle.Layout.PageLength >= msg_yLocation && docstyle.End.Message != null && docstyle.End.Message != "" && docstyle.End.Flag <= 2) _MyLog.WarnFormat("End Message LOW on page: {0}, {1}, {2}, Page {3}", msg_yLocation, MyItemInfo.ItemID, MyItemInfo.ShortPath, MyPageHelper.CurrentPageNumber + 1); if ((docstyle.End.Margin ?? 0) != 0) { xpos = (float)docstyle.Layout.LeftMargin + (float)docstyle.End.Margin; @@ -2397,12 +2397,12 @@ namespace Volian.Print.Library if (MyItemInfo.MyDocStyle.SectTop != null && MyItemInfo.MyDocStyle.SectTop.Message != null) { float sectMsgY = 0; - if (PartsContainer == null || PartsContainer.Count==0) + if (PartsContainer == null || PartsContainer.Count == 0) sectMsgY = CalculateYLocation(YTop, yTopMargin); else { // B2016-134: Account for section top continue if item has container, i.e. move section top continue message above the container - sectMsgY = CalculateYLocation(YTopMost-(SixLinesPerInch*3), yTopMargin); // 3 is # of lines: header, box, blank line moving up page + sectMsgY = CalculateYLocation(YTopMost - (SixLinesPerInch * 3), yTopMargin); // 3 is # of lines: header, box, blank line moving up page addextra = true; } VE_Font sctMsgFont = MyItemInfo.MyDocStyle.SectTop.Font; @@ -2435,7 +2435,7 @@ namespace Volian.Print.Library // Console.WriteLine("Different"); //} private void AddFootNote(PdfContentByte cb) - { + { // for calvert valve lists footnotes, if there is footnote data, save it for vlnSvgPageHelper // which puts the footnotes out when page is printed. List myNotes = MyPageHelper.NotesToFootNotesHLS[MyItemInfo.ItemID]; @@ -2510,17 +2510,17 @@ namespace Volian.Print.Library // we therefore need to adjust the y location of multiple step designors attached tothe top continue message if (MyPageHelper.TopMessageRs.Count > 3) { - Rsidx = MyPageHelper.TopMessageRs.Count - 1; - rtxt = MyPageHelper.TopMessageRs[Rsidx].Text; + Rsidx = MyPageHelper.TopMessageRs.Count - 1; + rtxt = MyPageHelper.TopMessageRs[Rsidx].Text; // find the number of lines to shift existing TopMessageRs step designators down - istr = rtxt.IndexOf("\\line", 0); - while (istr != -1) - { - nlcnt++; - istr = rtxt.IndexOf("\\line", istr + 1); - } + istr = rtxt.IndexOf("\\line", 0); + while (istr != -1) + { + nlcnt++; + istr = rtxt.IndexOf("\\line", istr + 1); + } // move the previous TopMessageRs step designators down - Rsidx -= 2; // index to the previous step desginator + Rsidx -= 2; // index to the previous step desginator while (Rsidx > 0) { MyPageHelper.TopMessageRs[Rsidx].YOffset -= (nlcnt * SixLinesPerInch); @@ -2590,7 +2590,7 @@ namespace Volian.Print.Library while (ip.IsRNOPart) ip = ip.MyParent; myMsg = myMsg.Replace(@"%sR", ip.CombinedTab); } - + else myMsg = myMsg.Replace(@"%sR", MyItemInfo.MyParent.CombinedTab); float xor = MyTopRNO.MyTab.XOffset; @@ -2677,7 +2677,7 @@ namespace Volian.Print.Library useAerParaForTab = MyParent; concataerTab = MyParent.MyTab != null ? MyParent.MyTab.Text.TrimEnd() : ""; xoffTab = 0; // no rno tab - xoffMsg = ToInt(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColRTable, 1) + (float)MyItemInfo.MyDocStyle.Layout.LeftMargin + ((useAerParaForTab != null && useAerParaForTab.MyTab!=null) ? useAerParaForTab.MyTab.Width : 7.2f); + xoffMsg = ToInt(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColRTable, 1) + (float)MyItemInfo.MyDocStyle.Layout.LeftMargin + ((useAerParaForTab != null && useAerParaForTab.MyTab != null) ? useAerParaForTab.MyTab.Width : 7.2f); } else { @@ -2779,7 +2779,7 @@ namespace Volian.Print.Library { // Adjusted Continue Message Y Offset //DebugPagination.WriteLine("====>> {0},'{1}'", msg_yLocation, MyItemInfo.ShortPath); //msg_yLocation = (float) MyPageHelper.BottomContent - SixLinesPerInch; // Account for how low the lowest Item is on the page - float msg_yLocationOld =msg_yLocation= yBottomMargin + (docstyle.Layout.FooterLength ?? 0); + float msg_yLocationOld = msg_yLocation = yBottomMargin + (docstyle.Layout.FooterLength ?? 0); if (MyPageHelper.BottomContent != null) msg_yLocation = Math.Min(yBottomMargin + (docstyle.Layout.FooterLength ?? 0), (float)MyPageHelper.BottomContent - SixLinesPerInch);// RHM20150525 - Table Scrunch if (msg_yLocationOld != msg_yLocation) @@ -2788,7 +2788,7 @@ namespace Volian.Print.Library break; case E_ContBottomLoc.BtwnTextAndBottom: // place continue string between end of text & bottom of page msg_yLocation = msg_yLocation + yLocation - ((yLocation - yBottomMargin) / 2); // +SixLinesPerInch; // (need this for IP3) - msg_yLocation = Math.Max(msg_yLocation, yBottomMargin+SixLinesPerInch); + msg_yLocation = Math.Max(msg_yLocation, yBottomMargin + SixLinesPerInch); break; case E_ContBottomLoc.BottomOfPage: // place continue message at bottom of page //msg_yLocation = yBottomMargin + 2 * SixLinesPerInch + (float)docstyle.Layout.FooterLength; // 2 lines above bottom margin @@ -2818,7 +2818,7 @@ namespace Volian.Print.Library float xoffB = 0; // Added for Calvert Alarms: if 'doThreeContinues', continue message at bottom of page // and a continue message at the bottom of each column. - if (doThreeContinues) + if (doThreeContinues) { float ybot = yLocation; xoffB = (float)docstyle.Layout.LeftMargin + docstyle.Continue.Bottom.Margin ?? 0; @@ -3043,7 +3043,7 @@ namespace Volian.Print.Library // MNS Pagination - Mike Weiner Case 1a to keep step together with any non-sequential substeps (ANDs, EQ List) bool keepEqListTogether = ChildrenBelow[0].MyItemInfo.ActiveFormat.MyStepSectionLayoutData.PutOnPageByItself; if (keepEqListTogether && !ChildrenBelow[0].MyItemInfo.IsSequential && !this.MyItemInfo.IsHigh) // Extend to the last Item. - para = ChildrenBelow[ChildrenBelow.Count - 1].GetFirstPieceLastPart(); + para = ChildrenBelow[ChildrenBelow.Count - 1].GetFirstPieceLastPart(); else para = ChildrenBelow[0].GetFirstPieceLastPart(); } @@ -3093,8 +3093,8 @@ 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. - if(!myList[stepLevel].ContainsKey(yTop - yLocation)) - myList[stepLevel].Add(yTop - yLocation, para); + if (!myList[stepLevel].ContainsKey(yTop - yLocation)) + myList[stepLevel].Add(yTop - yLocation, para); } if (myList[stepLevel].Count == 0) CleanupListStepLevel.Add(stepLevel); @@ -3131,7 +3131,7 @@ namespace Volian.Print.Library private static VlnFlexGrid _MyFlexGrid = new VlnFlexGrid(1, 1); public static VlnFlexGrid MyFlexGrid { - get { return _MyFlexGrid; } + get { return _MyFlexGrid; } } private pkParagraph _MyPlaceKeeper = null; public pkParagraph MyPlaceKeeper @@ -3246,14 +3246,14 @@ namespace Volian.Print.Library MyTopRNO = MyParent.MyTopRNO; if (MyTopRNO != null) MyTopRNO.LastRNO = this; } - + if (!MyPageHelper.MyParagraphs.ContainsKey(itemInfo.ItemID) && !itemInfo.IsFootnote) MyPageHelper.MyParagraphs.Add(itemInfo.ItemID, this); // if this a continuous subsection, refresh the style. // This was commented out to fix a Westinghouse print issue 3-21-2014, orignally put in for Farley //if (itemInfo.IsStepSection && !(itemInfo as SectionInfo).IsSeparatePagination() && itemInfo.MyParent.IsSection) // RefreshDocStyle(); - + XOffset = xoff; if (!MyItemInfo.IsStep && !MyItemInfo.IsStepSection && MyItemInfo.MyContent.MyEntry != null) { @@ -3276,12 +3276,12 @@ namespace Volian.Print.Library // if this is a Note or Caution off of a Note or Caution (Catawba EG/1A/CSAM/SACGR1 step 1) // then indent it the length of its tab if (itemInfo.IsCaution || itemInfo.IsNote) - XOffset += (itemInfo.FormatStepData.TabData.IdentPrint.Length -1) * 6; + XOffset += (itemInfo.FormatStepData.TabData.IdentPrint.Length - 1) * 6; else if (itemInfo.ActiveFormat.MyStepSectionLayoutData.DevNoteOrCautionTabOffset != null) XOffset = float.Parse(itemInfo.ActiveFormat.MyStepSectionLayoutData.DevNoteOrCautionTabOffset); else - XOffset += 72 * (itemInfo.FormatStepData.CautionOrNoteSubstepIndent == null ? 0 : (float)itemInfo.FormatStepData.CautionOrNoteSubstepIndent / (float)itemInfo.FormatStepData.Font.CPI); + XOffset += 72 * (itemInfo.FormatStepData.CautionOrNoteSubstepIndent == null ? 0 : (float)itemInfo.FormatStepData.CautionOrNoteSubstepIndent / (float)itemInfo.FormatStepData.Font.CPI); } if (itemInfo.IsStep && itemInfo.MyHLS != null && itemInfo.MyHLS.FormatStepData.UseSmartTemplate && @@ -3394,7 +3394,7 @@ namespace Volian.Print.Library offset += xMetaAdj; itemInfo.MyTab.Text = itemInfo.MyTab.Text.TrimEnd(" ".ToCharArray()); itemInfo.MyTab.CleanText = itemInfo.MyTab.CleanText.TrimEnd(" ".ToCharArray()); - if (((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_SameXOffSubsections) == E_DocStructStyle.DSS_SameXOffSubsections)) + if (((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_SameXOffSubsections) == E_DocStructStyle.DSS_SameXOffSubsections)) offset += (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos; } } @@ -3455,7 +3455,7 @@ namespace Volian.Print.Library XOffset += diff; adjustAgain = false; } - else if(mytab != null) + else if (mytab != null) { float adjusttab = (itemInfo.MyParent.IsHigh) ? itemInfo.FormatStepData.AdjHighLevelTab ?? 0 : 0; mytab.XOffset += (mytab.Width + adjusttab); @@ -3471,11 +3471,11 @@ namespace Volian.Print.Library if (itemInfo.IsCautionOrNotePart && maxRNO == 0 && itemInfo.MyActiveSection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.LimitCautionNoteWidthToHLS) { float wMax = MyHighLevelParagraph.Width + MyHighLevelParagraph.XOffset - XOffset; - if (wMax < Width && (Width + XOffset > MyItemInfo.MyDocStyle.Layout.PageWidth) ) Width = wMax; + if (wMax < Width && (Width + XOffset > MyItemInfo.MyDocStyle.Layout.PageWidth)) Width = wMax; } } - if (itemInfo.IsSection && MyParent == null && itemInfo.MyDocStyle.SupplementalInformation && MyPromsPrinter.SupInfoPrintType==E_SupInfoPrintType.Merge) + if (itemInfo.IsSection && MyParent == null && itemInfo.MyDocStyle.SupplementalInformation && MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge) { _SupInfoSection = new vlnParagraph(this, cb, itemInfo, xoff, yoff, rnoLevel, maxRNO, formatInfo, null, null, yoffRightParent, false, pp); MyPromsPrinter.SupInfoPdfPageCount = -1; @@ -3509,7 +3509,7 @@ namespace Volian.Print.Library } if (itemInfo.MyHeader != null && itemInfo.MyHeader.Text != null && !doSectTab) yoff += SetHeader(this, cb, itemInfo, formatInfo); - else if(itemInfo.FormatStepData != null && itemInfo.FormatStepData.SeparateBox && itemInfo.FirstSibling.MyHeader != null && itemInfo.FirstSibling.MyHeader.Text != null) + else if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.SeparateBox && itemInfo.FirstSibling.MyHeader != null && itemInfo.FirstSibling.MyHeader.Text != null) yoff += SetHeader(this, cb, itemInfo.FirstSibling, formatInfo); float yoffLeft = yoff; if (ChildrenAbove != null) @@ -3521,7 +3521,7 @@ namespace Volian.Print.Library // For deviations, the Cautions are always in the same place. // Fix for Catawba E-1 deviation for step 10. Has note/caution off of a paragraph instead of HLS float xoffDev = (float)itemInfo.MyDocStyle.Layout.LeftMargin; - if(loadChildren) yoffLeft = ChildrenLeft.Add(cb, itemInfo.Cautions, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo); + if (loadChildren) yoffLeft = ChildrenLeft.Add(cb, itemInfo.Cautions, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo); } else { @@ -3600,7 +3600,7 @@ namespace Volian.Print.Library ChildrenAbove.StepDesignatorColumn = null; } DoAnnotationPrintableText(cb, itemInfo, yoff); // Look in annotation type to see if annotation has text that should be printed (like a step designator) - + // if this is a hls with a box, adjust the starting y location for the hls. this is done here // in case this hls had a boxed caution and/or note before it. Also, this code is here rather // than in the vlnparagraphs.add code because the yoff in that code will position the box, but @@ -3652,11 +3652,11 @@ namespace Volian.Print.Library { // We need to strip out the underline style from the font before putting out // the extra line. - VE_Font vf=MyItemInfo.FormatStepData.Font; + VE_Font vf = MyItemInfo.FormatStepData.Font; E_Style sty = (E_Style)vf.Style; if ((sty & E_Style.Underline) != 0) sty ^= E_Style.Underline; - vf = new VE_Font(vf.Family, (int) vf.Size, sty,(float) vf.CPI); + vf = new VE_Font(vf.Family, (int)vf.Size, sty, (float)vf.CPI); this.PartsAbove.Add(new vlnText(cb, this, " ", " ", 72, yoff, vf)); } @@ -3993,7 +3993,7 @@ namespace Volian.Print.Library } } } - if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) + if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) { // For Calvert Alarms, the row has formatting that makes this template item have a header & box // (CONDITION/RESPONSE), header with box around it is defined in genmac whereas the lines around @@ -4138,7 +4138,7 @@ namespace Volian.Print.Library else // AER or RNO Table if (loadChildren) yoff = ChildrenBelow.Add(cb, itemInfo.Tables, XOffset, yoff + yoffadj, yOffRight + yoffadj, rnoLevel, maxRNO, formatInfo); - } + } yOffRight = Math.Max(yOffRight, yoffLeft); // Look for the meta section case where the 'Editable' flag is set to 'N', which means that // these steps should not be printed: @@ -4186,7 +4186,7 @@ namespace Volian.Print.Library // below the HLS and close to the right margin. if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && itemInfo.Cautions != null && itemInfo.Cautions[0].FormatStepData.Type == "Caution1") { - if (loadChildren) + if (loadChildren) yoff = ChildrenBelow.Add(cb, itemInfo.Cautions, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo); savCheckListBottomMost = yoff; } @@ -4205,11 +4205,11 @@ namespace Volian.Print.Library if (loadChildren) yoff = ChildrenBelow.Add(cb, itemInfo.Sections, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo, pp); if (itemInfo.Procedures != null) - if (loadChildren) + if (loadChildren) 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 (rnoAfter) - if (loadChildren) + if (loadChildren) yoff = ChildrenBelow.Add(cb, itemInfo.RNOs, XOffset, yoff, yoff, rnoLevel + 1, maxRNO, formatInfo); yoff = Math.Max(yoff, yOffRight); // TODO - use RNOSepAfterAER flag too: @@ -4225,9 +4225,9 @@ namespace Volian.Print.Library // the hls has RNOs off of it, then the rno separator line is outside of the box. If // there are RNOs, but not off of HLS, then rno separator line is within the box (this is // how 16bit proms did this). The following use of yadjSep and YBottomForBox handle that - float yadjSep = (MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex != null && MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex >= 0 && + float yadjSep = (MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex != null && MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex >= 0 && MyItemInfo.MyHLS.RNOs != null && MyItemInfo.MyHLS.RNOs.Count > 0) ? 2 * SixLinesPerInch : 0; - vlnRNOSeparator myRnoSep = new vlnRNOSeparator(this, cb, tmpRnoSepStr, xsep, yoff+yadjSep, formatInfo, bottomChild == null ? true : bottomChild.MyItemInfo.HasChangeBar); + vlnRNOSeparator myRnoSep = new vlnRNOSeparator(this, cb, tmpRnoSepStr, xsep, yoff + yadjSep, formatInfo, bottomChild == null ? true : bottomChild.MyItemInfo.HasChangeBar); // TODO: May need to handle more than one RNO column for RNO Separator if ((rno.LastRNO.MyItemInfo.HasChangeBar == false && bottomChild != null && bottomChild.MyItemInfo.HasChangeBar) || (bottomChild != null && bottomChild.YBottom > rno.LastRNO.YBottomMost)) @@ -4258,7 +4258,7 @@ namespace Volian.Print.Library if ((MyItemInfo.IsHigh || MyItemInfo.IsCaution1) && MyItemInfo.MyDocStyle.LandscapePageList && MyItemInfo.MyDocStyle.ComponentList) { // put out line after step (for BGEVLV format) - float macroY = YBottomMost-(0.25f * SixLinesPerInch); + float macroY = YBottomMost - (0.25f * SixLinesPerInch); PartsLeft.Add(new vlnMacro((float)MyItemInfo.MyDocStyle.Layout.LeftMargin, macroY, "B9")); } @@ -4289,7 +4289,7 @@ namespace Volian.Print.Library { get { return vlnParagraph._AnnotationFont; } set { vlnParagraph._AnnotationFont = value; } - } + } private void DoAnnotationPrintableText(PdfContentByte cb, ItemInfo itemInfo, float yoff) { // if this step has an Annotation and it has config data to define location, parse out '[xx]' and print it at the location @@ -4308,12 +4308,12 @@ namespace Volian.Print.Library int end = ai.SearchText.IndexOf("]"); if (st != -1 && end != -1 && end > st) { - string pref = ai.SearchText.Substring(st+1, end - st - 1); // annotation - parse out [xx] - pref = Regex.Replace(pref,"{Up}",@"\u8593?", RegexOptions.IgnoreCase); - pref = Regex.Replace(pref,"{Down}",@"\u8595?", RegexOptions.IgnoreCase); + string pref = ai.SearchText.Substring(st + 1, end - st - 1); // annotation - parse out [xx] + pref = Regex.Replace(pref, "{Up}", @"\u8593?", RegexOptions.IgnoreCase); + pref = Regex.Replace(pref, "{Down}", @"\u8595?", RegexOptions.IgnoreCase); float xPref = atc.PrintableText_XLocation; - if(AnnotationFont==null) - AnnotationFont = new VE_Font(_MyItemInfo.FormatStepData.Font.Family,6,(E_Style)_MyItemInfo.FormatStepData.Font.Style,20F); + if (AnnotationFont == null) + AnnotationFont = new VE_Font(_MyItemInfo.FormatStepData.Font.Family, 6, (E_Style)_MyItemInfo.FormatStepData.Font.Style, 20F); PartsLeft.Add(new vlnText(cb, this, pref, pref, xPref, yoff, AnnotationFont)); break; } @@ -4431,7 +4431,7 @@ namespace Volian.Print.Library spFound = false; } results.Add(responsStr.Substring(start, lastspace - start).Trim(" ".ToCharArray()) + "\r\n"); - start = lastspace + (spFound?1:0); // increment start based on whether a space is found, i.e. if no space keep at 'indx' + start = lastspace + (spFound ? 1 : 0); // increment start based on whether a space is found, i.e. if no space keep at 'indx' // width either is equal to width of text after the last space, or is zero if at the maxlen of width: width = (indx - lastspace - 1) > 0 ? indx - lastspace - 1 : 0; lastspace = 0; @@ -4445,10 +4445,10 @@ namespace Volian.Print.Library } public override string Rtf { - get + get { - if(_Rtf == null)BuildRtf(); - return _Rtf; + if (_Rtf == null) BuildRtf(); + return _Rtf; } set { _Rtf = value; } } @@ -4591,7 +4591,7 @@ namespace Volian.Print.Library private void BuildContinuousActionSummary(vlnParagraph parent, ItemInfo itemInfo) { - if (itemInfo is SectionInfo) + if (itemInfo is SectionInfo) { MyContAct = new pkParagraph(this); if (parent != null && parent.MyItemInfo.IsSection) @@ -4903,8 +4903,8 @@ namespace Volian.Print.Library // In lines below, the 12 was used for Wolf Creek 2 column format, the pagewidth goes beyond the right border line so that // the tables, figures & equations were beyond the border. -12 takes it enough so that if boxed, it won't print out of border // We know this is not ideal. - if (MyItemInfo.IsRtfRaw && (XOffset + (scale * Width) > xUpperLimit-12)) - XOffset = xUpperLimit - (scale * Width) - 12; + if (MyItemInfo.IsRtfRaw && (XOffset + (scale * Width) > xUpperLimit - 12)) + XOffset = xUpperLimit - (scale * Width) - 12; if (!MyItemInfo.IsRtfRaw && XOffset + Width > xUpperLimit) XOffset = xUpperLimit - Width; // because of the above, if it pushes beyond the left margin, use the left margin. @@ -4940,7 +4940,7 @@ namespace Volian.Print.Library } if (MyItemInfo.Ordinal % everyNLines == 0 || MyItemInfo.NextItem == null) return SixLinesPerInch; // If the next table child is a figure, equation or a visio drawing add a blank line - if (MyItemInfo.Tables != null && MyItemInfo.Tables.Count > 0 && MyItemInfo.Tables[0].MyContent.MyGrid == null) return SixLinesPerInch; + if (MyItemInfo.Tables != null && MyItemInfo.Tables.Count > 0 && MyItemInfo.Tables[0].MyContent.MyGrid == null) return SixLinesPerInch; // Pagination issue to be used with yEndsWithBlankLine in Pagination code, but not checked in yet. //if (MyItemInfo.Ordinal % everyNLines == 0 || MyItemInfo.NextItem == null) return SixLinesPerInch; return 0; @@ -4964,7 +4964,7 @@ namespace Volian.Print.Library { float macroXOffset = myMacro.MacroXOffSet ?? 0; float widthAdj = myMacro.SingleColWidthAdjust ?? 0; // set as negative number in format - float rightTextEdge = (itemInfo.IsHigh)? XOffset + Width + mytab.XOffset:this.MyHighLevelParagraph.XOffset + this.MyHighLevelParagraph.Width; + float rightTextEdge = (itemInfo.IsHigh) ? XOffset + Width + mytab.XOffset : this.MyHighLevelParagraph.XOffset + this.MyHighLevelParagraph.Width; x = (macroXOffset > 0) ? macroXOffset : rightTextEdge; if (rightTextEdge > x) Width += widthAdj; @@ -5014,7 +5014,7 @@ namespace Volian.Print.Library chgIdTxt = sc == null ? null : sc.Step_ChangeID; } if (myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.ChgID) - cbMess = chgIdTxt!=null?chgIdTxt:itemInfo.MyContent.UserID; + cbMess = chgIdTxt != null ? chgIdTxt : itemInfo.MyContent.UserID; else if (myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.DateChgID) { string fmtDate = itemInfo.MyContent.DTS.ToShortDateString(); @@ -5025,7 +5025,7 @@ namespace Volian.Print.Library if (fmtDate.IndexOf("/", 3) == 1) fmtDate = fmtDate.Substring(0, 3) + "0" + fmtDate.Substring(3, fmtDate.Length - 3); } - cbMess = (chgIdTxt!=null?chgIdTxt:itemInfo.MyContent.UserID) + @"\n" + fmtDate; + cbMess = (chgIdTxt != null ? chgIdTxt : itemInfo.MyContent.UserID) + @"\n" + fmtDate; } else if (myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.RevNum) { @@ -5051,7 +5051,7 @@ namespace Volian.Print.Library float coltotwips = col * itemInfo.FormatStepData.Font.CharsToTwips; if (cbd.AbsoluteFixedChangeColumn) coltotwips = col * itemInfo.ActiveFormat.PlantFormat.FormatData.Font.CharsToTwips; if (itemInfo.IsFigure) coltotwips = col * itemInfo.ActiveFormat.PlantFormat.FormatData.Font.CharsToTwips; - return new vlnChangeBar(cb, this, (float)itemInfo.MyDocStyle.Layout.LeftMargin + coltotwips, yoff, msgAlign, + return new vlnChangeBar(cb, this, (float)itemInfo.MyDocStyle.Layout.LeftMargin + coltotwips, yoff, msgAlign, myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.RevNum, itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds); } @@ -5088,7 +5088,7 @@ namespace Volian.Print.Library if (bxCautNote != null) rightEdge = (float)bxCautNote.End + 10; // used for notes and cautions in the Prairie Island Alarms format rightEdge = rightEdge / paragraph.MyItemInfo.FormatStepData.Font.CharsToTwips; - return MyItemInfo.IsFigure?rightEdge+1:rightEdge; // B2017-111: Add a little more space between figure & change bar + return MyItemInfo.IsFigure ? rightEdge + 1 : rightEdge; // B2017-111: Add a little more space between figure & change bar } if (fixedChgCol < -10 || fixedChgCol >= 0) return ((fixedChgCol > 0) ? fixedChgCol : @@ -5134,7 +5134,7 @@ namespace Volian.Print.Library { int profileDepth = ProfileTimer.Push(">>>> GetRtf"); _RtfSB = new StringBuilder(); - DisplayText vlntxt = new DisplayText(itemInfo, E_EditPrintMode.Print, E_ViewMode.View, true, E_FieldToEdit.StepText, false, prefix, suffix,MyPageHelper.MyPromsPrinter.RemoveTrailingHardReturnsAndManualPageBreaks); + DisplayText vlntxt = new DisplayText(itemInfo, E_EditPrintMode.Print, E_ViewMode.View, true, E_FieldToEdit.StepText, false, prefix, suffix, MyPageHelper.MyPromsPrinter.RemoveTrailingHardReturnsAndManualPageBreaks); System.Drawing.Font myFont = vlntxt.TextFont.WindowsFont; if (!itemInfo.IsTable && StepRTB.MyFontFamily != null) // follow through in fixing an Out of Window Handles bug, use new function to see if @@ -5244,7 +5244,7 @@ namespace Volian.Print.Library // else // xoff = XOffset; //} - + vlnHeader myHeader = new vlnHeader(this, cb, itemInfo.MyHeader.Text, itemInfo.MyHeader.CleanText.TrimStart(" ".ToCharArray()), xoff + _MyBoxLeftAdj, YOffset, itemInfo.MyHeader.MyFont); PartsAbove.Add(myHeader); //return myHeader.Height + (!MyItemInfo.MyDocStyle.SpecialStepsFoldout || (MyItemInfo.MyDocStyle.ExtraLineHeader && (MyItemInfo.IsCaution || MyItemInfo.IsNote)) ? SixLinesPerInch : 0); @@ -5327,13 +5327,13 @@ namespace Volian.Print.Library } public float YSize // How big this paragraph is with all of its children { - get - { - float ysize = SmartTemplateAdjust + _YBottomMost - _YTopMost; - if (MyItemInfo.IsHigh && ((MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) == E_DocStructStyle.DoubleBoxHLS)) - ysize += SixLinesPerInch; - return ysize; - } + get + { + float ysize = SmartTemplateAdjust + _YBottomMost - _YTopMost; + if (MyItemInfo.IsHigh && ((MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) == E_DocStructStyle.DoubleBoxHLS)) + ysize += SixLinesPerInch; + return ysize; + } } private ItemInfo _MyItemInfo; public ItemInfo MyItemInfo @@ -5362,13 +5362,13 @@ namespace Volian.Print.Library private vlnParagraph _SupInfoSection; public vlnParagraph SupInfoSection { - get + get { if (_SupInfoSection == null) { _SupInfoSection = GetSupInfoSectionParagraph(); } - return _SupInfoSection; + return _SupInfoSection; } } private vlnParagraph GetSupInfoSectionParagraph() @@ -5555,7 +5555,7 @@ namespace Volian.Print.Library return; } else if (itemInfo.FormatStepData.UseOldTemplate && itemInfo.IsInTemplate() && - ((MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd)) + ((MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd)) { if (myTab != null) myTab.XOffset = XOffset; XOffset += myTab.Width; @@ -5569,7 +5569,7 @@ namespace Volian.Print.Library XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin; return; } - else if (itemInfo.IsParagraph && + else if (itemInfo.IsParagraph && (((itemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds) || ((itemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedDeviations) == E_PurchaseOptions.EnhancedDeviations)) && itemInfo.FormatStepData != null && PreviousIsTitleWithTextBelow(itemInfo)) @@ -5603,7 +5603,7 @@ namespace Volian.Print.Library { //Adjust Indent for Wolf Creek Background format flag float indentBG2 = itemInfo.IsPartOfBackgroundStep() ? itemInfo.FormatStepData.Font.CharsToTwips * 2 : 0; - XOffset = childindent + MyParent.XOffset+ indentBG2;//(itemInfo.FormatStepData.Font.CharsToTwips * 2); + XOffset = childindent + MyParent.XOffset + indentBG2;//(itemInfo.FormatStepData.Font.CharsToTwips * 2); // B2016-164: Added the following 'if' so that the width is not recalculated if in the alarm format & the parent has a template // B2016-168: The fix for 164 broke deviation document printing. The if statement was fixed for both: if (!itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm || !UseTemplateWidthOrXOff(itemInfo.MyParent)) @@ -5633,8 +5633,8 @@ namespace Volian.Print.Library } if (itemInfo.IsHigh) { - if (formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm || - ((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_SameXOffSubsections) == E_DocStructStyle.DSS_SameXOffSubsections)) + if (formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm || + ((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_SameXOffSubsections) == E_DocStructStyle.DSS_SameXOffSubsections)) { // the HLS in the template prints the tab/step on the right edge of page. Don't // do the other calculations to relocate it. @@ -5735,7 +5735,7 @@ namespace Volian.Print.Library if (myTab != null) myTab.XOffset = (float)colOvrd; // set the note/caution tab offset to the colOverride return; } - // put in for Point Beach (wep2) we don't want to do this if we are processing a boxed substep (cont. action substep) + // put in for Point Beach (wep2) we don't want to do this if we are processing a boxed substep (cont. action substep) else if (bxIndx != null && (itemInfo.IsCaution || itemInfo.IsNote || !itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.ContActBoxOnSubSteps)) { @@ -5789,7 +5789,7 @@ namespace Volian.Print.Library { // if the tab is 3 char or smaller, make the indent amount for the rno text 4 characters. // if bigger, make it the additional tab size. - int len = myTab.Text.Trim().Length; + int len = myTab.Text.Trim().Length; int adj = len <= 3 ? 4 : (len - 3) + 4; float rnoOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)itemInfo.MyDocStyle.CenterLineX + 5; float tPtPerChar = itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TabPtsPerChar ?? 6; @@ -5865,7 +5865,7 @@ namespace Volian.Print.Library //} else // if no left justify, right align the tab { - // The following fixes F2016-033: Print the Verification Point at left margin. + // The following fixes F2016-033: Print the Verification Point at left margin. if (itemInfo.ActiveFormat.Name.ToUpper().StartsWith("VCB") && (itemInfo.FormatStepData.ColOverride ?? 0) > 0) { XOffset = (float)itemInfo.FormatStepData.ColOverride; @@ -5896,12 +5896,12 @@ namespace Volian.Print.Library } private bool PreviousIsTitleWithTextBelow(ItemInfo itemInfo) { - while(itemInfo.MyPrevious != null) + while (itemInfo.MyPrevious != null) { if (itemInfo.MyPrevious.FormatStepData.Type == "TitleWithTextBelow") return true; - itemInfo=itemInfo.MyPrevious; + itemInfo = itemInfo.MyPrevious; } - return false; + return false; } private static float GetLeftJustify(FormatInfo formatInfo, int indxLevels) @@ -5938,7 +5938,7 @@ namespace Volian.Print.Library // Calvert subheaders in valve lists - the text gets centered, so the width is the width // of the page (also, don't do this for alarms, thus the !SpecialCaseCalvert Alarms, since // alarms use Caution1 as the annunciator): - if (itemInfo.IsStep && itemInfo.MyHLS != null && !itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && + if (itemInfo.IsStep && itemInfo.MyHLS != null && !itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && itemInfo.MyHLS.FormatStepData.UseOldTemplate && itemInfo.MyDocStyle.ComponentList && itemInfo.IsCaution1) { Width = (float)itemInfo.MyDocStyle.Layout.PageWidth - (float)itemInfo.MyDocStyle.Layout.LeftMargin; @@ -5967,7 +5967,7 @@ namespace Volian.Print.Library Width = MyParent.MyParent.Width; return; } - if (widOvrd == 0 && itemInfo.MyParent.IsStep && + if (widOvrd == 0 && itemInfo.MyParent.IsStep && (itemInfo.MyParent.FormatStepData.Type.ToUpper() == "TITLEWITHTEXTBELOW" || (((itemInfo.MyActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd) && itemInfo.FormatStepData != null && MyParent.MyItemInfo.MyPrevious != null && MyParent.MyItemInfo.MyPrevious.FormatStepData.Type == "TitleWithTextBelow"))) @@ -6027,7 +6027,7 @@ namespace Volian.Print.Library Width = ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); Width += _WidthAdjust; Width += adjwidth; - + // if AlignHLSTabWithSect is set, we moved the starting x location of the HLS, and following steps // to be under section header. Adjust the width accordingly, or the text may go out of the margin. if (myTab == null && itemInfo.FormatStepData.AlignNullTabWSectHead && itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert) @@ -6094,11 +6094,11 @@ namespace Volian.Print.Library XOffset += mycolT; // adjust caution/note text position if (PartsLeft != null && PartsLeft.Count > 0)// adjust tab position { - if(myTab!=null && (itemInfo.IsNote || itemInfo.IsCaution)) + if (myTab != null && (itemInfo.IsNote || itemInfo.IsCaution)) Width -= myTab.Width; foreach (vlnPrintObject vpo in PartsLeft) vpo.XOffset += mycolT; - } + } } else if (itemInfo.IsSection) { @@ -6142,10 +6142,10 @@ namespace Volian.Print.Library } else if (itemInfo.MyParent.IsCaution || itemInfo.MyParent.IsNote) { - if(itemInfo.ActiveFormat.MyStepSectionLayoutData.DevNoteOrCautionTabOffset != null) + if (itemInfo.ActiveFormat.MyStepSectionLayoutData.DevNoteOrCautionTabOffset != null) Width = MyParent.MyParent.Width - tabWidth + (myTab == null ? 0 : myTab.TabAlign); else - Width = MyParent.Width - tabWidth + (myTab == null ? 0 : myTab.TabAlign); + Width = MyParent.Width - tabWidth + (myTab == null ? 0 : myTab.TabAlign); Width -= 72 * (itemInfo.FormatStepData.CautionOrNoteSubstepIndent == null ? 0 : (float)itemInfo.FormatStepData.CautionOrNoteSubstepIndent / (float)itemInfo.FormatStepData.Font.CPI); } else @@ -6172,7 +6172,7 @@ namespace Volian.Print.Library if (((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_SameXOffSubsections) == E_DocStructStyle.DSS_SameXOffSubsections)) { // don't adjust the width if there already was an adjustment for checkoffs - for VCB only (F2016-039) - if (!(itemInfo.ActiveFormat.Name.ToUpper().StartsWith("VCB")&&coadj)) + if (!(itemInfo.ActiveFormat.Name.ToUpper().StartsWith("VCB") && coadj)) adjwidth = MyTab != null ? -MyTab.Width : 0; } else if (sd.UseMetaSections) @@ -6386,9 +6386,9 @@ namespace Volian.Print.Library // For B2015-014, some migrated data for background documents had the TitleWithTextBelow with associated paragraphs // as siblings rather than children. Pagination was sometimes putting the TitleWithTextBelow on one page and the // paragraphs on next. The following code checks thse types, if in enhanced documents but not the Short Form Deviations. - if (paraLoc.MyParagraph.MyItemInfo.ActiveFormat != null + if (paraLoc.MyParagraph.MyItemInfo.ActiveFormat != null && ((paraLoc.MyParagraph.MyItemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds) - || (((paraLoc.MyParagraph.MyItemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedDeviations) == E_PurchaseOptions.EnhancedDeviations) + || (((paraLoc.MyParagraph.MyItemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedDeviations) == E_PurchaseOptions.EnhancedDeviations) && paraLoc.MyParagraph.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.EnhancedShortFormDev)) { if (!paraLoc.MyParagraph.MyItemInfo.IsTitle && paraLoc.MyParagraph.MyItemInfo.MyPrevious != null && paraLoc.MyParagraph.MyItemInfo.MyPrevious.FormatStepData.Type == "TitleWithTextBelow") level = 0;