B2021-100: Crash on insert of symbol over text selection
This commit is contained in:
		@@ -324,7 +324,8 @@ namespace Volian.Controls.Library
 | 
			
		||||
				//{
 | 
			
		||||
					StringBuilder selectedRtfSB = new StringBuilder();
 | 
			
		||||
				//AddFontTable(selectedRtfSB, FormatFont, FontIsFixed(FormatFont));
 | 
			
		||||
				AddFontTable(selectedRtfSB, SelectionFont, FontIsFixed(FormatFont));
 | 
			
		||||
				// B2021-100:  if SelectionFont is null, use the FormatFont
 | 
			
		||||
				AddFontTable(selectedRtfSB, SelectionFont==null?FormatFont:SelectionFont, FontIsFixed(FormatFont));
 | 
			
		||||
					_RtfPrefix = selectedRtfSB.ToString();
 | 
			
		||||
				//}
 | 
			
		||||
				return _RtfPrefix + @"\f1\fs" + FormatFont.SizeInPoints * 2 + " ";
 | 
			
		||||
@@ -1317,6 +1318,14 @@ namespace Volian.Controls.Library
 | 
			
		||||
			RTBAPI.E_FontStyle fs = RTBAPI.GetFontStyle(this);
 | 
			
		||||
			Font locfont = this.Font; 
 | 
			
		||||
			int position = SelectionStart;
 | 
			
		||||
			// B2021-100: if SelectionFont is null set it, it is used in RtfPrefixForSymbols
 | 
			
		||||
			if (SelectionFont == null)
 | 
			
		||||
			{
 | 
			
		||||
				if (FieldToEdit == E_FieldToEdit.StepText && MyItemInfo!=null)
 | 
			
		||||
					SelectionFont = MyItemInfo.GetItemFont().WindowsFont;
 | 
			
		||||
				else
 | 
			
		||||
					SelectionFont = locfont;
 | 
			
		||||
			}
 | 
			
		||||
			SelectedRtf = RtfPrefixForSymbols + str + @"}";
 | 
			
		||||
			Select(position, 1);
 | 
			
		||||
			Select(position + 1, 0);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user