B2018-058 Proms was putting V.C. Summer’s End Message on a page that didn’t have room for it. PROMS pagination logic will now properly calculate the space for the end message when considering page breaks

This commit is contained in:
John Jenko 2018-04-04 19:14:18 +00:00
parent 079f03284d
commit ff0da96bad

View File

@ -146,7 +146,8 @@ namespace Volian.Print.Library
// The 3 was changed to 2 for the end line & the line below. The blank line below the step gives the blank
// line above the end message, thus 2 not 3. This change was made on July 20, 2011 by RHM & KBR. The
// procedure in questions was VEWCNEMG\EMGAPP.PRC, ES-01, Step 8.
float yEndMsg = !_skipEndMessage && !MyItemInfo.IsSection && MyItemInfo.MyHLS != null && MyItemInfo.MyHLS.NextItem == null && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? 2 * SixLinesPerInch : 0;
//float yEndMsg = !_skipEndMessage && !MyItemInfo.IsSection && MyItemInfo.MyHLS != null && MyItemInfo.MyHLS.NextItem == null && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? 2 * SixLinesPerInch : 0;
float yEndMsg = (!_skipEndMessage && !MyItemInfo.IsSection && MyItemInfo.MyHLS != null && MyItemInfo.MyHLS.NextItem == null)? GetEndMessageHeight(MyItemInfo.MyDocStyle) : 0; // B2018-068 account for mult-line End Messages
// also consider if there is a phone list at the bottom of the page, add the amount of space the phone
// list requires onto yEndMsg to make it easier to figure out pagination (include an extra line for the
@ -272,7 +273,8 @@ namespace Volian.Print.Library
if (KeepStepsOnPage && firstSubstepExceedsSpaceAvailable && !isFirstChild)
KeepStepsOnPage = false;
if (ySizeIncludingFirst == YSize) KeepStepsOnPage = false;
float ySectionEndMsg = !_skipEndMessage && MyItemInfo.IsSection && MyItemInfo.Steps != null && MyItemInfo.Steps.Count == 1 && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? 2 * SixLinesPerInch : 0;
//float ySectionEndMsg = !_skipEndMessage && MyItemInfo.IsSection && MyItemInfo.Steps != null && MyItemInfo.Steps.Count == 1 && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? 2 * SixLinesPerInch : 0;
float ySectionEndMsg = (!_skipEndMessage && MyItemInfo.IsSection && MyItemInfo.Steps != null && MyItemInfo.Steps.Count == 1) ? GetEndMessageHeight(MyItemInfo.MyDocStyle) : 0; // B2018-068 account for mult-line End Messages
if (MyPageHelper.NotesToFootNotes != null && MyPageHelper.NotesToFootNotes.Count > 0)
{
float vpHeight = SixLinesPerInch;
@ -640,6 +642,18 @@ namespace Volian.Print.Library
//return 2;
throw new Exception("PageBreak Logic Missing, vlnParagraph.cs");
}
// B2018-058 the the end message height accounting for multi-line end messages
private float GetEndMessageHeight(DocStyle docstyle)
{
float EndMsgHeight = 0;
string endmsg = MyItemInfo.MyDocStyle.End.Message ?? "";
if (endmsg != "")
{
string[] splitOn = { "\\par" }; // B2018-058 account for RTF newlines ( used for V.C. Summer End messages)
EndMsgHeight = (endmsg.Split(splitOn,StringSplitOptions.RemoveEmptyEntries).Length + 1) * SixLinesPerInch;
}
return EndMsgHeight;
}
private float GetBottomEndMessageSize(DocStyle docstyle)
{
float myBottomMsgSpace = 0;