Fix dashes when inserting transitions, fix replace selected with RO

This commit is contained in:
John Jenko 2009-12-02 14:30:13 +00:00
parent 641dbf945d
commit f2360272a3

View File

@ -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 <START]\v0\cf1 " + linkValue + @"\cf0\v " + linkUrl + @"\v0 \v [END>\v0 }";
Console.WriteLine(this.Rtf);
linkValue = linkValue.Replace("\\u8209?", "\\f1\\u8209?\\f0 ");
SelectedRtf = @"{\rtf1\ansi"+FontTable+@"{\colortbl ;\red255\green0\blue0;}\v"+FontSize+@" <START]\v0\cf1 " + linkValue + @"\cf0\v " + linkUrl + @"\v0 \v [END>\v0 }";
Console.WriteLine(this.Rtf);
this.SelectionLength = 0;
this.SelectionStart = position;
FindAllLinks();