B2017-192: SAMG Supplemental facing page, incorrect steps on facing pages depending on page breaks of steps.
This commit is contained in:
parent
34ea55a624
commit
a74b016fc5
@ -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<int> _StepSectPageBreaksForSupInfo = null;
|
||||
private static Dictionary<int, List<int>> _LookupStepSectPageBreaksForSupInfo = new Dictionary<int, List<int>>();
|
||||
public static void ResetLookupStepSectPageBreaksForSupInfo()
|
||||
{
|
||||
_LookupStepSectPageBreaksForSupInfo.Clear();
|
||||
}
|
||||
public List<int> StepSectPageBreaksForSupInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_StepSectPageBreaksForSupInfo == null) _StepSectPageBreaksForSupInfo = new List<int>();
|
||||
return _StepSectPageBreaksForSupInfo;
|
||||
if (!_LookupStepSectPageBreaksForSupInfo.ContainsKey(ItemID)) _LookupStepSectPageBreaksForSupInfo.Add(ItemID, new List<int>());
|
||||
return _LookupStepSectPageBreaksForSupInfo[ItemID];
|
||||
}
|
||||
set { _StepSectPageBreaksForSupInfo = value; }
|
||||
}
|
||||
// Keeps track of step section itemids where page breaks occur
|
||||
private List<int> _StepSectPageBreaks = null;
|
||||
private static Dictionary<int, List<int>> _LookupStepSectPageBreaks = new Dictionary<int, List<int>>();
|
||||
public static void ResetLookupStepSectPageBreaks()
|
||||
{
|
||||
_LookupStepSectPageBreaks.Clear();
|
||||
}
|
||||
public List<int> StepSectPageBreaks
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_StepSectPageBreaks == null) _StepSectPageBreaks = new List<int>();
|
||||
return _StepSectPageBreaks;
|
||||
if (!_LookupStepSectPageBreaks.ContainsKey(ItemID)) _LookupStepSectPageBreaks.Add(ItemID, new List<int>());
|
||||
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.
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user