diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index bc5c833a..923e1e7a 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -6977,27 +6977,36 @@ namespace VEPROMS.CSLA.Library [Serializable()] public partial class SectionInfo : ItemInfo, IVEDrillDownReadOnly { + // B2017-192: The two dictionaries were introduced so that the lists off of the section were always found + // by the print code that determines what sup info steps go on the facing pages (the code was accessing the + // incorrect cached step section sometimes, so the list was not found. // Keeps track of itemids for supplemental info steps where their associated steps would have page breaks. - private List _StepSectPageBreaksForSupInfo = null; + private static Dictionary> _LookupStepSectPageBreaksForSupInfo = new Dictionary>(); + public static void ResetLookupStepSectPageBreaksForSupInfo() + { + _LookupStepSectPageBreaksForSupInfo.Clear(); + } public List StepSectPageBreaksForSupInfo { get { - if (_StepSectPageBreaksForSupInfo == null) _StepSectPageBreaksForSupInfo = new List(); - return _StepSectPageBreaksForSupInfo; + if (!_LookupStepSectPageBreaksForSupInfo.ContainsKey(ItemID)) _LookupStepSectPageBreaksForSupInfo.Add(ItemID, new List()); + return _LookupStepSectPageBreaksForSupInfo[ItemID]; } - set { _StepSectPageBreaksForSupInfo = value; } } // Keeps track of step section itemids where page breaks occur - private List _StepSectPageBreaks = null; + private static Dictionary> _LookupStepSectPageBreaks = new Dictionary>(); + public static void ResetLookupStepSectPageBreaks() + { + _LookupStepSectPageBreaks.Clear(); + } public List StepSectPageBreaks { get { - if (_StepSectPageBreaks == null) _StepSectPageBreaks = new List(); - return _StepSectPageBreaks; + if (!_LookupStepSectPageBreaks.ContainsKey(ItemID)) _LookupStepSectPageBreaks.Add(ItemID, new List()); + return _LookupStepSectPageBreaks[ItemID]; } - set { _StepSectPageBreaks = value; } } // Determine if this section contains any Supplemental information steps. This is used for print to determine // whether some of the supinfo processing needs to occur. diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index d4e5c861..db2884fc 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -296,6 +296,8 @@ namespace Volian.Print.Library // the list StepSectPageBreaksForSupInfo off of the section object // Second pass prints the supplemental information pdfs using the list generated in the first pass to know where to do the // supplemental information page breaks & then merges in those pages when printing the step sections. + SectionInfo.ResetLookupStepSectPageBreaks(); // B2017-192: Reset lists for tracking page breaks + SectionInfo.ResetLookupStepSectPageBreaksForSupInfo(); SupInfoPrintType = E_SupInfoPrintType.DoPageBreaks; string retstr = Print(_MyItem as ProcedureInfo, pdfFolder, false, false); if (retstr == null) return null; diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 09671bb1..f89f2481 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -2265,6 +2265,7 @@ namespace Volian.Print.Library // see if any substeps of this item have supinfo, and if so, return the substep's id int id = GetSubThatHasSupInfoItems(ii, startid); + if (id == -2) return -1; if (id != -1) return id; // Now go to the next item, check if it or any of its substeps have supinfo, and if so, return the id @@ -2277,6 +2278,7 @@ namespace Volian.Print.Library { if (ii.MyParent.SupInfos != null && ii.MyParent.SupInfos.Count > 0) return ii.MyParent.SupInfos[0].ItemID; int sbfromNC = GetSubThatHasSupInfoItems(ii.MyParent, startid); + if (sbfromNC == -2) return -1; if (sbfromNC != -1) return sbfromNC; } @@ -2330,6 +2332,7 @@ namespace Volian.Print.Library return ii.SupInfos[0].ItemID; } id = GetSubThatHasSupInfoItems(ii, startid); + if (id == -2) return -1; if (id != -1) return id; ii = ii.NextItem; } @@ -2339,6 +2342,8 @@ namespace Volian.Print.Library { if (ii.MyContent.ContentParts != null) { + SectionInfo supInfoSect = ii.ActiveSection as SectionInfo; + if (supInfoSect == null) supInfoSect = SectionInfo.Get(ii.ActiveSection.ItemID); foreach (PartInfo pi in ii.MyContent.ContentParts) { if ((E_FromType)pi.FromType != E_FromType.SupInfo) @@ -2346,7 +2351,9 @@ namespace Volian.Print.Library foreach (ItemInfo iic in pi.MyItems) { if (iic.SupInfos != null && iic.SupInfos.Count > 0) return iic.SupInfos[0].ItemID; + if (supInfoSect.StepSectPageBreaks.Contains(iic.ItemID)) return -2; // B2017-192: -2 flags that a page break within substep was found, return int id = GetSubThatHasSupInfoItems(iic, startid); + if (id == -2) return -1; if (id != -1) return id; } }