diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index 4c4045ed..8b2d395f 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -2782,9 +2782,9 @@ namespace Volian.Controls.Library { // first find the new link and determine whether it's RO or transition. int indx = Rtf.IndexOf(@"#Link:ReferencedObject:"); - if (indx>0) + if (indx > 0) { - Match mro = Regex.Match(Rtf.Substring(indx,Rtf.Length-indx), @"([A-Za-z]*):(.*)\[END>"); + Match mro = Regex.Match(Rtf.Substring(indx, Rtf.Length - indx), @"([A-Za-z]*):(.*)\[END>"); string linkstr = mro.Groups[2].Value; string[] roparts = linkstr.Split(" ".ToCharArray()); ContentRoUsage rousg = null; @@ -2803,13 +2803,15 @@ namespace Volian.Controls.Library MyItemInfo.MyContent.RefreshContentRoUsages(); } } - Match mt = Regex.Match(Rtf, "Transition.*:.* "); + // Need to look for any 'New' transitions, don't include existing ones. + Match mt = Regex.Match(Rtf, @"#Link:Transition:([0-9]+) "); + if (mt.Length <= 0) mt = Regex.Match(Rtf, @"#Link:TransitionRange:([0-9]+) "); if (mt.Length > 0) { - indx = mt.Index; + indx = mt.Index+6; // get past '#Link:" Match m = Regex.Match(Rtf.Substring(indx, Rtf.Length - indx), @"([A-Za-z]*):(.*)\[END>"); bool isSingleTran = true; - if (Rtf.Substring(indx,16).IndexOf("TransitionRange")>=0) isSingleTran = false; + if (Rtf.Substring(indx, 16).IndexOf("TransitionRange") >= 0) isSingleTran = false; string linkstr = m.Groups[2].Value; string[] tparts = linkstr.Split(" ".ToCharArray()); int type = System.Convert.ToInt32(tparts[0]); @@ -2842,7 +2844,6 @@ namespace Volian.Controls.Library ContentTransition ct = itm.MyContent.ContentTransitions.Add(itm1, itm2); //Console.WriteLine("CT {0},{1},{2},{3}", ct.TransitionID, itm.ItemID, itm.MyContent.MyContentUnique, itm.MyContent.ContentTransitions.Count); ct.TranType = type; - if (isSingleTran) ct.IsRange = 0; else if (tr1 != tr2) @@ -2857,11 +2858,10 @@ namespace Volian.Controls.Library itm.Save(); MyItemInfo.MyContent.RefreshContentTransitions(); } - + if (dispose2) itm2.Dispose(); if (dispose1) itm1.Dispose(); } - return Rtf; } #endregion