Completed
Last Updated: 20 May 2021 10:27 by ADMIN
Release LIB 2021.2.525 (25/05/2021)
Daniel
Created on: 17 May 2021 10:56
Category: RichTextBox
Type: Bug Report
0
RichTextBox: DocxFormatProvider: InvalidOperationException when saving a document with track changes and a table pasted from MS Word as the first document element

The pasted content is not formatted properly, resulting in an InvalidOperationException("'Token EndElement in state EndRootElement would result in an invalid XML document. Make sure that the ConformanceLevel setting is set to ConformanceLevel.Fragment or ConformanceLevel.Auto if you want to write an XML fragment. ') when saving the content to DOCX.

Steps to reproduce:

  • Create a document
  • Activate Review/Change Tracking
  • Create a table in a separate MS Word file and add some text at least in the first cell
  • Copy from MS Word and paste it as the first element in the document
  • Save the document as an MS Word document

Workaround: intercept the table paste and add an empty paragraph as the first element of the document before the table.

Another case:

  • Create a new document
  • Be sure that Change Tracking is deactivated
  • Create a table in a separate MS Word file and add some text at least in the first cell
  • Copy from MS Word and paste it as the first element in the document
  • Activate Review/Change Tracking
  • Just after the first table, paste the table again: the second table seems to be merged with the first table, with no paragraph in between, but with the vertical line in the margin showing that the second table has change tracking
  • Save the document as a MS Word document
0 comments