Bug 167229 - FILEOPEN DOCX Table formatting falls apart in specific document
Summary: FILEOPEN DOCX Table formatting falls apart in specific document
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.0.3 release
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:26.2.0 target:25.8.0.2
Keywords: bibisected, bisected, regression
Depends on:
Blocks: DOCX-Floatingtable
  Show dependency treegraph
 
Reported: 2025-06-26 07:51 UTC by Gabor Kelemen (allotropia)
Modified: 2025-07-16 16:10 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Word 2013 (29.36 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-06-26 07:51 UTC, Gabor Kelemen (allotropia)
Details
The document in Word 2013 and Writer master side by side (79.68 KB, image/png)
2025-06-26 07:51 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2025-06-26 07:51:27 UTC
Created attachment 201488 [details]
Example file from Word 2013

Attached user-made and minimized document has three tables that have table style applied to them.
Upon opening in Writer, the formatting of the last table falls apart.

1. Open attached document
-> last table has wrong column widths and row style, compared to Word

Seems to have started in 7.6 with

https://cgit.freedesktop.org/libreoffice/core/commit/?id=ce3308a926f036b87515b8cd97d2b197063dc77a

author	Miklos Vajna <vmiklos@collabora.com>	2023-04-12 08:13:07 +0200
committer	Miklos Vajna <vmiklos@collabora.com>	2023-04-12 09:12:17 +0200
commit ce3308a926f036b87515b8cd97d2b197063dc77a (patch)

tdf#61594 sw floattable: import floating tables as split flys by default

Note that a lot of small details are necessary to get this wrong, if I change something in Word and save, then it looks good.
- the tracked change in the first table is necessary to keep
- the second table is necessary
- the Header 1 style paragraph at the end
Comment 1 Gabor Kelemen (allotropia) 2025-06-26 07:51:45 UTC
Created attachment 201489 [details]
The document in Word 2013 and Writer master side by side
Comment 2 Timur 2025-07-03 12:00:16 UTC
Yes. Just regression commit does not seem enabling the feature but earlier one which spoiled the table: 

commit d477fa8ac1b0d3ee81427217bbb5950278ab16db	[log]
author	Miklos Vajna <vmiklos@collabora.com>	Fri Mar 17 14:00:17 2023 +0100
committer	Miklos Vajna <vmiklos@collabora.com>	Fri Mar 17 14:10:34 2023 +0000
sw floattable: unconditionally map <w:tblpPr> to SwFormatFlySplit

CppunitTest_sw_ooxmlexport8's testN816593 failed in the
SW_FORCE_FLY_SPLIT=1 case because the re-import of the document merged
two tables into one.

The problem starts earlier, we didn't import the table with a <w:tblpPr>
as a floating table, but we should.

Then there was an improvement to current status:
commit 9a9ee21ec237eda5df6ea70bfa3bec07b44b4d21	[log]
author	Miklos Vajna <vmiklos@collabora.com>	Fri Mar 17 15:14:37 2023 +0100
committer	Miklos Vajna <vmiklos@collabora.com>	Fri Mar 17 19:24:40 2023 +0000
sw floattable: fix redline import from DOCX
Comment 3 Commit Notification 2025-07-08 13:01:13 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f124b25380a8ae9f5bbae7ca04772124a6572926

tdf#167229 sw floattable: fix missing cell background with redlines

It will be available in 26.2.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 4 Commit Notification 2025-07-08 14:44:29 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/5e1b3f3286d46421de83ec54a1f563ac82f1a76c

tdf#167229 sw floattable: fix missing cell background with redlines

It will be available in 25.8.0.2.

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.