diff --git a/PROMS/DataLoader/RefObjs.cs b/PROMS/DataLoader/RefObjs.cs index 8cfc5f04..12b84e1c 100644 --- a/PROMS/DataLoader/RefObjs.cs +++ b/PROMS/DataLoader/RefObjs.cs @@ -91,7 +91,7 @@ namespace DataLoader else tok = textm.IndexOf('\x15', beg); } - if (beg < textm.Length - 1) + if (beg <= textm.Length - 1) rotxt.Append(textm.Substring(beg, textm.Length - beg)); return rotxt.ToString(); diff --git a/PROMS/DataLoader/Steps.cs b/PROMS/DataLoader/Steps.cs index 203375cd..01996569 100644 --- a/PROMS/DataLoader/Steps.cs +++ b/PROMS/DataLoader/Steps.cs @@ -60,7 +60,8 @@ namespace DataLoader // Need the content record for the RO & transitions. //content = Content.MakeContent(null, stptext, 20000 + int.Parse(newstptyp!=null?newstptyp:StepType),null, ManualPagebreak?ci.ToString():null, dts, userid); // 20000 flags step type item & 1 adjusts for 'base' in format files. - content = Content.New(null, stptext, 20001 + int.Parse(newstptyp != null ? newstptyp : StepType), null, ManualPagebreak ? ci.ToString() : null, dts, userid); + int contenttype = (structtype == "R") ? 20040 : 20001 + int.Parse(newstptyp != null ? newstptyp : StepType); + content = Content.New(null, stptext, contenttype, null, ManualPagebreak ? ci.ToString() : null, dts, userid); content.MyZContent.OldStepSequence = ProcNumber + "|" + stpseq; // Before we save it, handle RO & Transitions tokens. diff --git a/PROMS/DataLoader/TextConvert.cs b/PROMS/DataLoader/TextConvert.cs index b0dff5de..80249c2a 100644 --- a/PROMS/DataLoader/TextConvert.cs +++ b/PROMS/DataLoader/TextConvert.cs @@ -193,6 +193,11 @@ namespace DataLoader s2 = Regex.Replace(s2, @"\x13([^\x13 ]*?)(?:[\x13]|(?= )|\Z)(.*?)", @"\b $1\b0 $2"); s2 = Reg2.Replace(s2, new MatchEvaluator(ReplaceChars)); + + // Now prepend an escape character, '\', to any curly brace. The curly brace + // is used in rtf land. + s2 = s2.Replace(@"{", @"\{"); + s2 = s2.Replace(@"}", @"\}"); return s2; } }