This commit is contained in:
@@ -378,6 +378,7 @@ namespace VEPROMS.CSLA.Library
|
||||
_AppendMethods.Add("{?.Sect Hdr}", AddOptionalTranGetSectionHdr);
|
||||
_AppendMethods.Add("{Sect Title}", AddTranGetSectionTitle);
|
||||
_AppendMethods.Add("{?.Sect Title}", AddOptionalTranGetSectionTitle);
|
||||
_AppendMethods.Add("{?.Sect Num}", AddOptionalTranGetSectionNum);
|
||||
_AppendMethods.Add("{Sect Num}", AddTranGetSectionNumber);
|
||||
}
|
||||
public static string GetResolvedText(ItemInfo fromInfo, int tranType, ItemInfo toItem, ItemInfo rangeItem)
|
||||
@@ -417,6 +418,7 @@ namespace VEPROMS.CSLA.Library
|
||||
bool lastAdded = false;
|
||||
while ((index = tb._TransFormat.IndexOf("{", startIndex)) > -1)
|
||||
{
|
||||
prefix = null;
|
||||
if (index > startIndex) prefix = tb._TransFormat.Substring(startIndex, index - startIndex);
|
||||
if (startIndex == 0 && prefix != null && prefix.Length > 0)
|
||||
{
|
||||
@@ -448,7 +450,6 @@ namespace VEPROMS.CSLA.Library
|
||||
return (tb.ToString());
|
||||
}
|
||||
|
||||
// TODO: TStepNoFlag, i.e. include step number in range items.
|
||||
// TODO: TStepNoFlag, i.e. include step number in range items.
|
||||
// TODO: For hlp: LowerCaseTranNumber - lower case substep numbers in transitions
|
||||
private static bool AddTransitionProcNum(TransitionBuilder tb) // Coded for HLP
|
||||
@@ -458,6 +459,7 @@ namespace VEPROMS.CSLA.Library
|
||||
// LATER: Format Flag TruncateProcNmAfter1stSpace (dropped plants)
|
||||
// LATER: Format Flag HardSpTranProcNumb (active plants)
|
||||
tb.AppendPrefix();
|
||||
if (tb._FormatData.TransData.HardSpTranProcNumb) retstr = retstr.Replace(" ", @"\u160?");
|
||||
tb.ReplaceToken(retstr);
|
||||
return (retstr != null && retstr != "");
|
||||
}
|
||||
@@ -568,7 +570,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
// check for transition that goes to a procedure step section with title of 'Procedure steps' followed
|
||||
// by ', Step'. This should output as 'Procedure step xyz' rather than 'Procedure steps, step xyz'
|
||||
if (!tb._TransFormat.Contains("{Last Step}") && tb.Prefix.ToUpper().Contains(", STEP") && tb.ToString().ToUpper().EndsWith("PROCEDURE STEPS"))
|
||||
if (!tb._TransFormat.Contains("{Last Step}") && tb.Prefix != null && tb.Prefix.ToUpper().Contains(", STEP") && tb.ToString().ToUpper().EndsWith("PROCEDURE STEPS"))
|
||||
{
|
||||
tb.Remove(tb.Length - 15, 15); // remove "procedure steps"
|
||||
tb.Append("procedure Step");
|
||||
@@ -582,6 +584,12 @@ namespace VEPROMS.CSLA.Library
|
||||
tb.ReplaceToken(Tab(tb._ToItem));
|
||||
return true;
|
||||
}
|
||||
else if ((tb._ToItem.IsSection || tb._ToItem.IsProcedure) && ((tb._TransUI & E_TransUI.StepAllowNone) == E_TransUI.StepAllowNone))
|
||||
{
|
||||
string tmpStr = tb.ToString();
|
||||
if (tmpStr.ToUpper().EndsWith(", STEP ")) tb.Remove(tb.Length - 7, 7); // 7 is length of ", Step "
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
@@ -683,12 +691,21 @@ namespace VEPROMS.CSLA.Library
|
||||
tb.ReplaceToken(retstr);
|
||||
return (retstr != null && retstr != "");
|
||||
}
|
||||
private static bool AddOptionalTranGetSectionNum(TransitionBuilder tb)
|
||||
{
|
||||
if (TranGetSectionItem(tb._FromItem).ItemID == TranGetSectionItem(tb._ToItem).ItemID) return false;
|
||||
if (tb._ToItem.IsSection) return false;
|
||||
tb.AppendPrefix();
|
||||
string retstr = TranGetSectionNumber(tb._ToItem);
|
||||
tb.ReplaceToken(retstr);
|
||||
return (retstr != null && retstr != "");
|
||||
}
|
||||
private static bool AddTranGetSectionTitle(TransitionBuilder tb)
|
||||
{
|
||||
// LATER: Cap1stSectionTitle, CapFirstLetterOnly
|
||||
if (tb._FormatData.TransData.UseSecTitles)
|
||||
{
|
||||
string retstr = TranGetSectionTitle(tb,tb._FromItem);
|
||||
string retstr = TranGetSectionTitle(tb,tb._ToItem);
|
||||
tb.AppendPrefix();
|
||||
tb.ReplaceToken(retstr);
|
||||
return (retstr != null && retstr != "");
|
||||
@@ -697,6 +714,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
private static bool AddTranGetSectionNumber(TransitionBuilder tb)
|
||||
{
|
||||
if (tb._TranType == 1 && tb._ToItem.ActiveSection.ItemID == tb._FromItem.ActiveSection.ItemID) return false;
|
||||
string retstr = TranGetSectionNumber(tb._ToItem);
|
||||
tb.AppendPrefix();
|
||||
tb.ReplaceToken(retstr);
|
||||
@@ -718,6 +736,7 @@ namespace VEPROMS.CSLA.Library
|
||||
private static string TranGetSectionNumber(ItemInfo itminfo)
|
||||
{
|
||||
ItemInfo tmpitm = TranGetSectionItem(itminfo);
|
||||
if (!tmpitm.IsSection) return "";
|
||||
return (tmpitm.MyContent.Number);
|
||||
}
|
||||
private static string TranGetSectionTitle(TransitionBuilder tb, ItemInfo itminfo)
|
||||
|
Reference in New Issue
Block a user