From f2ba882506187041dc0582964c4606d47e88fdc3 Mon Sep 17 00:00:00 2001 From: Rich Date: Fri, 10 Dec 2010 10:51:03 +0000 Subject: [PATCH] Fixed problem where symbols were not showing properly. --- PROMS/Volian.Controls.Library/StepRTB.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index d2eb0e30..42ac134e 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -228,12 +228,11 @@ namespace Volian.Controls.Library //Console.WriteLine("'font',{0}", Font); //if(Text == "")SelectionFont = Font; // Initialize SelectionFont RTBAPI.SetLineSpacing(this, RTBAPI.ParaSpacing.PFS_EXACT); + ReadOnly = EpMode == E_EditPrintMode.Print || VwMode == E_ViewMode.View || edit == false; AddRtfText(vlntxt.StartText); //AddRtfStyles(); // set readonly based on initial modes, however, these may change if // user selected view mode. - ReadOnly = !(EpMode == E_EditPrintMode.Edit && VwMode == E_ViewMode.Edit); - if (!ReadOnly && !edit) ReadOnly = true; ClearUndo(); // RHM: 20101122 - Not sure why the RightMargin is set. The following line was added in Rev 23 // in May of 2008. @@ -715,6 +714,7 @@ namespace Volian.Controls.Library #endregion #region AddRtfTextAndStyles private string _LastRtf = ""; + private bool _lastReadOnly = false; private void AddRtfText(string txt) { //Console.WriteLine("ItemID:{0}", MyItemInfo.ItemID); @@ -725,13 +725,14 @@ namespace Volian.Controls.Library _RtfPrefix = selectedRtfSB.ToString(); selectedRtfSB.Append(txt); string newRtf = selectedRtfSB.ToString() + "}"; - if(newRtf != _LastRtf) + if(newRtf != _LastRtf || ReadOnly != _lastReadOnly) { //Console.WriteLine("ItemID:{0}\r\nOld:'{1}'\r\nNew:'{2}'\r\n", MyItemInfo.ItemID, Rtf, newRtf); this.ContentsResized -=new ContentsResizedEventHandler(StepRTB_ContentsResized); Text = ""; this.ContentsResized += new ContentsResizedEventHandler(StepRTB_ContentsResized); SelectedRtf = _LastRtf = newRtf; + _lastReadOnly = ReadOnly; } FindAllLinks(); }