Completed
Last Updated: 31 Oct 2018 07:53 by ADMIN
ADMIN
Mihail
Created on: 26 Oct 2016 11:35
Category: RichTextBox
Type: Bug Report
4
RichTextBox: Exception during layout of a document with floating image as first element on the second page
NullReferenceException is thrown when measuring a document with floating image as the first element on a second page. The same problem can be observed during copy/paste of content, but with slightly different call stack: 

System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Windows.Documents.Layout.LayoutBox.get_ValidParent()
   at Telerik.Windows.Documents.DocumentPosition.GetCurrentParagraphBox()
   at Telerik.Windows.Controls.RichTextBoxUI.RadRichTextBoxRulerController.GetCurrentParagraphBox()
   at Telerik.Windows.Controls.RichTextBoxUI.RadRichTextBoxRulerController.AssociatedRichTextBox_LayoutUpdated(Object sender, EventArgs e)

Depending on the document structure, an InvalidOperationException with message "Removed LayoutBox should not be split. Such operation will result in invalid document structure." could be also thrown. A sample call stack is:

Telerik.Windows.Documents.Layout.LayoutBox.CreateNewFragment(Telerik.Windows.Documents.Layout.LayoutBox currentLineStartNode) 
Telerik.Windows.Documents.Layout.TableCellLayoutBox.MeasureOverrideInternal(Telerik.Windows.Documents.Model.SizeF availableSize) 
Telerik.Windows.Documents.Layout.TableCellLayoutBox.Telerik.Windows.Documents.Model.IBlockContainerLayoutBox.CallMeasureOverrideInternal(Telerik.Windows.Documents.Model.SizeF availableSize) 
Telerik.Windows.Documents.Layout.BlockContainerLayoutHelper.CheckAllFloatingBlocksAreIncluded(Telerik.Windows.Documents.Model.SizeF availableSize) 

Fix available in LIB Version 2018.1.312.
0 comments