Bug 153136

Summary: Lines with spaces have wrong height in DOCX
Product: LibreOffice Reporter: Mike Kaganski <mikekaganski>
Component: WriterAssignee: Mike Kaganski <mikekaganski>
Status: RESOLVED FIXED    
Severity: normal CC: timur
Priority: medium Keywords: filter:docx
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=153128
https://bz.apache.org/ooo/show_bug.cgi?id=3952
https://bugs.documentfoundation.org/show_bug.cgi?id=153138
https://bugs.documentfoundation.org/show_bug.cgi?id=152841
Whiteboard: target:7.6.0 target:7.5.1
Crash report or crash signature: Regression By:
Attachments: Large space characters
Large space characters
Word (left) vs. Writer (right): page 1
Word (left) vs. Writer (right): page 2
Word (left) vs. Writer (right): page 3

Description Mike Kaganski 2023-01-21 07:12:28 UTC
Created attachment 184813 [details]
Large space characters

The attachment has three pages, each of them listing the Unicode characters from 'Separator, Space' category [Zs]. The first page uses normal paragraphs, the second and the third have tables with them. The space characters are formatted with text size 48, while labels have size 12.

In Word, some paragraphs on the first and the second pages have resulting height corresponding to text size 12, ignoring the height of space characters on them. These lines are marked red. On the third page, all table rows have automatic heights corresponding to text size 48.

This is related to the IgnoreTabsAndBlanksForLineCalculation compat flag.
Comment 1 Mike Kaganski 2023-01-21 08:22:28 UTC
Created attachment 184814 [details]
Large space characters

A better sample with line shading
Comment 2 Mike Kaganski 2023-01-21 08:38:33 UTC
Created attachment 184815 [details]
Word (left) vs. Writer (right): page 1

On page 1:

Word has small line heights for:   U+0020, U+2002, U+2003, U+2005, and U+3000.
Writer has small line heights for: U+0020, U+2006, and U+3000.
Comment 3 Mike Kaganski 2023-01-21 08:40:31 UTC
Created attachment 184816 [details]
Word (left) vs. Writer (right): page 2

On page 2:

Word has small line heights for:   U+0020, U+2002, U+2003, U+2005, and U+3000.
Writer has small line heights for: U+0020, U+2006, and U+3000.

This is the same as on page 1, so in this case, table cells behave as simple paragraphs.
Comment 4 Mike Kaganski 2023-01-21 08:41:33 UTC
Created attachment 184817 [details]
Word (left) vs. Writer (right): page 3

On page 3:

Word has all cells' heights large.
Writer has small line heights for: U+0020, U+2006, and U+3000.
Comment 5 Commit Notification 2023-01-23 16:57:01 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/23555ec4058521262860d48d976eba8563d9ba98

tdf#153136: fix IgnoreTabsAndBlanksForLineCalculation compat flag

It will be available in 7.6.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2023-01-24 11:48:06 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/5609e09b1a145da28d74e3c5929be7efdc1a301c

tdf#153136: fix IgnoreTabsAndBlanksForLineCalculation compat flag

It will be available in 7.5.1.

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

Affected users are encouraged to test the fix and report feedback.
Comment 7 Timur 2023-09-15 14:18:32 UTC
I guess we can close this. Thanks Mike.