Fixed problem saving clipboard copy of just an RO in the text, save both RTF and Text version of step text to clipboard, handle, paste rtf vs plain text

This commit is contained in:
John Jenko 2011-05-27 17:18:37 +00:00
parent b303193350
commit a51f98c230

View File

@ -1464,6 +1464,19 @@ namespace Volian.Controls.Library
SetSelection(SelectionStart - 7, SelectionLength + 7); // Expand selection to include start
//_AdjustingSelection = false;
}
public string GetSelectionForClipBoard()
{
string selTxtRTF = SelectedRtf;
LinkLocation llstart = FindLinkLocation();
if (llstart != null)
{
selTxtRTF = Rtf.Substring(llstart.StartRtf, llstart.EndRtf - llstart.StartRtf);
string lookfor = selTxtRTF.Substring(selTxtRTF.IndexOf(' '));
return SelectedRtf.Replace(lookfor, @"\v " + selTxtRTF);
}
return (selTxtRTF);
}
private void DeleteBetweenBetweenLinks(string keychars)
{
@ -2091,7 +2104,9 @@ namespace Volian.Controls.Library
public int SelectionStart
{
get { return _SelectionStart; }
set { _SelectionStart = value; }
set {
_SelectionStart = value;
}
}
int _SelectionLength;
public int SelectionLength
@ -2101,6 +2116,8 @@ namespace Volian.Controls.Library
}
public SelectionData(RichTextBox richTextBox)
{
//Console.WriteLine("SelectionData SelectionStart {0}", richTextBox.SelectionStart);
//Volian.Base.Library.vlnStackTrace.ShowStack("SelectionData SelectionStart",this);//.ShowStackLocal("SelectionData SelectionStart", 3);
_SelectionStart = richTextBox.SelectionStart;
_SelectionLength = richTextBox.SelectionLength;
}