This commit is contained in:
Kathy Ruffing 2013-02-01 15:01:02 +00:00
parent f399ad350a
commit 9023e7c899

View File

@ -194,7 +194,7 @@ namespace Volian.Print.Library
if (MyPageHelper.MyTOCPageCounts.ContainsKey(tocKey)) if (MyPageHelper.MyTOCPageCounts.ContainsKey(tocKey))
{ {
PageCount pc = MyPageHelper.MyTOCPageCounts[tocKey]; PageCount pc = MyPageHelper.MyTOCPageCounts[tocKey];
pc.Total = MyPageHelper.CurrentPageNumber; pc.Total = MyPageHelper.CurrentTOCPageNumber + 1;
pc.DrawTemplates(); pc.DrawTemplates();
} }
} }
@ -1091,13 +1091,15 @@ namespace Volian.Print.Library
else else
if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.StepPrintData != null) XOffset += (float)(itemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0); if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.StepPrintData != null) XOffset += (float)(itemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0);
bool printMetaHdr = false; if (itemInfo.IsSection && formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles
if (itemInfo.Steps != null && itemInfo.IsSection && itemInfo.Sections != null && itemInfo.Sections.Count > 0) && !MyItemInfo.MyDocStyle.CancelSectTitle)
{ {
SectionConfig sc = itemInfo.MyConfig as SectionConfig; if (MyItemInfo.MyDocStyle.Layout.SectionMacro != null)
if ((sc != null && sc.Section_PrintHdr == "Y") && itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections) printMetaHdr = true; {
string macro = GetMacroName(MyItemInfo.MyDocStyle.Layout.SectionMacro);
PartsAbove.Add(new vlnMacro(xoff, yoff, macro));
}
} }
// If WCN checklists, the substeps are printed in a row, need to keep track of the 'longest' in // If WCN checklists, the substeps are printed in a row, need to keep track of the 'longest' in
// y direction (bottommost) across the row. // y direction (bottommost) across the row.
if (itemInfo.IsStep && itemInfo.MyHLS.FormatStepData.UseSmartTemplate && (TheStepLevel(itemInfo) > 0)) if (itemInfo.IsStep && itemInfo.MyHLS.FormatStepData.UseSmartTemplate && (TheStepLevel(itemInfo) > 0))
@ -1106,22 +1108,29 @@ namespace Volian.Print.Library
savCheckListBottomMost = yoff + Height + SixLinesPerInch; savCheckListBottomMost = yoff + Height + SixLinesPerInch;
} }
// Get Y offset for regular steps, or if section title is output or if not within row (not last column of // Get Y offset for regular steps, or if section title is output or if not within row (not last column of
// text) for wcn checklist, i.e. . // text) for wcn checklist, i.e.
if ((!itemInfo.IsStepSection && !itemInfo.MyHLS.FormatStepData.UseSmartTemplate) if ((!itemInfo.IsStepSection && !itemInfo.MyHLS.FormatStepData.UseSmartTemplate) // regular step
|| printMetaHdr || || (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles
(formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles
&& !MyItemInfo.MyDocStyle.CancelSectTitle && !MyItemInfo.MyDocStyle.CancelSectTitle
&& !MyItemInfo.MyDocStyle.SpecialStepsFoldout) && !MyItemInfo.MyDocStyle.SpecialStepsFoldout)
// In WCN Checklist: I don't have children or if I have children the first child doesn't alignwithparent. // In WCN Checklist: I don't have children or if I have children the first child doesn't alignwithparent.
|| (!itemInfo.IsStepSection && itemInfo.MyHLS.FormatStepData.UseSmartTemplate || (!itemInfo.IsStepSection && itemInfo.MyHLS.FormatStepData.UseSmartTemplate
&& ((itemInfo.Steps == null || itemInfo.Steps.Count == 0) && ((itemInfo.Steps == null || itemInfo.Steps.Count == 0)
|| !itemInfo.Steps[0].FormatStepData.StepLayoutData.AlignWithParentTab))) || !itemInfo.Steps[0].FormatStepData.StepLayoutData.AlignWithParentTab)))
{
bool doprint = true;
if (MyItemInfo.IsSection) // if on a section, be sure that section title should print.
{
SectionConfig sch = MyItemInfo.MyConfig as SectionConfig;
if (sch != null && sch.Section_PrintHdr != "Y") doprint = false;
}
if (doprint)
{ {
yoff += Height; yoff += Height;
yoff += AdjustForBlankLines(); yoff += AdjustForBlankLines();
if (dropCheckoff) if (dropCheckoff)
yForCheckoff += Height - SixLinesPerInch; // place checkoff on last row of text yForCheckoff += Height - SixLinesPerInch; // place checkoff on last row of text
}
} }
} }
@ -1209,6 +1218,13 @@ namespace Volian.Print.Library
if (savCheckListBottomMost != 0 && savCheckListBottomMost > YBottomMost) YBottomMost = savCheckListBottomMost; if (savCheckListBottomMost != 0 && savCheckListBottomMost > YBottomMost) YBottomMost = savCheckListBottomMost;
} }
private string GetMacroName(string str)
{
int mindx = str.IndexOf(@"{!");
string macro = str.Substring(mindx + 2, str.Length - 3);
return macro;
}
private int TheStepLevel(ItemInfo itemInfo) private int TheStepLevel(ItemInfo itemInfo)
{ {
if (itemInfo.IsHigh) return -1; if (itemInfo.IsHigh) return -1;