From f2360272a3a79ff5bf86ae68e1c504563a710b5f Mon Sep 17 00:00:00 2001 From: John Date: Wed, 2 Dec 2009 14:30:13 +0000 Subject: [PATCH] Fix dashes when inserting transitions, fix replace selected with RO --- PROMS/Volian.Controls.Library/StepRTB.cs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index f2c6252f..ce839cc1 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -675,12 +675,34 @@ namespace Volian.Controls.Library else AddLink20(linkUrl, linkValue); } + private string FontTable + { + get + { + Match match = Regex.Match(Rtf, @"\{\\fonttbl\{.*?\}\}"); + return match.Value; + } + } + private string FontSize + { + get + { + Match match = Regex.Match(Rtf, @"\\fs[0-9]*"); + return match.Value; + } + } private void AddLink20(string linkValue, string linkUrl) { + string fonttab = FontTable; + string fontsize = FontSize; this.DetectUrls = false; + if (SelectionLength > 0) DeleteCurrentSelection(null); int position = SelectionStart; SelectionLength = 0; - SelectedRtf = @"{\rtf1\ansi{\colortbl ;\red255\green0\blue0;}\v \v0 }"; + Console.WriteLine(this.Rtf); + linkValue = linkValue.Replace("\\u8209?", "\\f1\\u8209?\\f0 "); + SelectedRtf = @"{\rtf1\ansi"+FontTable+@"{\colortbl ;\red255\green0\blue0;}\v"+FontSize+@" \v0 }"; + Console.WriteLine(this.Rtf); this.SelectionLength = 0; this.SelectionStart = position; FindAllLinks();