diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 9f7e2da0..8b643543 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -1253,7 +1253,7 @@ namespace VEPROMS.CSLA.Library #endregion public int FoldoutIndex() { - if (ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts && (ActiveSection.MyDocStyle.StructureStyle.Style ?? 0 & E_DocStructStyle.UseSectionFoldout) != 0) return 0; + if (ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts && ((ActiveSection.MyDocStyle.StructureStyle.Style ?? 0 & E_DocStructStyle.UseSectionFoldout) == E_DocStructStyle.UseSectionFoldout)) return 0; // now check for floating foldouts. If there is a floating foldout, also find which one it uses. // This is data off of the ? if (ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && ActiveSection.IsDefaultSection) @@ -2544,10 +2544,10 @@ namespace VEPROMS.CSLA.Library } if (tbformat.IndexOf("#2#") > -1 || tbformat.IndexOf("#1#") > -1) { - string ofst = tbformat.Substring(0, 3); - _MyTab.Offset = Convert.ToInt32(ofst.Substring(1, 1)); - cltext = tbformat.Replace("#2#", ""); - cltext = cltext.Replace("#1#", ""); + int indxlb = tbformat.IndexOf("#"); + string ofst = tbformat.Substring(indxlb+1, 3); + _MyTab.Offset = Convert.ToInt32(ofst.Substring(0, 1)) * 10; + tbformat = tbformat.Replace("#2#", "").Replace("#1#", ""); } // if this is a caution/note type determine where 'NOTE/CAUTION' tab goes, as tab or as 'header' // and also determine whether the tab itself gets converted to a bullet. diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs index 5a2723a3..1f161fa9 100644 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs +++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs @@ -160,10 +160,12 @@ namespace Volian.Print.Library cb.RestoreState(); } - private void ResetDocStyleAndValues() + private bool ResetDocStyleAndValues() { // if this document style has another style that is for pages other than first, we need to - // reset the document style off of this section AND reset docstyle values used. + // reset the document style off of this section AND reset docstyle values used + // AND reset the 'svg' data. + bool forceLoadSvg = false; if ((MySection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnFirstPage) > 0) { //Console.WriteLine("{0} ResetDocStyleAndValues", MySection.MyDocStyle.Name); @@ -174,10 +176,17 @@ namespace Volian.Print.Library if (ds.Index == indx) { MySection.MyDocStyle = ds; + forceLoadSvg = true; break; } } } + return forceLoadSvg; + } + public void ResetSvg() + { + Volian.Svg.Library.Svg sectSvg = BuildSvg(_MySection, true); + if (sectSvg != null) MySvg = sectSvg; } private void DrawRuler(PdfContentByte cb) { @@ -345,8 +354,10 @@ namespace Volian.Print.Library { _MySection = value; MySectionTitle = ((_MySection.DisplayNumber ?? "")=="" ? "" : _MySection.DisplayNumber + " - ") + _MySection.DisplayText; - if (DidFirstPageDocStyle) ResetDocStyleAndValues(); - Volian.Svg.Library.Svg sectSvg = BuildSvg(_MySection); + bool forceLoadSvg = false; + if (DidFirstPageDocStyle) + forceLoadSvg = ResetDocStyleAndValues(); // this method also gets the SVG (the 'else' part of this) + Volian.Svg.Library.Svg sectSvg = BuildSvg(_MySection, forceLoadSvg); if (sectSvg != null) MySvg = sectSvg; } } @@ -502,7 +513,7 @@ namespace Volian.Print.Library MySection = mySection; MyPromsPrinter = myPromsPrinter; } - private Volian.Svg.Library.Svg BuildSvg(VEPROMS.CSLA.Library.SectionInfo mySection) + private Volian.Svg.Library.Svg BuildSvg(VEPROMS.CSLA.Library.SectionInfo mySection, bool forceLoad) { // if mysection uses continuous pagination, and the previous section uses the same format, // and the docstyle is set to use on first page only, @@ -529,7 +540,7 @@ namespace Volian.Print.Library mySvg.LeftMargin = (float)docStyle.Layout.LeftMargin; mySvg.TopMargin = 9.6F; VEPROMS.CSLA.Library.PageStyle pageStyle = docStyle.pagestyle; - AddPageListItems(mySvg, pageStyle, mySection); + AddPageListItems(mySvg, pageStyle, mySection, forceLoad); mySvg.ProcessText += new SvgProcessTextEvent(mySvg_ProcessText); // if this section had a previous section and this is continuous, don't generate the svg for // it, we'll use the previous section. The only thing we need to do is to process through the @@ -542,6 +553,7 @@ namespace Volian.Print.Library sPag = sc.Section_Pagination; } //if (sPag == SectionConfig.SectionPagination.Continuous && !mySection.DidFirstPageDocStyle) return null; + if (forceLoad) return mySvg; if (sPag == SectionConfig.SectionPagination.Continuous) return null; return mySvg; } @@ -716,7 +728,7 @@ namespace Volian.Print.Library public SvgText PageListCheckOffHeader = null; public Dictionary PgLogicals; - private void AddPageListItems(Volian.Svg.Library.Svg mySvg, VEPROMS.CSLA.Library.PageStyle pageStyle, VEPROMS.CSLA.Library.SectionInfo section) + private void AddPageListItems(Volian.Svg.Library.Svg mySvg, VEPROMS.CSLA.Library.PageStyle pageStyle, VEPROMS.CSLA.Library.SectionInfo section, bool forceLoad) { //Console.WriteLine("{0}", section.ActiveFormat.Name); //Console.WriteLine("{0} pgstyle {1} section", pageStyle.Name,section.DisplayText); @@ -745,7 +757,7 @@ namespace Volian.Print.Library // Console.WriteLine("{0} - PageList Token", pageItem.Token); VE_Font useFontForCheckOffHeader = null; - if (sPag == SectionConfig.SectionPagination.Separate || ((sPag == SectionConfig.SectionPagination.Continuous || sPag ==0 )&& (pageItem.Row < 0))) + if (forceLoad || (sPag == SectionConfig.SectionPagination.Separate || ((sPag == SectionConfig.SectionPagination.Continuous || sPag ==0 )&& (pageItem.Row < 0)))) { //if (PrevRow > 0) //{ diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index c8f832b7..219e43f2 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -37,7 +37,7 @@ namespace Volian.Print.Library string lastHeader = null; foreach (ItemInfo childItemInfo in itemInfoList) { - if (childItemInfo.FormatStepData.TabData != null && childItemInfo.FormatStepData.TabData.IsTransition) + if (childItemInfo.FormatStepData != null && childItemInfo.FormatStepData.TabData != null && childItemInfo.FormatStepData.TabData.IsTransition) { lastHeader = childItemInfo.DisplayText; } @@ -620,8 +620,8 @@ namespace Volian.Print.Library // if this document style has another style that is for pages other than first, we need to // reset the document style off of this section AND reset docstyle values used. if ((MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnFirstPage) > 0) - { - float _PointsPerPage = 792; + { + float _PointsPerPage = 792; ItemInfo ii = (ItemInfo)MyItemInfo.MyActiveSection; int indx = (int)MyItemInfo.MyActiveSection.MyDocStyle.IndexOtherThanFirstPage; foreach (DocStyle ds in ii.ActiveFormat.PlantFormat.DocStyles.DocStyleList) @@ -629,6 +629,9 @@ namespace Volian.Print.Library if (ds.Index == indx) { MyItemInfo.MyActiveSection.MyDocStyle = ds; + MyPageHelper.MySection = MyItemInfo.MyActiveSection as SectionInfo; + MyPageHelper.MySection.MyDocStyle = ds; + MyPageHelper.ResetSvg(); break; } } @@ -701,6 +704,8 @@ namespace Volian.Print.Library { if (myMsg.IndexOf(@"%d") > -1) myMsg = myMsg.Replace(@"%d", MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols.Trim()); + if (myMsg.IndexOf(@"%0d") > -1) + myMsg = myMsg.Replace(@"%0d", MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols.Trim(" .".ToCharArray())); if (myMsg.IndexOf(@"%2d") > -1) myMsg = myMsg.Replace(@"%2d", MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols.Trim(" .".ToCharArray()).PadLeft(2)); float msg_yLocation = 0; @@ -715,7 +720,7 @@ namespace Volian.Print.Library msg_yLocation = msg_yLocation + yLocation - SixLinesPerInch; break; case E_ContBottomLoc.BtwnTextAndBottom: // place continue string between end of text & bottom of page - msg_yLocation = msg_yLocation + yLocation - ((yLocation - yBottomMargin) / 2); + msg_yLocation = msg_yLocation + yLocation - ((yLocation - yBottomMargin) / 2); // +SixLinesPerInch; (need this for IP3) 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 @@ -1780,6 +1785,8 @@ namespace Volian.Print.Library 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 (MyItemInfo.Ordinal % everyNLines == 0 || MyItemInfo.NextItem == 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; } private void AddMacros(ItemInfo itemInfo, vlnTab mytab) @@ -2324,6 +2331,7 @@ namespace Volian.Print.Library } } } + // FNP tabbing '#2#' and '#1#', not fully tested: XOffset -= itemInfo.MyTab.Offset; } private static float GetLeftJustify(FormatInfo formatInfo, int indxLevels)