diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index a286b670..048d118f 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -1167,7 +1167,7 @@ namespace Volian.Print.Library 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.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader && (!MyItemInfo.IsSection || MyItemInfo.IsSeparateSubsection)) + 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; @@ -4375,30 +4375,7 @@ namespace Volian.Print.Library } float adjwidth = CheckOffAdj; CheckOffWidth = -CheckOffAdj; - SectData sd = formatInfo.PlantFormat.FormatData.SectData; - if (sd.UseMetaSections) - { - if (sd.StepSectionData.StepSectionLayoutData.TieTabToLevel) - { - if (ShowSectionTitles - && !itemInfo.MyDocStyle.CancelSectTitle - && !(itemInfo.MyDocStyle.SpecialStepsFoldout && itemInfo.MyDocStyle.UseColSByLevel)) - { - int indxLevel = itemInfo.PrintLevel + itemInfo.CurrentSectionLevel(); - adjwidth += formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].WidSAdjByLevel ?? 0; ; - 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; - adjwidth -= seclvlindent; - adjwidth -= AdjustForSectionLevelTab(); - } - } - else - { - if (formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count > 0) - adjwidth += (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[itemInfo.PrintLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].ColSByLevel; - } - } - + adjwidth = AdjustMetaWidth(itemInfo, formatInfo, adjwidth); Width = ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); Width += _WidthAdjust; Width += adjwidth; @@ -4456,7 +4433,10 @@ namespace Volian.Print.Library } else if (itemInfo.IsSection) { - Width = _WidthAdjust + ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); + Width = ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); + float adjwidths = 0; + adjwidths = AdjustMetaWidth(itemInfo, formatInfo, adjwidths); + Width += (adjwidths + _WidthAdjust); } else if (MyParent == null) { @@ -4500,6 +4480,35 @@ namespace Volian.Print.Library Width += 10; // FIX THIS!!! } + private float AdjustMetaWidth(ItemInfo itemInfo, FormatInfo formatInfo, float adjwidth) + { + SectData sd = formatInfo.PlantFormat.FormatData.SectData; + if (sd.UseMetaSections) + { + if (sd.StepSectionData.StepSectionLayoutData.TieTabToLevel) + { + if (ShowSectionTitles + && !itemInfo.MyDocStyle.CancelSectTitle + && !(itemInfo.MyDocStyle.SpecialStepsFoldout && itemInfo.MyDocStyle.UseColSByLevel)) + { + int indxLevel = itemInfo.PrintLevel + itemInfo.CurrentSectionLevel(); + if (indxLevel > 1) Console.WriteLine("level={0} in: {1}", indxLevel, itemInfo.ShortPath); + adjwidth += formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].WidSAdjByLevel ?? 0; ; + 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; + adjwidth -= seclvlindent; + if (itemInfo.IsStep) adjwidth -= AdjustForSectionLevelTab(); + } + } + else + { + if (formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count > 0) + adjwidth += (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[itemInfo.PrintLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].ColSByLevel; + } + } + return adjwidth; + } + // for Component Table, don't increment yoff unless last item in table that HAS data associated // with it (there may be empty cells at end). public bool UseTemplateKeepOnCurLine(ItemInfo itemInfo)