diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index 5497e05e..8e4b02a4 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -208,7 +208,7 @@ namespace Volian.Print.Library // Document style: DSS_PageBreakHLS breaks on hls. if (MyItemInfo.IsHigh && (MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageBreakHLS) == E_DocStructStyle.DSS_PageBreakHLS) { - BuildPageBreakList(yPageSize, yPageSize, KeepStepsOnPage, yEndMsg); + BuildPageBreakList(yPageSize, yPageSize, KeepStepsOnPage, yEndMsg, doSectionTitleContinued & SectionShowTitles); ShowPageBreak(1, "Page Break on DSS_PageBreakHLS", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); return 1; } @@ -218,7 +218,7 @@ namespace Volian.Print.Library // if this step contains Cautions or Notes page breaks have to be added for those. if (TopMostChild != this) PageBreakOnStep = true; - BuildPageBreakList(yPageSize, yPageSize, KeepStepsOnPage, yEndMsg); // Case 1 :Works for ES05 Step 15 SubStep 7 + BuildPageBreakList(yPageSize, yPageSize, KeepStepsOnPage, yEndMsg, doSectionTitleContinued & SectionShowTitles); // Case 1 :Works for ES05 Step 15 SubStep 7 ShowPageBreak(1, "Page Break on Steps, Cautions or Notes", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); return 1; } @@ -308,7 +308,13 @@ namespace Volian.Print.Library { if (SectionShowTitles) { - sectionSpace = 3 * SixLinesPerInch;// this should actuall use the physical size of the continue messsage. + vlnParagraph paraSect = MyParent; + while (!paraSect.MyItemInfo.IsSection) paraSect = paraSect.MyParent; + if (paraSect.ContinueHeight > 24) + sectionSpace = paraSect.ContinueHeight; + else + sectionSpace = 2 * SixLinesPerInch; + // sectionSpace = 3 * SixLinesPerInch;// this should actuall use the physical size of the continue messsage. // Fixing this caused problems with pagination ex Calvert Unit 2 IO-1l section 6.1.B step 2 //if (MyItemInfo.ActiveSection.DisplayText.Length < 40) sectionSpace = SixLinesPerInch; yPageSizeNextPage -= sectionSpace; @@ -381,7 +387,7 @@ namespace Volian.Print.Library else ShowPageBreak(6, "HLS will have to split on current page", "Special", YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak); //BuildPageBreakList(yWithinMargins + SixLinesPerInch, yPageSizeNextPage + yExtra2, KeepStepsOnPage); // Case 5 - Determine items where page break(s) occur - BuildPageBreakList(ySpaceOnFirstPage, yPageSize + yExtra2, KeepStepsOnPage, yEndMsg); // Case 5 - Determine items where page break(s) occur + BuildPageBreakList(ySpaceOnFirstPage, yPageSize + yExtra2, KeepStepsOnPage, yEndMsg, doSectionTitleContinued & SectionShowTitles); // Case 5 - Determine items where page break(s) occur return 0; // Stay on this page } @@ -397,7 +403,7 @@ namespace Volian.Print.Library // Pagination Fix Break1LineShort2 //BuildPageBreakList(yPageSize + yExtra, yPageSize); // Case 1 :Works for ES05 Step 15 SubStep 7 // Pagination Fix Break1LineShort4 - BuildPageBreakList(yPageSize + yExtra, yPageSizeNextPage + yExtra2, KeepStepsOnPage, yEndMsg); // Case 1 :Works for ES05 Step 15 SubStep 7 + BuildPageBreakList(yPageSize + yExtra, yPageSizeNextPage + yExtra2, KeepStepsOnPage, yEndMsg, doSectionTitleContinued & SectionShowTitles); // Case 1 :Works for ES05 Step 15 SubStep 7 return 1; // Paginate on High Level Steps } //if (yWithinMargins > yPageSize / 2) @@ -516,9 +522,10 @@ namespace Volian.Print.Library return pg; return pg.MyParent.ChildrenBelow[0]; } - private void BuildPageBreakList(float ySpaceOnCurPage, float yPageSize, bool KeepStepsOnPage, float yEndMsg) + private void BuildPageBreakList(float ySpaceOnCurPage, float yPageSize, bool KeepStepsOnPage, float yEndMsg, bool doSectionTitleContinued) { float topContinueHeight=2 * SixLinesPerInch; + //if(MyItemInfo.InList(54573)) Console.WriteLine("Here"); int profileDepth = ProfileTimer.Push(">>>> BuildPageBreakList"); // 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 @@ -589,7 +596,7 @@ namespace Volian.Print.Library string myTopMsg = docstyle.Continue.Top.Message; float myTopMsgSpace = ((myTopMsg ?? "") != "") ? 2 * SixLinesPerInch : 0; - if (myTopMsgSpace > 0) + if (myTopMsgSpace > 0 && doSectionTitleContinued) { vlnParagraph parSection = this.MyParent; while (!parSection.MyItemInfo.IsSection) parSection = parSection.MyParent; @@ -646,6 +653,11 @@ namespace Volian.Print.Library , MyItemInfo.ItemID, MyItemInfo.MyDocVersion.MyFolder.Name, MyItemInfo.ShortPath); break; } + //if (paraBreak.MyItemInfo.InList(54615, 54620) || MyItemInfo.InList(54573)) + //{ + // Console.WriteLine("{0}\t{1}", MyItemInfo.ItemID, paraBreak); + // Console.WriteLine("Here"); + //} if (paraBreak.MyItemInfo.IsStep && ((paraBreak.MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd) && paraBreak.MyItemInfo.FormatStepData != null && paraBreak.MyItemInfo.MyParent.MyPrevious != null && paraBreak.MyItemInfo.MyParent.IsStep && paraBreak.MyItemInfo.MyParent.MyPrevious.FormatStepData.Type == "TitleWithTextBelow") {