From 3daa13f4b664caf4ebf1081a134ebca73c2078a4 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 4 Nov 2014 21:14:16 +0000 Subject: [PATCH] Fixed background document pagination adjusted sub-step text width when they have a tab (background documents) --- PROMS/Volian.Print.Library/Pagination.cs | 13 +++++++------ PROMS/Volian.Print.Library/vlnParagraph.cs | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index 37d3b732..0c2fbf84 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -469,8 +469,6 @@ 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 PageBreakOnStepList = new List(); if (PageBreakOnStep) { @@ -567,9 +565,12 @@ namespace Volian.Print.Library ySpaceOnCurPage -= yEndMsg; ySpaceOnCurPage -= myBottomMsgSpace; vlnParagraph lastBreak = paraBreak; - paraBreak = FindPageBreak(yStart, ySpaceOnCurPage-accountForCalvertAlarmConditionResponseFooter, yLowerLimit, - myList, lastBreak, yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace, - myBottomMsgSpace,MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[40].ContinueOnly); + if (PageBreakOnStepList.Count > 0 && (PageBreakOnStepList[0].YTop - (lastBreak == null?0:lastBreak.YTop) <= ySpaceOnCurPage)) + paraBreak = PageBreakOnStepList[0]; + else + paraBreak = FindPageBreak(yStart, ySpaceOnCurPage-accountForCalvertAlarmConditionResponseFooter, yLowerLimit, + myList, lastBreak, yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace, + myBottomMsgSpace,MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[40].ContinueOnly); //Console.WriteLine("Break at {0}", paraBreak.MyItemInfo.ShortPath);//Comment Out before release //if (lastBreak != null && lastBreak.MyItemInfo.InList(80091, 1985)) // Console.WriteLine("After 80091 {0}",paraBreak.ToString()); @@ -582,7 +583,7 @@ namespace Volian.Print.Library break; } 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.MyPrevious.FormatStepData.Type == "TitleWithTextBelow") + paraBreak.MyItemInfo.FormatStepData != null && paraBreak.MyItemInfo.MyParent.MyPrevious != null && paraBreak.MyItemInfo.MyParent.IsStep && paraBreak.MyItemInfo.MyParent.MyPrevious.FormatStepData.Type == "TitleWithTextBelow") { if (lastBreak != null && lastBreak != paraBreak.MyParent) paraBreak = paraBreak.MyParent; } diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 9d8a9786..3c6ea8d8 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -4371,7 +4371,7 @@ namespace Volian.Print.Library else if (MyParent.WidthNoLimit != 0) Width = adjwidth + MyParent.WidthNoLimit - tabWidth + (myTab == null ? 0 : myTab.TabAlign); else if ((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd) - Width = adjwidth + MyParent.Width; + Width = adjwidth + MyParent.Width - (MyTab!=null?MyTab.Width:0); else Width = adjwidth + MyParent.Width - tabWidth + (myTab == null ? 0 : myTab.TabAlign); }