Download it now!
Bug 119908 - FILEOPEN: DOCX: Layout differences with justified paragraph in modern, non-compatibility mode .docx
Summary: FILEOPEN: DOCX: Layout differences with justified paragraph in modern, non-co...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: compatibilityMode15
Keywords: filter:docx
Depends on:
Blocks: DOCX-Paragraph DOCX-compatibilityMode-15
  Show dependency treegraph
 
Reported: 2018-09-16 18:23 UTC by Luke
Modified: 2020-08-04 10:48 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Native 2016 **without** compatibiliy mode (16.31 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-09-16 18:23 UTC, Luke
Details
Word vs Writer. (146.91 KB, image/png)
2018-09-16 18:26 UTC, Luke
Details
When compatibily mode is forced, Writer and Word are identical (16.26 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-09-16 18:27 UTC, Luke
Details
[MS-DOC]: format correctly imported (28.00 KB, application/msword)
2018-09-16 18:28 UTC, Luke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke 2018-09-16 18:23:30 UTC
Created attachment 144915 [details]
Native 2016 **without** compatibiliy mode

When opening .doc files or .docx files that were created in pre-2007 versions, Word uses 'compatibility mode'. We appear to be using compatibility mode by default for documents that were created Word 2010+ without this option enabled.

Steps to reproduce:
1. Open August12.docx in Word
2. Open in Writer
3. Note the line spacing layout issues
Comment 1 Luke 2018-09-16 18:26:05 UTC
Created attachment 144916 [details]
Word vs Writer.

Note writer incorrectly imports the documents, taking up 2 pages instead of 1.
Comment 2 Luke 2018-09-16 18:27:04 UTC
Created attachment 144917 [details]
When compatibily mode is forced, Writer and Word are identical
Comment 3 Luke 2018-09-16 18:28:15 UTC
Created attachment 144918 [details]
[MS-DOC]: format correctly imported
Comment 4 Aron Budea 2018-09-16 20:45:56 UTC
Confirmed using LO 6.1.1.2 / Windows 7.
To be precise, in Word the DOCX and DOC look different, and in Writer they look the same (and as the DOC in Word). The difference is that the paragraph that takes 4 lines in one case takes 5 lines in the other.

When comparing the DOCX and DOC in Word, the difference comes from different character layout/spacing. In fact, it only occurs if the text is justified, not with other kinds of alignments.
Comment 5 QA Administrators 2019-09-17 02:47:41 UTC Comment hidden (obsolete, spam)
Comment 6 Justin L 2020-07-10 08:53:17 UTC
(In reply to Aron Budea from comment #4)
>The difference is that the paragraph
> that takes 4 lines in one case takes 5 lines in the other.
There are two places where this happens (in Word 2016). The other is the line that starts with "Coffee Morning" which only takes one line in 2016, compared to 2 lines in old Word 2003.

Confirmed that changing word/settings.xml compatibilityMode to 12 is all that is necessary to have Word 2016 treat it the same as Writer handles it.

Like Aron says - nothing really special about these paragraphs...
<w:pPr>
  <w:widowControl w:val="0"/>
  <w:jc w:val="both"/>
  <w:rPr>
    <w:rFonts w:eastAsia="MS Mincho"/>
    <w:sz w:val="20"/>
    <w:szCs w:val="20"/>
    <w:lang w:val="en-US"/>
  </w:rPr>
</w:pPr>
Comment 7 Justin L 2020-08-04 09:55:26 UTC
(In reply to Luke from comment #0)
> When opening .doc files or .docx files that were created in pre-2007
> versions, Word uses 'compatibility mode'. We appear to be using
> compatibility mode by default for documents that were created Word 2010+

I don't think this statement is quite true. Word uses compatibility mode for any document that has an older version than it does.
August12.docx has the setting compatibilityMode = 15. (native for Word 2013-2019)

I changed that mode to 14 (native version of Word 2010) and then Word 2016 acted like LO. So this should be a change starting in Word 2013, and not starting in Word 2010 as implied.

This really looks like a Microsoft bug to me.  How can shifting to full justification reduce the amount of space needed for your text? But yeah, I tried typing a sentence in a new Word 2016 document. If it is only one or two characters spilling over to the next line, then full justification must be SHRINKING something and so the entire paragraph now fits on one line instead of two in non-justified mode.
Comment 8 Justin L 2020-08-04 10:46:00 UTC
Ahh, "intelligent spacing" is probably to blame here. See bug 71732, which would result in these kinds of "random" layouts. Perhaps nice on the eyes, but impossible for exact reproducibility.

I'm tempted to mark this as a duplicate of that bug, but apparently Word has been doing this for longer than 2013. Google's instructions to turn on "justify like WordPerfect 6" only work for Word 2007 or Word 2010. So, it looks like in 2013 they have implemented their own algorithm and enabled it by default.

https://answers.microsoft.com/en-us/office/forum/office_2013_release-word/wordperfect-justification-style-no-longer/d341fcca-c1b1-462b-a9a4-0c89a1489184
Comment 9 Justin L 2020-08-04 10:48:26 UTC
(In reply to Justin L from comment #8)
> Ahh, "intelligent spacing" is probably to blame here. 
Oops. That should be bug 38159