Replaced use of “NextItem” with “GetNextItem()” which takes into account the applicability of the next item

This commit is contained in:
John Jenko 2014-05-14 15:04:33 +00:00
parent 600dcc0121
commit a95f7bb59a
3 changed files with 9 additions and 9 deletions

View File

@ -54,7 +54,7 @@ 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 // 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 // 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. // 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.GetNextItem() == null && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? 2 * SixLinesPerInch : 0;
// also consider if there is a phone list at the bottom of the page, add the amount of space the phone // 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. // list requires onto yEndMsg to make it easier to figure out pagination.

View File

@ -109,7 +109,7 @@ namespace Volian.Print.Library
{ {
if ((childItemInfo.IsCaution || childItemInfo.IsNote) && if ((childItemInfo.IsCaution || childItemInfo.IsNote) &&
childItemInfo.MyPrevious != null && childItemInfo.MyPrevious.MyContent.Type != childItemInfo.MyContent.Type && childItemInfo.MyPrevious != null && childItemInfo.MyPrevious.MyContent.Type != childItemInfo.MyContent.Type &&
childItemInfo.NextItemCount > 0 && childItemInfo.MyContent.Type == childItemInfo.NextItem.MyContent.Type) childItemInfo.NextItemCount > 0 && childItemInfo.MyContent.Type == childItemInfo.GetNextItem().MyContent.Type)
childItemInfo.SetupTags(); // added for V.C. Summer Transition caution in EOP-15.0 step 5.4 childItemInfo.SetupTags(); // added for V.C. Summer Transition caution in EOP-15.0 step 5.4
if (lastHeader != null) if (lastHeader != null)
{ {
@ -588,8 +588,8 @@ namespace Volian.Print.Library
{ {
// This section of code draws the lines around the substeps (the actual table part) // This section of code draws the lines around the substeps (the actual table part)
Paragraph horzLine = new Paragraph(ii.ActiveFormat.PlantFormat.FormatData.BoxList[0].BXHorz, iSymblFont); Paragraph horzLine = new Paragraph(ii.ActiveFormat.PlantFormat.FormatData.BoxList[0].BXHorz, iSymblFont);
bool bottomOfTable = (ii.NextItem == null || ii.NextItemCount == 0) || bool bottomOfTable = (ii.GetNextItem() == null || ii.NextItemCount == 0) ||
(MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].MyItemInfo.ItemID == ii.NextItem.ItemID); (MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].MyItemInfo.ItemID == ii.GetNextItem().ItemID);
// if bottom of table use different cross/beg/end chars than if in middle of table. // if bottom of table use different cross/beg/end chars than if in middle of table.
Paragraph leftLine = new Paragraph(bottomOfTable ? bx.BXLLC : bx.BXMLS, iSymblFont); Paragraph leftLine = new Paragraph(bottomOfTable ? bx.BXLLC : bx.BXMLS, iSymblFont);
Paragraph rightLine = new Paragraph(bottomOfTable ? bx.BXLRC : bx.BXMRS, iSymblFont); Paragraph rightLine = new Paragraph(bottomOfTable ? bx.BXLRC : bx.BXMRS, iSymblFont);
@ -634,7 +634,7 @@ namespace Volian.Print.Library
// Now handle middle parts of the table. For whatever sub level we're at, draw the cross character // Now handle middle parts of the table. For whatever sub level we're at, draw the cross character
// and the horizontal. This is case where the component number may have multiple descriptions,positions, etc. associated // and the horizontal. This is case where the component number may have multiple descriptions,positions, etc. associated
// with it. // with it.
if (!ii.MyParent.IsHigh && ii.NextItem != null && ii.NextItemCount > 0) if (!ii.MyParent.IsHigh && ii.GetNextItem() != null && ii.NextItemCount > 0)
{ {
// draw horizontally from this sublevel to the end. // draw horizontally from this sublevel to the end.
int sublev = 0; int sublev = 0;
@ -683,7 +683,7 @@ namespace Volian.Print.Library
float retval = yLocation; float retval = yLocation;
// Check if only one line, i.e. "Height < (1.2F * IParagraph.Leading". The Leading can be for six or seven lines per inch, so the 1.2 // Check if only one line, i.e. "Height < (1.2F * IParagraph.Leading". The Leading can be for six or seven lines per inch, so the 1.2
// multiplier accounts for both. // multiplier accounts for both.
if (!MyItemInfo.IsStepSection && MyItemInfo.FormatStepData.CenterOneLineOnly && ((MyItemInfo.MyPrevious == null && MyItemInfo.NextItem == null) || MyItemInfo.FormatStepData.SeparateBox) && Height < (1.2F * IParagraph.Leading)) if (!MyItemInfo.IsStepSection && MyItemInfo.FormatStepData.CenterOneLineOnly && ((MyItemInfo.MyPrevious == null && MyItemInfo.GetNextItem() == null) || MyItemInfo.FormatStepData.SeparateBox) && Height < (1.2F * IParagraph.Leading))
IParagraph.Alignment = Element.ALIGN_CENTER; IParagraph.Alignment = Element.ALIGN_CENTER;
// if this step is centered, but not part of the checklist or valvelist format, use itextsharp to center it. // if this step is centered, but not part of the checklist or valvelist format, use itextsharp to center it.
// if it was part of the checklist or valvelist, then the centering is based on the column definitions for the table and // if it was part of the checklist or valvelist, then the centering is based on the column definitions for the table and
@ -1173,7 +1173,7 @@ namespace Volian.Print.Library
yPageStart = yPageStartRNO; yPageStart = yPageStartRNO;
yPageStart = ChildrenBelow.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); yPageStart = ChildrenBelow.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin);
if (MyItemInfo.IsHigh && MyItemInfo.NextItem == null) // last hls, add the 'end' message, if there is one if (MyItemInfo.IsHigh && MyItemInfo.GetNextItem() == null) // last hls, add the 'end' message, if there is one
{ {
DocStyle docstyle = MyItemInfo.MyDocStyle; DocStyle docstyle = MyItemInfo.MyDocStyle;
// if the EndForSingle format flag is set to false, then we do not print an End message if the section // if the EndForSingle format flag is set to false, then we do not print an End message if the section

View File

@ -151,7 +151,7 @@ namespace Volian.Print.Library
// Because of the different font sizes, when the Caution/Note did have have a bullet, the positioning // Because of the different font sizes, when the Caution/Note did have have a bullet, the positioning
// was off by the lenght of IdentB (the bullet string), thus the "alignAsIfBulleted" bool // was off by the lenght of IdentB (the bullet string), thus the "alignAsIfBulleted" bool
if ((myparent.MyItemInfo.FormatStepData != null) && myparent.MyItemInfo.FormatStepData.TabData.Bullet.Separate) if ((myparent.MyItemInfo.FormatStepData != null) && myparent.MyItemInfo.FormatStepData.TabData.Bullet.Separate)
if (myparent.MyItemInfo.MyPrevious != null || myparent.MyItemInfo.NextItem != null) if (myparent.MyItemInfo.MyPrevious != null || myparent.MyItemInfo.GetNextItem() != null)
SeparateBullet = true; SeparateBullet = true;
else else
alignAsIfBulleted = true; alignAsIfBulleted = true;
@ -247,7 +247,7 @@ namespace Volian.Print.Library
Rtf = Rtf.Replace("Caution ", @"\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?"); Rtf = Rtf.Replace("Caution ", @"\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?");
else else
{ {
if (myparent.MyItemInfo.FormatStepData != null && !myparent.MyItemInfo.FormatStepData.AlwaysTab && myparent.MyItemInfo.NextItem == null) if (myparent.MyItemInfo.FormatStepData != null && !myparent.MyItemInfo.FormatStepData.AlwaysTab && myparent.MyItemInfo.GetNextItem() == null)
Rtf = Rtf.Replace(@"\u9679?", ""); Rtf = Rtf.Replace(@"\u9679?", "");
Rtf = Rtf.Replace("Caution ", @"\u61507?\u61537?\u61557?\u61556?\u61545?\u61551?\u61550?\u61472?\u61472?"); Rtf = Rtf.Replace("Caution ", @"\u61507?\u61537?\u61557?\u61556?\u61545?\u61551?\u61550?\u61472?\u61472?");
} }