Bug 165424 - FILEOPEN DOCX: table row can have different border spacing than the entire table
Summary: FILEOPEN DOCX: table row can have different border spacing than the entire table
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: low minor
Assignee: Justin L
URL:
Whiteboard: target:25.8.0
Keywords: filter:docx
Depends on:
Blocks: DOCX-Tables 165492
  Show dependency treegraph
 
Reported: 2025-02-24 20:58 UTC by Justin L
Modified: 2025-04-08 12:11 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
forum-mso-de-130675D.docx: example document based on bug 164907 (21.60 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-02-24 20:58 UTC, Justin L
Details
forum-mso-de-130675D_Word2010.pdf: how MS Word 2010 sees it (177.43 KB, application/pdf)
2025-02-24 20:59 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-24 20:58:33 UTC
Created attachment 199431 [details]
forum-mso-de-130675D.docx: example document based on bug 164907

Although LibreOffice does seem to kind of have the ability to have individual rows with a different border spacing than other rows, we don't import DOCX files like that.

(Note that according to the UI, your change has been applied to every cell in the table, and pretty much any future UI change to the table will now apply the last border-spacing change to the entire table, so it isn't really a stable capability...)

Steps to reproduce (seen in OOo 3.3 and LO 25.8 master):
1.) open forum-mso-de-130675D.docx.

Notice that it takes up more than one page.

Notice that the text is centred in each row. Rows 2+ should be at the top of the cell - since there should be no border spacing.

Notice that all rows are the same height. Only the first row should be about 2.5cm tall. The rest should be 1.5cm based on the specified "at least 1.5cm" row height (since they shouldn't have 1cm top and bottom border spacing).

The table margins (and row overrides) are specified with
<w:tbl>
  <w:tblPr>
    <w:tblCellMar>
      <w:top w:w="568" w:type="dxa"/>
      <w:bottom w:w="568" w:type="dxa"/>
    </w:tblCellMar>
...
  <w:tr> // row 2
    <w:tblPrEx>
      <w:tblCellMar>
        <w:top w:w="0" w:type="dxa"/>
        <w:bottom w:w="0" w:type="dxa"/>
      </w:tblCellMar>
Comment 1 Justin L 2025-02-24 20:59:53 UTC
Created attachment 199432 [details]
forum-mso-de-130675D_Word2010.pdf: how MS Word 2010 sees it
Comment 2 Justin L 2025-04-05 01:30:50 UTC
bug 95033 implemented some pieces of tblPrEx.
The same probably needs to be done for tblCellMar.
Comment 3 Commit Notification 2025-04-08 03:17:51 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/879c30d6f3a4027b486f15ad0f554e5d0df87a84

tdf#165424 writerfilter: handle row's tblPrEx tblCellMar

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.