eclipse-birt/birt

DOCX, the margin of dynamic text/data elements will be calculated doubled

Closed this issue · 1 comments

Currently the Word emitter of DOCX calculate the margin of dynamic text elements like "text, "dynamic text" and "data elements" doubled. All elements which will be handled like embedded HTML elements have this problem.

The reason of it is that the word emitter creates currently a layout grid to simulate the margin based on the element style.
At the same time the embedded HTML text create his own layout based on the same style of the HTML element
(internally called "foreign text").

The result is doubled calculated margin.

Example of the double calculation of the margin:

grafik

I will provide a PR for that issue.

The PR change the internal handling of the HTML-interpretation of the text elements.
The DOCX emitter wrap the foreign text into an HTML-data stream and embed this part as an MHT-archive on DOCX.
This part will be transformed from Word to standard Word-elements.
By default the MHT-style would include the same margin the which was rendered through the wrapper table.
The PR set the foreign-text margin (left & right) to "0px" and so the doubled spacing after & before will be avoid.

grafik