diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index 9a2bb5df..c6471161 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -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);