44 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
0) a) If starts before link & ends after a link, delete selection
 | 
						|
	 b) If starts before link & ends at end of link (SelectedText ends with [END>), delete selection
 | 
						|
	 c) If starts before link & ends between 2 links, (SelectedText ends with <START],
 | 
						|
	 		push_selection; set SelectionStart1 = SelectionStart + SelectionLength,
 | 
						|
	 		using SetSelection(SelectionStart1, 0) from TestWndProc/MyPanel.cs; insert space; pop_selection;
 | 
						|
	 		allow deletion 
 | 
						|
	 d) If starts at beginning of one link and end of another and end is in text:
 | 
						|
	 	  Save SelectionStart & SelectionLength; Set SelectionLength=0; Insert a space; set SelectionStart
 | 
						|
	 	  to saved SelectionStart+1 and SelectionLength = saved SelectionLength; allow deletion
 | 
						|
	 e) If deleting a link do the following. 
 | 
						|
	 
 | 
						|
1) Break 'Rtf' into 3 pieces:
 | 
						|
	 - From 0 to StartRtf
 | 
						|
	 - From StartRtf to LengthRtf
 | 
						|
	 - From EndRtf
 | 
						|
	 
 | 
						|
2) Capture any formatting from the link. 
 | 
						|
   Only do this if selection starts at the 
 | 
						|
   beginning of a link (using linklocation start)
 | 
						|
 | 
						|
Within piece 2 (link):
 | 
						|
	Remove <START]
 | 
						|
	Remove everything from first space on
 | 
						|
	Take any remaining characters (formatting) and
 | 
						|
		save them as FORMATTING to be used piece 1
 | 
						|
		
 | 
						|
3) Keep formatting and fix comment beginning/ending 
 | 
						|
   based on single link or two in a row. 
 | 
						|
 | 
						|
Within piece 1 (before link):  
 | 
						|
	if piece1 ends with [END>
 | 
						|
		append FORMATTING+'\v0 ' after [END>
 | 
						|
	else
 | 
						|
		replace last \v with FORMATTING
 | 
						|
 | 
						|
4) Within piece 3 (after link):
 | 
						|
  if piece3 begins with <START] 
 | 
						|
  	insert '\v ' before <START] in piece3
 | 
						|
	else if begins with '\v0 ' 
 | 
						|
		remove '\v0 '
 | 
						|
	else // remove '\v0' - this is in case other formatting exists
 | 
						|
		remove first '\v0' found
 | 
						|
	
 |