[Libreoffice-bugs] [Bug 122103] EDITING Image disappears from docx file when deleting subsequent empty paragraph

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Fri Dec 14 14:41:43 UTC 2018


https://bugs.documentfoundation.org/show_bug.cgi?id=122103

--- Comment #5 from NISZ LibreOffice Team <libreoffice at nisz.hu> ---
Some additional details we discovered regarding the issue:
– The anchoring of the image changes from “To Paragraph” to “To Character”.
– Opening the same DOCX file in Microsoft Word shows the horizontal anchoring
as “To Column”.
– The word/document.xml describes the anchoring of the image as follows:
<wp:positionH
relativeFrom="column"><wp:align>center</wp:align></wp:positionH><wp:positionV
relativeFrom="paragraph">

This is why the image disappears when we delete the paragraph because it is
anchored to the “end of paragraph” character: deleting the anchor also deletes
the image, which makes totally sense – the real issue is that the image was
originally anchored to the paragraph, and not the character. If we change back
the anchoring of the image from “To Character” to “To Paragraph” it behaves
exactly like the original ODS when the paragraph is deleted: the image is
retained and the anchor moves up one paragraph.

So the root cause for this whole issue is that Word and Writer handle the
anchoring of images differently:
– Microsoft Word has separate anchors for the horizontal and vertical
alignment, while LibreOffice Writer has the same one for both.
– In Microsoft Word there are a few options for horizontal alignment (including
Page, Margins, Character and Column) but Paragraph isn't among them.
– Anchoring to Column is not supported in LibreOffice Writer.

So, when a document with an image anchored to Paragraph is saved LibreOffice
Writer as DOCX and the reopened again, the following happens:
1. The “To Paragraph” anchoring is interpreted as “Horizontal: to Column”,
“Vertical: to Paragraph” when saved as DOCX.
2. When the same document is re-opened again, the anchoring is interpreted as
“To Character” because “To Column” alignment doesn't exist is LibreOffice
Writer.

A possible solution could be that if we see an image that is anchored to column
vertically, and anchored to paragraph horizontally we interpret it as anchored
to paragraph when importing a DOCX document – but there might be a reason why
LibreOffice doesn't work like this right now, so we must beware of possible
regressions.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20181214/b6e5fbcd/attachment-0001.html>


More information about the Libreoffice-bugs mailing list