Support the impact of the Section Continue Message on Pagination
Added logic to determine if the Section Continue Message would be printed.
This commit is contained in:
parent
72fada8fdb
commit
6098140d26
@ -171,6 +171,13 @@ namespace Volian.Print.Library
|
||||
return 0; // Don't Paginate (page break) on a Step Section if it's first thing on page
|
||||
}
|
||||
if (!MyItemInfo.IsHigh) return 0; // Don't Paginate on a Substep level
|
||||
bool doSectionTitleContinued = false;
|
||||
if (MyItemInfo.InList(1148, 391)) Console.Write("Here");
|
||||
if (MyItemInfo.MyPrevious != null && !MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader)
|
||||
{
|
||||
SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig;
|
||||
doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle;
|
||||
}
|
||||
// Document style: DSS_PageBreakHLS breaks on hls.
|
||||
if (MyItemInfo.IsHigh && (MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageBreakHLS) == E_DocStructStyle.DSS_PageBreakHLS)
|
||||
{
|
||||
@ -267,7 +274,14 @@ namespace Volian.Print.Library
|
||||
|
||||
// Keep figure (the only figure, i.e. count==1) with its parent.
|
||||
if (ChildrenBelow.Count == 1 && ChildrenBelow[0].MyItemInfo.IsFigure) KeepStepsOnPage = false;
|
||||
|
||||
float sectionSpace = 0;
|
||||
if (doSectionTitleContinued)
|
||||
{
|
||||
sectionSpace = 2 * SixLinesPerInch;// this should actuall use the physical size of the continue messsage.
|
||||
yPageSizeNextPage -= sectionSpace;
|
||||
yExtra -= sectionSpace;
|
||||
yExtra2 -= sectionSpace;
|
||||
}
|
||||
if (!KeepWithHeader && !KeepStepsOnPage && YSize - SixLinesPerInch + yEndMsg <= yPageSizeNextPage) // if the entire step can fit on one page, do a page break
|
||||
{
|
||||
// Don't want extra line before step
|
||||
@ -450,6 +464,8 @@ namespace Volian.Print.Library
|
||||
// if this paragraph is flagged to pagebreakonstep (i.e. these are used by background documents
|
||||
// to get each hls/caution/note to be on its own page), then any of the children above should
|
||||
// also have the flag set and be added to the pagebreakonsteplist so that a break occurs.
|
||||
if (MyItemInfo.InList(391))
|
||||
Console.WriteLine("here");
|
||||
List<vlnParagraph> PageBreakOnStepList = new List<vlnParagraph>();
|
||||
if (PageBreakOnStep)
|
||||
{
|
||||
|
@ -1076,7 +1076,7 @@ namespace Volian.Print.Library
|
||||
if (!MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader)
|
||||
{
|
||||
SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig;
|
||||
doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y");
|
||||
doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle;
|
||||
}
|
||||
MyPageHelper.YMultiplier = 1;
|
||||
break;
|
||||
@ -1179,13 +1179,13 @@ namespace Volian.Print.Library
|
||||
else
|
||||
{
|
||||
SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig;
|
||||
doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y");
|
||||
doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig;
|
||||
doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y");
|
||||
doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle;
|
||||
}
|
||||
}
|
||||
if (!doSectionTitleContinued)
|
||||
@ -1258,7 +1258,7 @@ namespace Volian.Print.Library
|
||||
if (!MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader)
|
||||
{
|
||||
SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig;
|
||||
doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y");
|
||||
doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle;
|
||||
}
|
||||
}
|
||||
// if printing the section title, we already have the y location (note that only do this for the
|
||||
@ -1321,14 +1321,18 @@ namespace Volian.Print.Library
|
||||
}
|
||||
float mytmpfloat = sectContPara.ParagraphToPdf(cb, yTopMargin, yTopMargin, yBottomMargin);
|
||||
if (sectContPara.SectionContinuePrinted)
|
||||
yPageStart -= sectContPara.Height * 2;
|
||||
yPageStart -= sectContPara.Height + SixLinesPerInch;
|
||||
else
|
||||
Console.WriteLine("'No Header 1','{0}',{1},{2}",MyItemInfo.ShortPath,MyItemInfo.MyDocStyle.CancelSectTitle,MyItemInfo.MyDocStyle.SpecialStepsFoldout);
|
||||
}
|
||||
else
|
||||
{
|
||||
sectContPara = new vlnParagraph(MyParent.MyParent, cb, MyItemInfo.ActiveSection, MyParent.XOffset, 0, 0, 0, MyParent.MyItemInfo.ActiveFormat, null, (contMsg == null || contMsg == "") ? " (Continued)" : contMsg, 0, false);
|
||||
float mytmpfloat = sectContPara.ParagraphToPdf(cb, yTopMargin, yTopMargin, yBottomMargin);
|
||||
if (sectContPara.SectionContinuePrinted)
|
||||
yPageStart -= sectContPara.Height * 2;
|
||||
yPageStart -= sectContPara.Height + SixLinesPerInch;
|
||||
else
|
||||
Console.WriteLine("'No Header 1','{0}',{1},{2}", MyItemInfo.ShortPath, MyItemInfo.MyDocStyle.CancelSectTitle, MyItemInfo.MyDocStyle.SpecialStepsFoldout);
|
||||
}
|
||||
}
|
||||
yPageStart = ChildrenAbove.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin);
|
||||
|
Loading…
x
Reference in New Issue
Block a user