Description: Word interprets space above/below differently to Writer, so paragraph spacing looks different after saving to docx and opening in Word. Steps to Reproduce: 1. In Writer, add 3 paragraphs of text and set their space above and below to 1cm. 2. Save as docx. 3. Open docx file in Word. Actual Results: The paragraphs have 1cm between them. Expected Results: The paragraphs should have 2cm between them, as they do in Writer. Reproducible: Always User Profile Reset: No Additional Info: It should compensate for the different interpretation so that it looks the same in Word.
Created attachment 176311 [details] test.odt
Created attachment 176312 [details] test.docx (saved from test.odt)
Created attachment 176313 [details] side-by-side comparison in Writer You even do not need to open that docx in Word. Open that in Writer already shows indirect paragraph spacing. Confirmed in Version: 7.3.0.0.alpha1+ / LibreOffice Community Build ID: 35d9d085436e159bdeb6cba9c94865d6346af530 CPU threads: 8; OS: Linux 5.14; UI render: default; VCL: gtk3 Locale: zh-CN (zh_CN.UTF-8); UI: zh-CN Calc: threaded Fedora 34. Set to NEW.
Also reproducible in Version: 6.0.0.0.alpha1+ Build ID: 6eeac3539ea4cac32d126c5e24141f262eb5a4d9 CPU threads: 8; OS: Linux 5.14; UI render: default; VCL: gtk3; Locale: zh-CN (zh_CN.UTF-8); Calc: group threaded
*** Bug 146983 has been marked as a duplicate of this bug. ***
repro 7.6+ Also repro that when saving to .doc format, the gap is 2cm. repro that MS Word 2010 looks identical for both doc and docx. While I can sympathize with the desire that ODT should massage the data to export pixel perfect into DOCX format, the reality will be very different in cases where there are compatibility flags, especially when DOC is different. The solution is easy - fix the layout once after switching formats and move on.
Created attachment 191325 [details] The example file saved as doc format in Writer and the original odt So I did a bit of research into this, and looks like the doc export actually looks the same in Writer as the odt one.
Created attachment 191326 [details] The doc and docx versions in Word, plus the doc converted to docx The doc version also looks good in Word (somehow my Word 2016 hides the last paragraph, but 2010 does not - odd), and this good look stays if I convert it to docx with Word.
Created attachment 191327 [details] Layout options of the doc version in Word Curiously the doc version has several layout options enabled according to Word, while the docx version has none.
Created attachment 191328 [details] The docx version in Word after enabling the HTML paragraph auto spacing thingy And a bit of experimenting resulted in this: the "Don't use HTML paragraph auto spacing" option (whatever this means) is the key to preserving the numbered paragraphs spacing in MSO formats. So we need to automatically add the compat option: <w:doNotUseHTMLParagraphAutoSpacing/> Interestingly saving the example file in RTF format also keeps the layout both in Writer and Word. Looking into the specification there is the \htmautsp keyword to Use HTML paragraph auto spacing which is missing from the export - perhaps a lucky coincidence.
(In reply to Gabor Kelemen (allotropia) from comment #8) > somehow my Word 2016 hides the last paragraph, but 2010 does not - odd) That's bug 108772
Thank you - I can confirm that setting this compat option does fix it for me too. Here's the documentation for it: https://learn.microsoft.com/en-us/dotnet/api/documentformat.openxml.wordprocessing.donotusehtmlparagraphautospacing?view=openxml-2.8.1 I'd be delighted if you could implement this.