Bug 165492 - FILEOPEN DOCX: minimum/exact row heights need to add the bottom border padding
Summary: FILEOPEN DOCX: minimum/exact row heights need to add the bottom border padding
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:25.8.0
Keywords: filter:docx
Depends on: 165424
Blocks: DOCX-Tables
  Show dependency treegraph
 
Reported: 2025-02-27 14:29 UTC by Justin L
Modified: 2025-05-06 00:52 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
164907_exact_with_bottom_spacing.docx: example document (15.12 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-02-27 14:29 UTC, Justin L
Details
164907_exact_with_bottom_spacing_Word2019.pdf: how it looks in MS Word (33.42 KB, application/pdf)
2025-03-04 18:49 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2025-02-27 14:29:19 UTC
Created attachment 199508 [details]
164907_exact_with_bottom_spacing.docx: example document

In MS Word (I was testing 2010), if a row height is set to exactly 1cm, the row will actually be 2cm tall if there is 1cm of "cell bottom margin" (which is called border padding in LO). The same is true for "atLeast" heights.

Unbelievable. But you can see it for yourself if you:
1.) open 164907_exact_with_bottom_spacing.docx

Notice in MS Word that the tables are not the same height. However, in LO the two tables look identical.

Both tables have the row heights set to be exactly 2cm.
The table in the left column was changed to also have 1.5cm bottom margins,
while the table in the right column doesn't have any top or bottom margins.

Also notice that if you add a top margin, it doesn't affect the table/row size.

Related to bug 164907 (where atLeast also adds the border width).

Confirmed this was the case in OOo 3.3, and still is true in 25.8 master.
Comment 1 Justin L 2025-03-04 18:49:40 UTC
Created attachment 199606 [details]
164907_exact_with_bottom_spacing_Word2019.pdf: how it looks in MS Word
Comment 2 Justin L 2025-04-04 15:40:32 UTC
Apparently in my example document I have the table-column's rows specified as "atLeast" instead of "exact". In both cases the bottom padding needs to be added to the row height, but the document contents do not match the name. Sigh.
Comment 3 Justin L 2025-04-04 23:17:39 UTC
Yuck. This really depends on bug 165424 being handled first. Otherwise we run into

make CppunitTest_sw_layoutwriter4 \
    CPPUNIT_TEST_NAME=TestTdf164907_rowHeightAtLeast

Patches I made so far are
https://gerrit.libreoffice.org/c/core/+/183737 'atLeast'
https://gerrit.libreoffice.org/c/core/+/183739 'exact'
Comment 4 Commit Notification 2025-04-08 03:12:44 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3b92b1b0bcbd3f490bbd1d94bf4a9e6593540cdc

related tdf#165492 sw table layout: calc entire space before compare

It will be available in 25.8.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 5 Commit Notification 2025-04-08 03:13:47 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/057a9b7ac67ca178bbc5186ba73f3e45aa7ad04c

tdf#165492 sw mso layout: add bottom border padding to cell minHeight

It will be available in 25.8.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 2025-04-08 12:45:53 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/06114cd852c90468a950271de733f704d02b5f69

tdf#165492 sw mso layout: add bottom border padding to 'exact' height

It will be available in 25.8.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 7 Justin L 2025-04-08 12:47:58 UTC
Fixed. Note that these patches depend on bug 165424 to be complete.