This commit is contained in:
parent
043995b4b4
commit
530e41a44f
@ -624,18 +624,23 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
private static bool AddOptionalTranGetSectionHdr(bool textAdded, TransitionBuilder tb, string token, string nonToken)
|
||||
{
|
||||
// output from 16-bit code looks like section header
|
||||
// token is passed in for future use, i.e. if text is placed between "?" and "." to
|
||||
// request other processing.
|
||||
// If section is not a procedure step section, add it.
|
||||
// If Procedure going to has only 1 step section, do not add it.
|
||||
// If procedure going to has more than 1 step section and is NOT same procedure
|
||||
// and going to default section, do not add it.
|
||||
// If procedure going to has more than 1 step section and going to non-default section, add it.
|
||||
|
||||
// If in same procedure, the section header is put out if not in the same section.
|
||||
// If in a different procedure, the section header is put out if the 'to' item is not the
|
||||
// default (or start) section.
|
||||
if (tb._FromItem.MyProcedure.ItemID == tb._ToItem.MyProcedure.ItemID)
|
||||
{
|
||||
if (TranGetSectionItem(tb._FromItem).ItemID == TranGetSectionItem(tb._ToItem).ItemID) return textAdded ? true : false;
|
||||
}
|
||||
else if (TranGetSectionItem(tb._ToItem).IsDefaultSection) return textAdded ? true : false;
|
||||
// first handle 'to' non-step section. Always add it.
|
||||
if (tb._ToItem.IsSection && !tb._ToItem.IsStepSection)return AddTranGetSectionHdr(textAdded, tb, token, nonToken);
|
||||
|
||||
// Now, handle case where 'to' procedure only has one step section OR going 'to' the default section of a
|
||||
// different procedure. It is NOT added.
|
||||
int cntsect = 0;
|
||||
ItemInfo sect = TranGetSectionItem(tb._ToItem);
|
||||
foreach (ItemInfo ii in tb._ToItem.MyProcedure.Sections) if (ii.IsStepSection) cntsect++;
|
||||
if (cntsect == 1 || (sect != null && sect.IsDefaultSection && tb._ToItem.IsStep)
|
||||
|| (tb._ToItem.MyProcedure != tb._FromItem.MyProcedure && sect != null && sect.IsDefaultSection && tb._ToItem.IsSection)
|
||||
|| tb._ToItem.IsProcedure) return textAdded ? true : false;
|
||||
return AddTranGetSectionHdr(textAdded, tb, token, nonToken);
|
||||
}
|
||||
private static bool AddTranGetSectionHdr(bool textAdded, TransitionBuilder tb, string token, string nonToken)
|
||||
|
Loading…
x
Reference in New Issue
Block a user