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

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

View File

@@ -109,7 +109,7 @@ namespace Volian.Print.Library
{
if ((childItemInfo.IsCaution || childItemInfo.IsNote) &&
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
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)
Paragraph horzLine = new Paragraph(ii.ActiveFormat.PlantFormat.FormatData.BoxList[0].BXHorz, iSymblFont);
bool bottomOfTable = (ii.NextItem == null || ii.NextItemCount == 0) ||
(MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].MyItemInfo.ItemID == ii.NextItem.ItemID);
bool bottomOfTable = (ii.GetNextItem() == null || ii.NextItemCount == 0) ||
(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.
Paragraph leftLine = new Paragraph(bottomOfTable ? bx.BXLLC : bx.BXMLS, 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
// and the horizontal. This is case where the component number may have multiple descriptions,positions, etc. associated
// 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.
int sublev = 0;
@@ -683,7 +683,7 @@ namespace Volian.Print.Library
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
// 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;
// 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
@@ -1173,7 +1173,7 @@ namespace Volian.Print.Library
yPageStart = yPageStartRNO;
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;
// if the EndForSingle format flag is set to false, then we do not print an End message if the section