From 71fb86effb70cc2509529bde982581c34bbc7599 Mon Sep 17 00:00:00 2001 From: Rich Date: Wed, 1 Dec 2010 21:06:25 +0000 Subject: [PATCH] No need to set the SelectedFont since it is no longer used Use Font instead of SelectedFont which can be null if there are more than one font within the selected text --- PROMS/Volian.Controls.Library/RTBAPI.cs | 2 +- PROMS/Volian.Controls.Library/StepRTB.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PROMS/Volian.Controls.Library/RTBAPI.cs b/PROMS/Volian.Controls.Library/RTBAPI.cs index 9c0ff76e..b43870dd 100644 --- a/PROMS/Volian.Controls.Library/RTBAPI.cs +++ b/PROMS/Volian.Controls.Library/RTBAPI.cs @@ -858,7 +858,7 @@ namespace Volian.Controls.Library // dyLineSpacing is Spacing between lines. the PFS_EXACT sets line spacing as the spacing from one //line to the next, in twips - thus the 1440. - pft.dyLineSpacing = Convert.ToInt32(.5 + richTextBox.SelectionFont.GetHeight(dpi)) * 1440 / dpi; + pft.dyLineSpacing = Convert.ToInt32(.5 + richTextBox.Font.GetHeight(dpi)) * 1440 / dpi; SetParaFormat(richTextBox, pft); } public static E_FontStyle GetFontStyle(RichTextBox richTextBox) diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index 61665cf2..855d8cd5 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -226,7 +226,7 @@ namespace Volian.Controls.Library // IMPORTANT: SetLineSpacing must be set before Links, otherwise it // was confusing the 'handle' of the rtf box. //Console.WriteLine("'font',{0}", Font); - if(Text == "")SelectionFont = Font; // Initialize SelectionFont + //if(Text == "")SelectionFont = Font; // Initialize SelectionFont RTBAPI.SetLineSpacing(this, RTBAPI.ParaSpacing.PFS_EXACT); AddRtfText(vlntxt.StartText); //AddRtfStyles();