Completed
Last Updated: 24 Sep 2018 13:53 by ADMIN
ADMIN
Boby
Created on: 20 Sep 2018 13:17
Category: RichTextBox
Type: Bug Report
0
RichTextBox: ArgumentException when importing RTF documents in multiple threads
When RTF documents are imported simultaneously in different threads, sometimes ArgumentException with message "An item with the same key has already been added" is thrown with the following call stack:

at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at Telerik.Windows.Documents.FormatProviders.ReplaceStyleNameHandler.Add(String displayName, String name)
   at Telerik.Windows.Documents.FormatProviders.ReplaceStyleNameHandler.InitializeStyleDisplayNameToStyleNameDictionary()
   at Telerik.Windows.Documents.FormatProviders.ReplaceStyleNameHandler.get_StyleDisplayNameToStyleName()
   at Telerik.Windows.Documents.FormatProviders.ReplaceStyleNameHandler.TryGetStyleNamesByStyleName(String displayName, RadDocumentDefaultStyleInfo& defaultStyleInfo)
   at Telerik.Windows.Documents.FormatProviders.ReplaceStyleNameHandler.Replace(ReplaceStyleNameContext context)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Import.RtfStyleImporter.DoVisitText(RtfText text)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Import.RtfElementIteratorBase.VisitElement(RtfElement element, Boolean recursive)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Import.RtfElementIteratorBase.VisitGroupChildren(RtfGroup group, Boolean recursive)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Import.RtfStyleImporter.ImportStyleGroup(RtfGroup group)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Import.RtfStylesTable.FillStyle(RtfGroup group, StyleType type, Boolean isDefault)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Import.RtfStylesTable.DoVisitGroup(RtfGroup group)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Import.RtfElementIteratorBase.VisitElement(RtfElement element, Boolean recursive)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Import.RtfElementIteratorBase.VisitGroupChildren(RtfGroup group, Boolean recursive)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Import.RtfStylesTable.ReadTable(RtfGroup group, RtfImportContext context)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Import.RtfHandlers.RtfGroupHandlers.StylesTableHandler(RtfGroup group, RtfImportContext context)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Import.RtfDocumentImporter.DoVisitGroup(RtfGroup group)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Import.RtfElementIteratorBase.VisitElement(RtfElement element, Boolean recursive)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Import.RtfElementIteratorBase.VisitGroupChildren(RtfGroup group, Boolean recursive)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Import.RtfDocumentImporter.ImportRoot(RtfGroup rtfGroup)
   at Telerik.Windows.Documents.FormatProviders.Rtf.Import.RtfDocumentImporter.Import(Stream input, RtfImportSettings settings)
   at Telerik.Windows.Documents.FormatProviders.Rtf.RtfFormatProvider.Import(Stream input)
   at Telerik.Windows.Documents.FormatProviders.Rtf.RtfFormatProvider.Import(String input)

Fix available in LIB Version 2018.3.924.
0 comments