Hello,
I have an issue with the RichEdit Control. You can do the following to reproduce.
- Add this method to the Styles.cs in the RichEditMainDemo sample:
C#private static void AddStyles(RichEditControl richEditControl)
{
CharacterStyle cstyle = richEditControl.Document.CharacterStyles["My Heading 1"];
if (cstyle == null)
{
cstyle = richEditControl.Document.CharacterStyles.CreateNew();
cstyle.Name = "My Heading 1";
richEditControl.Document.CharacterStyles.Add(cstyle);
CharacterStyle parentStyle = richEditControl.Document.CharacterStyles["Default Paragraph Font"];
if (parentStyle != null)
{
cstyle.Parent = parentStyle;
}
cstyle.Bold = true;
//cstyle.Italic =
cstyle.FontSize = 36;
}
}
- Now call this method in the DoShow() Method and you have now created a new style created "My Heading 1".
- Run the sample and select Styles (updated) and verify that you have a new style called "My Heading 1" in the Styles gallery
- Mark some text and apply the new style.
- Modify the "My Heading 1" style in the Modify Style dialog. For example change the font size. and close the dialog.
- Now try to modify the style again and the demo crashes. I wither shuts down with no stack trace or it closes with following stack trace.
C#at DevExpress.XtraRichEdit.Model.CharacterProperties.GetCache(DocumentModel documentModel)
at DevExpress.XtraRichEdit.Model.RichEditIndexBasedObject`1.GetCache(IDocumentModel documentModel)
at DevExpress.Office.UndoableIndexBasedObject`2.get_InfoCore()
at DevExpress.Office.UndoableIndexBasedObject`2.get_Info()
at DevExpress.XtraRichEdit.Model.CharacterPropertiesMerger..ctor(CharacterProperties initialProperties)
at DevExpress.XtraRichEdit.Model.CharacterStyle.GetMergedCharacterProperties()
at DevExpress.XtraRichEdit.Model.CharacterStyle.GetMergedCharacterProperties()
at DevExpress.XtraRichEdit.Model.TextRunBase.GetParentMergedCharacterProperties()
at DevExpress.XtraRichEdit.Model.TextRunBase.GetMergedCharacterProperties()
at DevExpress.XtraRichEdit.Model.TextRunBase.get_MergedCharacterFormattingCacheIndex()
at DevExpress.XtraRichEdit.Model.TextRunBase.get_MergedCharacterFormatting()
at DevExpress.XtraRichEdit.Model.VisibleTextFilter.IsRunVisibleCore(RunIndex runIndex)
at DevExpress.XtraRichEdit.Model.VisibleTextFilter.IsRunVisible(RunIndex runIndex)
at DevExpress.XtraRichEdit.Model.VisibleTextFilterBase.FindVisibleParagraphRunForward(RunIndex runIndex)
at DevExpress.XtraRichEdit.Layout.Engine.ParagraphIteratorBase..ctor(Paragraph paragraph, PieceTable pieceTable, IVisibleTextFilter visibleTextFilter)
at DevExpress.XtraRichEdit.Layout.Engine.BeginParagraphFormatting.EnsureParagraphBoxes()
at DevExpress.XtraRichEdit.Layout.Engine.BeginParagraphFormatting.FormatNextRow()
at DevExpress.XtraRichEdit.Layout.Engine.DocumentFormatter.FormatNextRow()
at DevExpress.XtraRichEdit.Layout.Engine.BackgroundFormatter.PerformPrimaryLayoutCore()
at DevExpress.XtraRichEdit.Layout.Engine.BackgroundFormatter.PerformPrimaryLayout()
at DevExpress.XtraRichEdit.Layout.Engine.BackgroundFormatter.PerformSecondaryLayout()
at DevExpress.XtraRichEdit.Layout.Engine.BackgroundFormatter.HandleCommand(Int32 commandIndex)
at DevExpress.XtraRichEdit.Layout.Engine.BackgroundFormatter.HandleCommand(WeakReference thisWeakRef, Int32 commandIndex)
at DevExpress.XtraRichEdit.Layout.Engine.BackgroundFormatter.WorkerBody(WeakReference thisWeakRef)
at DevExpress.XtraRichEdit.Layout.Engine.BackgroundFormatter.Worker(Object parameter)
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart(Object obj)
I have also seen the following stack track which is almost identical:
C#at DevExpress.XtraRichEdit.Model.CharacterProperties.GetCache(DocumentModel documentModel)
at DevExpress.XtraRichEdit.Model.RichEditIndexBasedObject`1.GetCache(IDocumentModel documentModel)
at DevExpress.Office.IndexBasedObjectA`2.get_InfoCore()
at DevExpress.Office.IndexBasedObjectA`2.get_Info()
at DevExpress.XtraRichEdit.Model.CharacterPropertiesMerger..ctor(CharacterProperties initialProperties)
at DevExpress.XtraRichEdit.Model.CharacterStyle.GetMergedCharacterProperties()
at DevExpress.XtraRichEdit.Model.CharacterStyle.GetMergedCharacterProperties()
at DevExpress.XtraRichEdit.Model.CharacterStyle.GetMergedWithDefaultCharacterProperties()
at DevExpress.XtraRichEdit.Model.CharacterStyle.CopyFrom(DocumentModel targetModel)
at DevExpress.XtraRichEdit.Model.CharacterStyle.Copy(DocumentModel targetModel)
at DevExpress.XtraRichEdit.Forms.EditStyleFormController.FillTempRichEdit(IRichEditControl richEditControl)
at DevExpress.XtraRichEdit.Forms.EditStyleForm.InitializeForm()
at DevExpress.XtraRichEdit.Forms.EditStyleForm.cbCurrentStyle_SelectedIndexChanged(Object sender, EventArgs e)
at DevExpress.XtraEditors.Repository.RepositoryItemComboBox.RaiseSelectedIndexChanged(EventArgs e)
at DevExpress.XtraEditors.ComboBoxEdit.UpdatePopupEditValueIndex(Int32 prevIndex)
at DevExpress.XtraEditors.ComboBoxEdit.set_EditValue(Object value)
at DevExpress.XtraEditors.PopupBaseEdit.AcceptPopupValue(Object val)
at DevExpress.XtraEditors.PopupBaseEdit.UpdateEditValueOnClose(PopupCloseMode closeMode, Boolean acceptValue, Object newValue, Object oldValue)
at DevExpress.XtraEditors.PopupBaseEdit.DoClosePopup(PopupCloseMode closeMode)
at DevExpress.XtraEditors.PopupBaseEdit.ClosePopup(PopupCloseMode closeMode)
at DevExpress.XtraEditors.PopupBaseEdit.ClosePopup()
at DevExpress.XtraEditors.Popup.PopupListBox.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at DevExpress.Utils.Controls.ControlBase.WndProc(Message& m)
at DevExpress.XtraEditors.BaseListBoxControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Any idea what is wrong?
Thanks
Henrik Skak Pedersen
Thank you for pointing out this issue to us. I was able to replicate this issue locally. Our developers will continue working on this problem and we will get back to you once we have any results.
Ok, thank you :-)
You are welcome! We are always glad to help you in case of any problems.