Page 1 of 1

Binding loses formatting on text inside content controls

PostPosted: Wed Dec 04, 2013 9:39 pm
by skiwi
Text formatting (font type, font size, colors, ...) gets lost when I try to bind an XML with a docx with content controls that contain text with formatting.

I have modified the sample ContentControlsMergeXML a little to illustrate the issue.

The binding method is called with FLAG_NONE to make sure that the controls are removed in the output document:
Code: Select all
Docx4J.bind(wordMLPackage, xmlStream, Docx4J.FLAG_NONE);


The attachment "binding-simple.docx" is the original document, the attachment "OUT_ContentControlsMergeXML.docx" is the result after binding.
As you can see formatting is still there on text without control, while formatting is reset to default on the text that was replaced by the XML binding.

Any suggestion on how this could be solved? I have searched the forum but couldn't find any posts that helped me solve the issue.

(I am using the latest docx4j-3.0.0.jar)

Re: Binding loses formatting on text inside content controls

PostPosted: Mon Dec 09, 2013 9:16 pm
by skiwi

Re: Binding loses formatting on text inside content controls

PostPosted: Tue Dec 10, 2013 6:48 pm
by skiwi
The fix https://github.com/plutext/docx4j/commi ... 725b7e691a resolved the issue, thanks!

:D