Bug 31410 - Wrong paragraph spacing and line spacing when exported to DOCX
Summary: Wrong paragraph spacing and line spacing when exported to DOCX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
Hardware: All All
: medium normal
Assignee: Not Assigned
Depends on:
Reported: 2010-11-05 06:51 UTC by esperantisto
Modified: 2014-04-29 10:47 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:

Source ODT file (22.45 KB, application/vnd.oasis.opendocument.text)
2010-11-05 06:51 UTC, esperantisto
DOCX file (wrong paragraph/line spacing) (5.37 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2010-11-09 23:32 UTC, esperantisto
DOC file for comparison (no problem with para/line spacing) (14.50 KB, application/msword)
2010-11-09 23:33 UTC, esperantisto
sw patch (8.80 KB, patch)
2010-12-15 09:52 UTC, Luboš Luňák
DOCX file resulting from export from ODT using LibreOffice under openSUSE Linux 11.4 (5.88 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2012-07-30 18:21 UTC, esperantisto

Note You need to log in before you can comment on or make changes to this bug.
Description esperantisto 2010-11-05 06:51:59 UTC
Created attachment 40064 [details]
Source ODT file

When I export an ODT document to DOCX, in some cases the exported text has wrong (i.e. changed) paragraph spacing and line spacing. It looks like the Default style is affected (line spacing changed from single to 1.15 and a spacing of 10pt after paragraph is added), and so are styles that inherit the above attributes from Default. On the contrary, the styles, for which the attributes are set explicitly, seem to be intact.

This problem reproduces steadily. Just for reference, when exporting to DOC, no such problem emerges.

I attach three files: source ODT with Default and several custom styles, exported to DOCX, and exported to DOC (for comparison).

The styles Address_mid and Titul_end in the source document have both paragraph spacing and line spacing set explicitly, so they are exported fine. All other styles have wrong line and/or paragraph setting.
Comment 1 esperantisto 2010-11-05 06:53:32 UTC
Oops, I can’t find a way to add the other two attachments.
Comment 2 Cédric Bosdonnat 2010-11-09 03:53:26 UTC
you may handle that one...
Comment 3 esperantisto 2010-11-09 23:32:58 UTC
Created attachment 40172 [details]
DOCX file (wrong paragraph/line spacing)

Now, I see the option of adding extra attachments, so I attach a DOCX file and a DOC file.
Comment 4 esperantisto 2010-11-09 23:33:52 UTC
Created attachment 40173 [details]
DOC file for comparison (no problem with para/line spacing)
Comment 5 Luboš Luňák 2010-12-15 09:52:30 UTC
Created attachment 41147 [details]
sw patch

The document reveals a problem in export, where contents of w:spacing and w:pgMar are mixed up in one attribute list. This patch should fix it.
Comment 6 Luboš Luňák 2010-12-16 08:29:22 UTC
I've pushed the above patch, but I still cannot find what the different setting actually is.
Comment 7 Roman Eisele 2012-05-04 09:19:51 UTC
This is (primarily) a Writer issue, therefore changed 'Component' field
Comment 8 Michael Meeks 2012-05-08 06:43:44 UTC
llunak: no feedback from esperantisto - so, should we close the remainder of this ? :-)
Comment 9 esperantisto 2012-05-11 01:35:10 UTC
(In reply to comment #8)
> llunak: no feedback from esperantisto

Because I still see no change. At least not in LibO 7.
Comment 10 Michael Stahl (allotropia) 2012-07-05 05:54:08 UTC
Comment on attachment 41147 [details]
sw patch

this patch was pushed as 38fa10f549305365be14c98afcdfe0364f52de5d.
setting "obsolete" flag so it does not turn up in bugzilla searches.
Comment 11 Thorsten Behrens (allotropia) 2012-07-26 13:07:52 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > llunak: no feedback from esperantisto
> Because I still see no change. At least not in LibO 7.
Ok, please grab a 3.6.0 RC2 then from http://www.libreoffice.org/download/pre-releases/ and report your findings here. If the bug persists: please be specific on what you consider buggy, if necessary attach screenshots.
Comment 12 esperantisto 2012-07-30 18:21:44 UTC
Created attachment 64965 [details]
DOCX file resulting from export from ODT using LibreOffice under openSUSE Linux 11.4

Source ODT file same as in the initial bug report.
Comment 13 esperantisto 2012-07-30 18:23:35 UTC
Using LibO (build ID 815c576) under openSUSE Linux 11.4, still have the same problem: paragraphs (of Base style or any style base on it) with single line spacing become 1.15 line spacing when exported to DOCX. A resulting file attached, see above (the source file being the same as used in the initial bug report).
Comment 14 esperantisto 2012-07-30 18:24:56 UTC
Sorry, forgot to mention: the problematic paragraph spacing appears when opening the DOCX file in Microsoft Office Word 2007 under Crossover Linux / openSUSE Linux 11.4
Comment 15 esperantisto 2012-08-19 17:23:13 UTC
Just for the record: I see no change in LibO 3.6.0 final.
Comment 16 bfoman (inactive) 2013-05-16 10:37:51 UTC
This bug has not been touched by its owner for a long time. To make it clearer which bugs should be fixed by someone else please take following action:
- If you are the owner, and you are actively working on the bug, please give it an update. 
- If you are the owner, and you do not plan to work on it in the near future,
please reassign it to the default assignee and change its status to NEW.
Comment 17 Jorendc 2014-04-21 22:31:13 UTC
This bug looks fixed to me.

Tested using Mac OSX 10.9 with LibreOffice Version:
Build ID: 619b4c40da9e85febbb08a3f7cf8aa8d10963fc1
TinderBox: MacOSX-x86@49-TDF, Branch:master, Time: 2014-04-18_00:07:53

The exported .docx document looks 1-on-1 the same in Word as the original .odt in LibreOffice.

Kind regards,
Comment 18 esperantisto 2014-04-29 10:47:00 UTC
I confirm that the issue is gone, now the exported document looks fine (LO Linux 12.3).