From 37d570626ea9f934eb30b3796fc47d8c7b1caed3 Mon Sep 17 00:00:00 2001 From: Kathy Date: Fri, 27 Mar 2015 12:53:12 +0000 Subject: [PATCH] B2015-043: BGE - fixed section continuation headers and x-offset for subsection titles in OI-34 Appendix sections --- PROMS/Volian.Print.Library/vlnParagraph.cs | 84 ++++++++++++++++------ 1 file changed, 64 insertions(+), 20 deletions(-) diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index d1abc424..6a74d6f6 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -1141,19 +1141,33 @@ namespace Volian.Print.Library ItemInfo mypar = itemInfo.MyParent; while (mypar != null && !mypar.IsProcedure) { - string pTab = mypar.MyTab.CleanText.Trim(); - if (pTab.Length > 0 && char.IsLetterOrDigit(pTab[0])) + // The following check was added for BGE/OI34. Their APPENDIX sections had the subsections + // printing with incorrect tab in the SectionTitleContinued message. Before this + // fix the tabs were A.B Procedure (Continued) rather than B. Procedure (Continued). + // Unfortunately there was not enough time to make the 'if' statement based on config + // or format settings. + bool addTab = true; + if (mypar.IsSection && mypar.DisplayNumber.ToUpper().Contains("APPENDIX ")) { - pTab = pTab.TrimEnd(" .".ToCharArray()) + "."; - prTab = pTab + prTab; + SectionConfig sch = mypar.MyConfig as SectionConfig; + addTab = (sch == null || sch.Section_PrintHdr == "Y");// && !mypar.MyDocStyle.CancelSectTitle; } - else + if (addTab) { - // There' a bullet or some other graphics character. - // clear out the tab we are building so the we can build - // a continue tab up to this bullet or graphic character. - prTab = ""; - thisTab = ""; + string pTab = mypar.MyTab.CleanText.Trim(); + if (pTab.Length > 0 && char.IsLetterOrDigit(pTab[0])) + { + pTab = pTab.TrimEnd(" .".ToCharArray()) + "."; + prTab = pTab + prTab; + } + else + { + // There' a bullet or some other graphics character. + // clear out the tab we are building so the we can build + // a continue tab up to this bullet or graphic character. + prTab = ""; + thisTab = ""; + } } mypar = (mypar.IsSection && !mypar.IsSeparateSubsection) ? null : mypar.MyParent; } @@ -1446,14 +1460,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 == "") - doSectionTitleContinued = false; - else - { - SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig; - doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle; - } + 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 { @@ -2582,8 +2606,28 @@ namespace Volian.Print.Library { SectionConfig sc = itemInfo.MyParent.MyConfig as SectionConfig; if (MyParent != null) - offset = (sc != null && sc.SubSection_AutoIndent == "Y") ? MyParent.XOffset - : (MyParent.MyTab != null)?MyParent.MyTab.XOffset:XOffset; + { + // if the parent is not printed, then adjust the xoffset based on + // the level of the metasection. Note that the 'if (MetaLevel==20) MetaLevel = 1' + // line of code was added so that the xoffsets between 16 & 32 bit are closer. + // This code was added to fix problems in BGE OI34, Appendix sections/subsection xoffsets. + if (sc != null && sc.Section_PrintHdr == "N") + { + if (MetaLevel == 2) MetaLevel = 1; + xMetaAdj = (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[0].ColSByLevel; + for (int i = 0; i < MetaLevel; i++) + { + xMetaAdj += (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos - (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos; + xMetaAdj += (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[i].SecNumPositionAdj; + } + offset += xMetaAdj; + } + else + { + offset = (sc != null && sc.SubSection_AutoIndent == "Y") ? MyParent.XOffset + : (MyParent.MyTab != null) ? MyParent.MyTab.XOffset : XOffset; + } + } } } else