Fixed problem where symbols were not showing properly.

This commit is contained in:
Rich 2010-12-10 10:51:03 +00:00
parent 3e135d8deb
commit f2ba882506

View File

@ -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();
}