From 62ba5c5c05b783fa4d3355e028de107e43d54cff Mon Sep 17 00:00:00 2001 From: Kathy Date: Thu, 25 Jul 2013 13:26:51 +0000 Subject: [PATCH] Improve check for UseOnFirst/UseOnAllButFirst' docstyle flags --- PROMS/Volian.Print.Library/PromsPrinter.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index 83b8cfbf..7469f245 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -370,6 +370,7 @@ namespace Volian.Print.Library int progress = 0; int finalMessageSectionID = GetFinalMessageSectionID(myProcedure, doingFoldout); string LastFmtName = null; + int lastDocStyle = -1; foreach (SectionInfo mySection in myProcedure.Sections) { if (((mySection.MyContent.Number.ToUpper() == "FOLDOUT" && myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts) @@ -383,6 +384,7 @@ namespace Volian.Print.Library if (_MyHelper == null) { LastFmtName = mySection.ActiveFormat.Name; + lastDocStyle = (int)mySection.MyDocStyle.Index; string hlsText = ""; int hlsItemId = 0; if (mySection.IsStepSection && mySection.Steps != null && mySection.Steps.Count > 0) @@ -433,8 +435,12 @@ namespace Volian.Print.Library //Console.WriteLine("'{0}' PromsPrinter", mySection.DisplayText); // if pagination is separate or we've changed the format, we have not done the first page // (if this format has the useonfirst page docstyle flag) - if (LastFmtName != mySection.ActiveFormat.Name || mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate) - _MyHelper.DidFirstPageDocStyle = false; + if (LastFmtName != mySection.ActiveFormat.Name || lastDocStyle != (int)mySection.MyDocStyle.Index || mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate) + { + _MyHelper.DidFirstPageDocStyle = false; + lastDocStyle = (int)mySection.MyDocStyle.Index; + LastFmtName = mySection.ActiveFormat.Name; + } if (!mySection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)mySection, ((mySection.DisplayNumber ?? "") == "" ? "" : mySection.DisplayNumber + " - ") + mySection.DisplayText, null); _MyHelper.MySection = mySection; OnStatusChanged("After Set Svg", PromsPrinterStatusType.SetSVG);