Page Borders Issue - Import DOC vs DOCX

Caolán McNamara caolanm at
Fri Jun 7 06:35:55 PDT 2013

On Thu, 2013-06-06 at 16:15 +0300, Adam Co wrote:
> This lead me to think that the import process is faulted, and that:
> ·         When importing from DOC – the (border+border margin) are deducted from the page margin
> ·         When importing from DOCX – this is not deducted
> This leads to the fact that when I export to DOCX than:
> ·         When the imported file was a DOC – the exported page margin is 1440    (110 + 1330)
> ·         When the imported file was a DOC – the exported page margin is 1550    (110 + 1440)
> I have located an interesting code piece in the DOC importer, that
> seems to deduct the '110 TWIPs' from the '1440' when importing,

So, yeah, you're probably right. IIRC when doing the .doc filter for
frames and graphics we found a lot of places where basically if there is
a thing of width/height of X and a border of Y, then writer would create
an element of size X and draw the border "inside" that space so the
whole artifact is of size X while word would put the border "outside"
that space giving an artifact of size X+Y. The page border issue is
probably very similar though I don't have any specific memory on hacking
on that part of the .doc filter.

> Simply adding the logic of SetFlyBordersShadow to the DOCX importer
> looks very complicated to me (requires implementing a lot of functions
> from ww8, not trivial for me).

Ideally these pieces of shared logic would be factored out into a shared
place where both the .doc and .docx filter could take advantage of them.


More information about the LibreOffice mailing list