This commit is contained in:
Kathy Ruffing 2012-08-01 11:22:31 +00:00
parent 8632d6e7e8
commit 058c21ba65
2 changed files with 18 additions and 9 deletions

View File

@ -374,6 +374,7 @@ namespace VEPROMS.CSLA.Library
_AppendMethods.Add("{Proc Title}", AddTransitionProcTitle); _AppendMethods.Add("{Proc Title}", AddTransitionProcTitle);
_AppendMethods.Add("{?.Proc Title}", AddOptionalTransitionProcTitle); _AppendMethods.Add("{?.Proc Title}", AddOptionalTransitionProcTitle);
_AppendMethods.Add("{First Step}", AddStepNumber); _AppendMethods.Add("{First Step}", AddStepNumber);
_AppendMethods.Add("{Step Number}", AddStepNumber); // WCN2, tran type 6
_AppendMethods.Add("{Last Step}", AddRangeStepNumber); _AppendMethods.Add("{Last Step}", AddRangeStepNumber);
_AppendMethods.Add("{.}", AddIncludedStepNumber); _AppendMethods.Add("{.}", AddIncludedStepNumber);
_AppendMethods.Add("{Sect Hdr}", AddTranGetSectionHdr); _AppendMethods.Add("{Sect Hdr}", AddTranGetSectionHdr);
@ -382,6 +383,8 @@ namespace VEPROMS.CSLA.Library
_AppendMethods.Add("{?.Sect Title}", AddOptionalTranGetSectionTitle); _AppendMethods.Add("{?.Sect Title}", AddOptionalTranGetSectionTitle);
_AppendMethods.Add("{?.Sect Num}", AddOptionalTranGetSectionNum); _AppendMethods.Add("{?.Sect Num}", AddOptionalTranGetSectionNum);
_AppendMethods.Add("{Sect Num}", AddTranGetSectionNumber); _AppendMethods.Add("{Sect Num}", AddTranGetSectionNumber);
_AppendMethods.Add("{Sect Number}", AddTranGetSectionNumber); // WCN2, tran type 6
} }
public static string GetResolvedText(ItemInfo fromInfo, int tranType, ItemInfo toItem, ItemInfo rangeItem) public static string GetResolvedText(ItemInfo fromInfo, int tranType, ItemInfo toItem, ItemInfo rangeItem)
{ {
@ -595,15 +598,18 @@ namespace VEPROMS.CSLA.Library
pitem = pitem.ActiveParent as ItemInfo; pitem = pitem.ActiveParent as ItemInfo;
if (pitem == null) break; if (pitem == null) break;
} }
// add hls tab. // add hls tab if it's not already in the tab.
if (pitem.IsHigh) if (pitem.IsHigh)
{ {
string hlsTab = StepInfo.Get(pitem.ItemID).MyTab.CleanTextNoSymbols; string hlsTab = StepInfo.Get(pitem.ItemID).MyTab.CleanTextNoSymbols;
if (!hasDelim) if (!sret.StartsWith(hlsTab.Trim(" ".ToCharArray())))
foreach (string rmvDelim in DelimList) hlsTab = hlsTab.Replace(rmvDelim, ""); {
hlsTab = hlsTab.Trim(" ".ToCharArray()); if (!hasDelim)
if (hasDelim && !hlsTab.EndsWith(".") && !hlsTab.EndsWith(")")) hlsTab = hlsTab + "."; foreach (string rmvDelim in DelimList) hlsTab = hlsTab.Replace(rmvDelim, "");
sret = hlsTab + sret; hlsTab = hlsTab.Trim(" ".ToCharArray());
if (hasDelim && !hlsTab.EndsWith(".") && !hlsTab.EndsWith(")")) hlsTab = hlsTab + ".";
sret = hlsTab + sret;
}
} }
break; break;
} }

View File

@ -381,6 +381,8 @@ namespace Volian.Controls.Library
string strippedText = StaticStripRtfCommands(text); string strippedText = StaticStripRtfCommands(text);
string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v \\]+)*\\v(\\[^v \\]+)* #Link:(ReferencedObject|Transition[^:]*?):[0-9]* ([0-9]*).*?\[END>"); string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v \\]+)*\\v(\\[^v \\]+)* #Link:(ReferencedObject|Transition[^:]*?):[0-9]* ([0-9]*).*?\[END>");
MatchCollection matches = Regex.Matches(text, lookFor); MatchCollection matches = Regex.Matches(text, lookFor);
if (matches.Count == 0) return text;
string retstr = null;
for (int i = matches.Count - 1; i >= 0; i--) for (int i = matches.Count - 1; i >= 0; i--)
{ {
Match m = matches[i]; Match m = matches[i];
@ -398,16 +400,17 @@ namespace Volian.Controls.Library
string newvalue = g.ToString(); string newvalue = g.ToString();
int indexLastSpace = newvalue.LastIndexOf(' '); int indexLastSpace = newvalue.LastIndexOf(' ');
if (indexLastSpace >= 0) if (indexLastSpace >= 0)
text = beforeTran + newvalue.Substring(0, indexLastSpace) + @"\u160?" + newvalue.Substring(indexLastSpace + 1) + afterTran; retstr = beforeTran + newvalue.Substring(0, indexLastSpace) + @"\u160?" + newvalue.Substring(indexLastSpace + 1) + afterTran;
else else
if (beforeTran.EndsWith(" ") ) if (beforeTran.EndsWith(" ") )
text = ReplaceLastSpaceWithHardSpace(beforeTran) + newvalue + afterTran; retstr = ReplaceLastSpaceWithHardSpace(beforeTran) + newvalue + afterTran;
else else
Console.Write("");// Don't know where to put the Hard Space Console.Write("");// Don't know where to put the Hard Space
} }
} }
} }
return text; if (retstr == null) return text; // no transition processing occurred, just return original string.
return retstr;
} }
private string ReplaceLastSpaceWithHardSpace(string str) private string ReplaceLastSpaceWithHardSpace(string str)
{ {