B2019-084: Procedure number change not updated in pasted transition over another transition

This commit is contained in:
Kathy Ruffing 2020-03-05 16:52:28 +00:00
parent b9352fc0f5
commit 975db3f56d
2 changed files with 6 additions and 0 deletions

View File

@ -41,6 +41,8 @@ namespace VEPROMS.CSLA.Library
if (forceConvertToText)
newvalue = "?";
string findLink = @"<START\].*?\[END>";
// B2019-084: Procedure number change not updated in pasted transition - there were 2 '<START]'s in the text so regex didn't find what was needed.
if (Text.Contains("<START]<START]")) Text = Text.Replace("<START]<START]", "<START]");
MatchCollection ms = Regex.Matches(Text, findLink, RegexOptions.Singleline);
//string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v '?\\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>", rousg.ROUsageID);
string lookFor;
@ -814,6 +816,8 @@ namespace VEPROMS.CSLA.Library
if (forceConvertToText != string.Empty)
newvalue = "?";
string findLink = @"<START\].*?\[END>";
// B2019-084: There were 2 '<START]'s in the text so regex didn't find what was needed to fix an updated procedure number. Note that 'Text' is read only, but _Text gets used.
if (Text.Contains("<START]<START]")) _Text = Text.Replace("<START]<START]", "<START]");
MatchCollection ms = Regex.Matches(Text, findLink);
//string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v '?\\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>", rousg.ROUsageID);
string lookFor = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\line ?|\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID);

View File

@ -896,6 +896,8 @@ namespace VEPROMS.CSLA.Library
bool haslinks = ((modtext.IndexOf(@"<START]") > -1) || (OriginalText != null && OriginalText != "" && OriginalText.IndexOf(@"<START]") > -1));
if (haslinks)
{
// B2019-084: Procedure number change not updated in pasted transition when copied text was a transition also - there were 2 '<START]'s, so replace w/ 1:
if (modtext.Contains("<START]<START]")) modtext = modtext.Replace("<START]<START]", "<START]");
// Get all links in original list
RtfToDisplayTextElements(OriginalText);
List<displayLinkElement> origList = GetLinkList(DisplayTextElementList);