diff --git a/PROMS/Formats/fmtall/vcb1all.xml b/PROMS/Formats/fmtall/vcb1all.xml index 92219258..67c54286 100644 Binary files a/PROMS/Formats/fmtall/vcb1all.xml and b/PROMS/Formats/fmtall/vcb1all.xml differ diff --git a/PROMS/VEPROMS User Interface/frmSectionProperties.cs b/PROMS/VEPROMS User Interface/frmSectionProperties.cs index 7f7e6859..013b0b48 100644 --- a/PROMS/VEPROMS User Interface/frmSectionProperties.cs +++ b/PROMS/VEPROMS User Interface/frmSectionProperties.cs @@ -610,8 +610,8 @@ namespace VEPROMS } if (oldSelIndx > newDocStyles.Count) { - string msg = string.Format("The section type that is set is not available in the new format, it was reset to '{0}'. Verify that it is appropriate.", newDocStyles.GetDocStyleItem(0).Name); - MessageBox.Show(msg, "Non-existent section"); + string msg = string.Format("Since the format has been changed, the section type was also changed to '{0}'. Verify that it is appropriate and if not, select a new section type.", newDocStyles.GetDocStyleItem(0).Name); + MessageBox.Show(msg, "Verify section type"); selindx = 0; } } diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PageStyles.cs b/PROMS/VEPROMS.CSLA.Library/Format/PageStyles.cs index 3b14a400..abb144f4 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PageStyles.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PageStyles.cs @@ -133,6 +133,18 @@ namespace VEPROMS.CSLA.Library return (LazyLoad(ref _MaxWidth, "@MaxWidth")); } } + // MaxWidth, above, flagged that, if there was more than 1 line, the topmargin would be adjusted by however + // many lines the PSI item contained (for wst alarms). The MaxWidthCurPage is used when that adjustment + // should not be made, the length of the PSI item is only relevant for the current page. + // (see AdjustTopMarginForMultiLinePageListItems variable and how it is used) + private LazyLoad _MaxWidthCurPage; + public int? MaxWidthCurPage + { + get + { + return (LazyLoad(ref _MaxWidthCurPage, "@MaxWidthCurPage")); + } + } #endregion #region Override ToString public override string ToString() diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs index 576ea3f0..186488d3 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs @@ -3928,6 +3928,22 @@ namespace VEPROMS.CSLA.Library return (tocProcStepsTitle == null || tocProcStepsTitle == "") ? "" : tocProcStepsTitle; } } + private LazyLoad _TofCLineSpacingSub; + public int? TofCLineSpacingSub + { + get + { + return LazyLoad(ref _TofCLineSpacingSub, "@TofCLineSpacingSub"); + } + } + private LazyLoad _TofCRemoveGrpNameInSects; + public bool TofCRemoveGrpNameInSects + { + get + { + return LazyLoad(ref _TofCRemoveGrpNameInSects, "@TofCRemoveGrpNameInSects"); + } + } private VE_Font _Font; public VE_Font Font { diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index 29beabdd..54ff5eab 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -1180,11 +1180,25 @@ namespace Volian.Print.Library yLocation = lastyLocation = 0; rtnval = Rtf2Pdf.TextAt(cb, myparagraphtc, leftMargin + secNumPos, yPageStart - yLocation, w, height, "", yBottomMargin); } - yLocation += (2 * vlnPrintObject.SixLinesPerInch); // new line + int lnaftergroup = ((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 0) > 0) ? 1 : 2; + yLocation += (lnaftergroup * vlnPrintObject.SixLinesPerInch); // new line } // need to do the section number, section title & page number. Page number // has to be put on at end after number of page is known, so use a Template. + bool didGrp = false; string tmptxt = mySection.MyContent.Number == null || mySection.MyContent.Number == "" ? " " : mySection.MyContent.Number; + if (tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCRemoveGrpNameInSects + && tocGrpHeading.Length > 0 && tmptxt.ToUpper().Contains(tocGrpHeading)) + { + tmptxt = tmptxt.Replace(tocGrpHeading, ""); + didGrp = true; + } + if (tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCRemoveGrpNameInSects + && lastTOCGroupHeading.Length > 0 && tmptxt.ToUpper().Contains(lastTOCGroupHeading)) + { + tmptxt = tmptxt.Replace(lastTOCGroupHeading, ""); + didGrp = true; + } string rtfText = GetRtfToC(tmptxt, tOfC); Paragraph myparagraphn = vlnPrintObject.RtfToParagraph(rtfText); float width = 0; @@ -1254,7 +1268,7 @@ namespace Volian.Print.Library // is put out. retval = Rtf2Pdf.TextAt(cb, myparagraphn, leftMargin + secNumPos + indentOffset, yPageStart - yLocation, numwidth * 1.3F, height, "", yBottomMargin); - float lSpace = (float)(tOfC.TofCLineSpacing ?? 1) * vlnPrintObject.SixLinesPerInch; + //float lSpace = (float)(tOfC.TofCLineSpacing ?? 1) * vlnPrintObject.SixLinesPerInch; // adjust ylocation for pagenumber - the ylocation will get reset if the // section title split on 2 lines and the page number needs to be on the 2nd line. @@ -1330,8 +1344,15 @@ namespace Volian.Print.Library else AddTemplateTOCPageCounts(tOfC, yLocation, yPageStartAdj, leftMargin, secPagePos, height, mySection); } - - yLocation += (float)(tOfC.TofCLineSpacing ?? 1) * vlnPrintObject.SixLinesPerInch; + //If the format wants single spacing within subsections (2nd level and lower), then need to figure out + // spacing (vcb1 table of contents) + bool dosuby = (((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 1) > 0) + && (mySection.MyParent.IsSection && ((mySection.Sections != null && mySection.Sections.Count > 0) || (level > 0 && mySection.NextItem != null)))) + || didGrp; + if (dosuby) + yLocation += (float)(tOfC.TofCLineSpacingSub ?? 1) * vlnPrintObject.SixLinesPerInch; + else + yLocation += (float)(tOfC.TofCLineSpacing ?? 1) * vlnPrintObject.SixLinesPerInch; } yLocation = AddSectionToTOC(tocSection, mySection, tOfC, cb, yPageStart, yLocation); } diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs index fc7807bc..1a4b44ee 100644 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs +++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs @@ -2000,10 +2000,11 @@ namespace Volian.Print.Library // defined, see if the text is too wide for a single line (SplitTextMaxWidth). The // AdjustTopMarginForMultLinePageListItem contains the y-adjustment that must be considered // in the TopMargin if the PSI text split onto more than one line. - if ((pageItem.MaxWidth??0)>0) + if ((pageItem.MaxWidth??0)>0 || (pageItem.MaxWidthCurPage??0)>0) { - int locwid = (int)pageItem.MaxWidth; + int locwid = ((pageItem.MaxWidth??0)>0)?(int)pageItem.MaxWidth:(int)pageItem.MaxWidthCurPage; AdjustTopMarginForMultiLinePageListItems = SplitTextMaxWidth(svgGroup, pageItem, val, locwid, token, ref plstr); + if ((pageItem.MaxWidthCurPage ?? 0) > 0) AdjustTopMarginForMultiLinePageListItems = 0; } else plstr = plstr.Replace(token, val);