B2017-203: missing End message if continuous subsections & 2 sections’ end message on same page

This commit is contained in:
Kathy Ruffing 2017-09-12 13:02:48 +00:00
parent 8fd0230aa0
commit c87ec88245
4 changed files with 24 additions and 17 deletions

View File

@ -204,7 +204,7 @@ namespace Volian.Print.Library
{ {
// see if there is an end message. This is stored in the helper - if there is, // see if there is an end message. This is stored in the helper - if there is,
// we need to be sure that there is room for it. // we need to be sure that there is room for it.
if (MyPageHelper.BottomMessage != null) if (MyPageHelper.BottomMessage != null && MyPageHelper.BottomMessage.Count != 0)
{ {
if (mySize + yEndMsg <= yWithinMargins) return 1; if (mySize + yEndMsg <= yWithinMargins) return 1;
} }

View File

@ -1736,7 +1736,7 @@ namespace Volian.Print.Library
{ {
if (nxtItem != null && nxtItem.MyPrevious != null && nxtItem.ActiveFormat.PlantFormat.FormatData.SectData.SectionHeader.Level0Big) if (nxtItem != null && nxtItem.MyPrevious != null && nxtItem.ActiveFormat.PlantFormat.FormatData.SectData.SectionHeader.Level0Big)
localYPageStart -= 12; localYPageStart -= 12;
if (_MyHelper.BottomMessage != null) if (_MyHelper.BottomMessage != null && _MyHelper.BottomMessage.Count != 0)
{ {
_MyHelper.DrawBottomMessage(cb); _MyHelper.DrawBottomMessage(cb);
localYPageStart += 12; localYPageStart += 12;

View File

@ -85,8 +85,8 @@ namespace Volian.Print.Library
get { return _TopMessageSub2s; } get { return _TopMessageSub2s; }
set { _TopMessageSub2s = value; } set { _TopMessageSub2s = value; }
} }
private vlnText _BottomMessage; private List<vlnText> _BottomMessage = new List<vlnText>(); // B2017-203) any continuous sections with end messages may have more than 1 message on a page
public vlnText BottomMessage public List<vlnText> BottomMessage
{ {
get { return _BottomMessage; } get { return _BottomMessage; }
set { _BottomMessage = value; } set { _BottomMessage = value; }
@ -749,10 +749,13 @@ namespace Volian.Print.Library
} }
TopMessageSub2s = null; // Only output it once. TopMessageSub2s = null; // Only output it once.
} }
if (BottomMessage != null) if (BottomMessage != null && BottomMessage.Count != 0)
{ {
BottomMessage.ToPdf(cb, 0, ref tmp, ref tmp); foreach (vlnText vts3 in BottomMessage)
BottomMessage = null; // Only output it once. {
vts3.ToPdf(cb, 0, ref tmp, ref tmp);
}
BottomMessage.Clear(); // Only output it once.
} }
if (BottomMessageR != null) if (BottomMessageR != null)
{ {
@ -768,10 +771,13 @@ namespace Volian.Print.Library
public void DrawBottomMessage(PdfContentByte cb) public void DrawBottomMessage(PdfContentByte cb)
{ {
float tmp = 0; float tmp = 0;
if (BottomMessage != null) if (BottomMessage != null && BottomMessage.Count != 0)
{ {
BottomMessage.ToPdf(cb, 0, ref tmp, ref tmp); foreach (vlnText vts in BottomMessage)
BottomMessage = null; // Only output it once. {
vts.ToPdf(cb, 0, ref tmp, ref tmp);
}
BottomMessage.Clear(); // Only output it once.
} }
} }
private void DrawChangeBars(PdfContentByte cb) private void DrawChangeBars(PdfContentByte cb)

View File

@ -2119,7 +2119,7 @@ namespace Volian.Print.Library
{ {
ShowPageBreak(1, CheckForCompression("PageBreakOnStep/Caution/Note HLS"), "Yes", YTop - YBottomMost, yTopMargin - yBottomMargin, yTopMargin - yBottomMargin, false); ShowPageBreak(1, CheckForCompression("PageBreakOnStep/Caution/Note HLS"), "Yes", YTop - YBottomMost, yTopMargin - yBottomMargin, yTopMargin - yBottomMargin, false);
YTopMost=OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); YTopMost=OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin);
MyPageHelper.BottomMessage = null; MyPageHelper.BottomMessage.Clear();
MyPageHelper.TopMessage = null; MyPageHelper.TopMessage = null;
MyPromsPrinter.NewPage(); MyPromsPrinter.NewPage();
if (CompressPartOfStep) if (CompressPartOfStep)
@ -2213,16 +2213,17 @@ namespace Volian.Print.Library
if ((docstyle.End.Margin ?? 0) != 0) if ((docstyle.End.Margin ?? 0) != 0)
{ {
xpos = (float)docstyle.Layout.LeftMargin + (float)docstyle.End.Margin; xpos = (float)docstyle.Layout.LeftMargin + (float)docstyle.End.Margin;
MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, xpos, msg_yLocation, docstyle.End.Font); MyPageHelper.BottomMessage.Add(new vlnText(cb, this, myMsg, myMsg, xpos, msg_yLocation, docstyle.End.Font));
} }
else else
{ // Center the bottom message { // Center the bottom message
float wtpm = (float)docstyle.Layout.PageWidth - (float)docstyle.Layout.LeftMargin; float wtpm = (float)docstyle.Layout.PageWidth - (float)docstyle.Layout.LeftMargin;
xpos = XOffsetBox + (float)docstyle.Layout.LeftMargin + (wtpm - (myMsg.Length * MyItemInfo.FormatStepData.Font.CharsToTwips)) / 2; xpos = XOffsetBox + (float)docstyle.Layout.LeftMargin + (wtpm - (myMsg.Length * MyItemInfo.FormatStepData.Font.CharsToTwips)) / 2;
xpos = Math.Max(xpos, XOffsetBox + (float)docstyle.Layout.LeftMargin); xpos = Math.Max(xpos, XOffsetBox + (float)docstyle.Layout.LeftMargin);
MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, xpos, msg_yLocation, docstyle.End.Font); vlnText vttmp = new vlnText(cb, this, myMsg, myMsg, xpos, msg_yLocation, docstyle.End.Font);
MyPageHelper.MyGaps.Add(new Gap(msg_yLocation, msg_yLocation - MyPageHelper.BottomMessage.Height)); MyPageHelper.BottomMessage.Add(vttmp);
yPageStart -= (MyPageHelper.BottomMessage.Height + adjMsgY); MyPageHelper.MyGaps.Add(new Gap(msg_yLocation, msg_yLocation - vttmp.Height));
yPageStart -= (vttmp.Height + adjMsgY);
} }
} }
} }
@ -2858,10 +2859,10 @@ namespace Volian.Print.Library
else else
xoffB = docstyle.Layout.LeftMargin + docstyle.Continue.Bottom.Margin ?? 0; xoffB = docstyle.Layout.LeftMargin + docstyle.Continue.Bottom.Margin ?? 0;
//MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, docstyle.Layout.LeftMargin + XOffsetBox + docstyle.Continue.Bottom.Margin ?? 0, msg_yLocation, docstyle.Continue.Bottom.Font);// MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font); //MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, docstyle.Layout.LeftMargin + XOffsetBox + docstyle.Continue.Bottom.Margin ?? 0, msg_yLocation, docstyle.Continue.Bottom.Font);// MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font);
MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, xoffB, msg_yLocation, docstyle.Continue.Bottom.Font); MyPageHelper.BottomMessage.Add(new vlnText(cb, this, myMsg, myMsg, xoffB, msg_yLocation, docstyle.Continue.Bottom.Font));
} }
} }
if (PageBreakOnStep) MyPageHelper.BottomMessage = null; if (PageBreakOnStep) MyPageHelper.BottomMessage.Clear();
} }
private void RefreshDocStyle() private void RefreshDocStyle()