Bug 106029 - Expand word space on lines with manual line breaks in justified paragraphs setting ignored when exporting to docx
Summary: Expand word space on lines with manual line breaks in justified paragraphs se...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.2.5.1 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.0.0 target:5.4.1 target:5.3.5
Keywords: needsDevAdvice
Depends on:
Blocks:
 
Reported: 2017-02-15 16:11 UTC by Matthew Kogan
Modified: 2017-07-11 07:41 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Document for try (4.80 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-02-16 11:08 UTC, Jacques Guilleron
Details
What I get with Word 2010 (15.63 KB, image/png)
2017-02-16 11:11 UTC, Jacques Guilleron
Details
The right file to try (4.88 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-02-16 15:32 UTC, Jacques Guilleron
Details
ODF reproducer (7.88 KB, application/vnd.oasis.opendocument.text)
2017-05-29 08:25 UTC, Miklos Vajna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Kogan 2017-02-15 16:11:15 UTC
Description:
The "Expand word space on lines with manual line breaks in justified paragraphs" setting in Tools, Options, LibreOffice Writer, Compatibility is treated as though it is always checked when exporting a document to docx format, i.e. the word space is always expanded. Export to doc format and pdf format honours the setting correctly.

Steps to Reproduce:
1. Set a paragraph to be justified;
2. Insert a line break (Shift-Enter) within the paragraph;
3. Go to Tools, Options, LibreOffice Writer, Compatibility and clear the checkbox labelled "Expand word space on lines with manual line breaks in justified paragraphs" and click OK;
4. Save a copy of the document to docx format;
5. Open the docx file (either in Word or in Writer).

Actual Results:  
The word space in the part of the paragraph before the line break is expanded.

Expected Results:
The word space in the part of the paragraph before the line break should not be expanded.


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0
Comment 1 Jacques Guilleron 2017-02-16 11:08:50 UTC
Created attachment 131269 [details]
Document for try
Comment 2 Jacques Guilleron 2017-02-16 11:11:03 UTC
Created attachment 131270 [details]
What I get with Word 2010
Comment 3 Jacques Guilleron 2017-02-16 11:11:52 UTC
Hi Matthew,

I don't reproduce with 
LO 5.2.5.1 Build ID: 0312e1a284a7d50ca85a365c316c7abbf20a4d22
CPU Threads: 2; OS Version: Windows 6.1; UI Render: default; 
Locale: en-US (fr_FR); Calc: CL
Spaces are not expanded.
Comment 4 Matthew Kogan 2017-02-16 12:01:53 UTC
Thank you, Jacques, but you have inserted a page break (Ctrl-Enter) instead of a line break (Shift-Enter).
Comment 5 Jacques Guilleron 2017-02-16 15:32:15 UTC
Created attachment 131279 [details]
The right file to try

Sorry Matthew,

It seems you have to set 'Use as Default', after uncheck 'Expand word space...', beneath the window, to get hte right behavior. Else, at each launching of LibreOffice, this setting will be checked again.
Comment 6 Matthew Kogan 2017-02-16 15:39:01 UTC
Jacques, the bug is visible in the file you just attached (assuming you cleared the checkbox in LibreOffice before saving as docx).
Comment 7 Jacques Guilleron 2017-02-16 17:57:26 UTC
Yes Matthew,

This is clearly visible.
Did you try : Tools > Options > LibreOffice Writer > Compatibility
Uncheck  
"Expand word space on lines with manual line breaks in justified paragraphs"
and click on "Use as Default".
After closing and launching of LibreOffice, there will be no more expand spacing.
There is a choice to do, but no bug for me.
Don't you think so?
Comment 8 Matthew Kogan 2017-02-17 10:33:16 UTC
You are half-right. If I change the default setting, then follow my procedure and open the docx file in Writer, the word space is not expanded. But if I open it in Word, the word space *is* expanded, and should not be.
Comment 9 Jacques Guilleron 2017-02-21 13:20:13 UTC
Hi Matthew,

Try to save the file to the .doc format. It works.

Have a nice day,

Jacques
Comment 10 Matthew Kogan 2017-02-21 13:22:53 UTC
It *is* a bug.
Comment 11 Matthew Kogan 2017-05-25 15:06:07 UTC
A proposed patch was committed on 12th April https://gerrit.libreoffice.org/#/c/36485/ but apparently it also requires a matching unit test. Could somebody have a look at this, please?
Comment 12 Miklos Vajna 2017-05-29 08:25:14 UTC
Created attachment 133688 [details]
ODF reproducer

Try the patch with this document. It should write the new element (in ODF, DoNotJustifyLinesWithManualBreak is true in settings.xml), but it does not.
Comment 13 Commit Notification 2017-07-04 09:30:38 UTC
nikki committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9ad9c5183f348384b62ec88459a3a5922e423d83

Fix tdf#106029 - Add setting XML_doNotExpandShiftReturn when exporting to docx

It will be available in 6.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Matthew Kogan 2017-07-05 10:12:33 UTC
I have tested the latest daily master build, Build ID: cc8390df26dad04a74425804dbd7ba068daca0c2, and it works correctly now. Could this fix be made available in 5.3.5?
Comment 15 Commit Notification 2017-07-10 09:27:02 UTC
nikki committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=44655d5e8311196ec309bec267eaebd9828ee273&h=libreoffice-5-4

Fix tdf#106029 - Add setting XML_doNotExpandShiftReturn when exporting to docx

It will be available in 5.4.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 16 Commit Notification 2017-07-10 14:08:53 UTC
nikki committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a59cf3ecab2f327801c2b580d20df9e8b643cc6c&h=libreoffice-5-3

Fix tdf#106029 - Add setting XML_doNotExpandShiftReturn when exporting to docx

It will be available in 5.3.5.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.