Bug 156351 - border error when docx floating table breaks to two pages because of caption above
Summary: border error when docx floating table breaks to two pages because of caption ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:24.2.0 target:7.6.1
Keywords:
Depends on:
Blocks: Table-Borders DOCX-Floatingtable
  Show dependency treegraph
 
Reported: 2023-07-18 11:53 UTC by Regina Henschel
Modified: 2023-11-08 14:34 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
floating table on one page (22.41 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-07-18 11:53 UTC, Regina Henschel
Details
Split floating table in Word: top and bottom borders are rendered. (18.08 KB, image/png)
2023-07-18 12:58 UTC, Miklos Vajna
Details
Split floating table in Writer: top and bottom borders are rendered. (94.49 KB, image/png)
2023-07-18 12:59 UTC, Miklos Vajna
Details
Split floating table in Writer (2 additional paragraphs): bottom border is not rendered. (93.89 KB, image/png)
2023-07-18 12:59 UTC, Miklos Vajna
Details
Sample document that reproduces the bad border problem on load. (14.95 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-08-03 07:13 UTC, Miklos Vajna
Details
comparison office.com vs LO 24.2 alpha0+ (197.04 KB, image/png)
2023-08-03 15:19 UTC, Stéphane Guillou (stragu)
Details
Word 2021 desktop rendering (33.62 KB, image/png)
2023-08-04 06:28 UTC, Miklos Vajna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2023-07-18 11:53:59 UTC
Created attachment 188433 [details]
floating table on one page

Open attached document. It has a floating table on one page.
Set cursor into table. From context menu call Insert Caption.
Add the caption "Numbers English-German" with location "above".

The table shifts down and breaks to the second page. The part on the second page has a border on top. But there should be no border because it is not a new table but continues the table from the first page.

I tested it with Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: fcbae818b793a9ee97a1b5ddc53902be7a2376f5
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: default; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 1 Miklos Vajna 2023-07-18 12:58:26 UTC
See bug 156349 for the general question if we want captions for floating tables in the first place.

But then we can put that aside, you can of course create a multi-page floating table in a different way as well, for example go to the end of the B1 cell and press enter. This is definitely a document model we want to handle for rendering and saving. Writer currently draws a full border around the tables on both pages, and this matches Word. I think it would be wise to keep the compatibility and not introduce a new, own way.

Now that's more interesting to me that Writer sometimes does omit the rendering of the border. If I press one more enter in B1, then the bottom border on page 1 is missing. I would consider *that* a bug, in case in other cases both the top and bottom border is rendered.

Will attach screenshots.
Comment 2 Miklos Vajna 2023-07-18 12:58:58 UTC
Created attachment 188437 [details]
Split floating table in Word: top and bottom borders are rendered.
Comment 3 Miklos Vajna 2023-07-18 12:59:15 UTC
Created attachment 188438 [details]
Split floating table in Writer: top and bottom borders are rendered.
Comment 4 Miklos Vajna 2023-07-18 12:59:46 UTC
Created attachment 188439 [details]
Split floating table in Writer (2 additional paragraphs): bottom border is not rendered.
Comment 5 ysui2022 2023-07-20 04:39:32 UTC
I didn't reproduce the bug successfully. After I inserted the caption, the table moved down slightly. It was a little bit out of the border of the first page but still on the first page. It didn't go to the second page.
Version: 7.5.4.2 (X86_64) / LibreOffice Community
Build ID: 36ccfdc35048b057fd9854c757a8b67ec53977b6
CPU threads: 8; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 6 Miklos Vajna 2023-08-03 07:13:13 UTC
Created attachment 188736 [details]
Sample document that reproduces the bad border problem on load.

I attach a slightly changed document that shows the border problem on load. The page 1 part of the table has no bottom border in Writer, but the page 2 part of the table has a top border, which is inconsistent.

Word has both a bottom and a top border in this case.
Comment 7 Stéphane Guillou (stragu) 2023-08-03 15:19:51 UTC
Created attachment 188748 [details]
comparison office.com vs LO 24.2 alpha0+

Confirmed with recent master build:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: eef0c5d4d45ba35acfb6d8f7551fe565ca4badaa
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 8 Miklos Vajna 2023-08-04 06:28:09 UTC
Created attachment 188760 [details]
Word 2021 desktop rendering

Argh, once again office.com and desktop Word rendering differs... I assume at least as first cut desktop LO should be compatible with desktop Word, i.e. what's wanted is borders around both tables.

This would be also compatible with other existing Writer use-cases, e.g. how Writer handles table borders when two linked text frame splits a table.
Comment 9 Commit Notification 2023-08-18 12:53:22 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/53798fef2cc0b5b0b9706081a4af5ceca964a41b

Related: tdf#156351 sw floattable: fix missing top border in follow table

It will be available in 24.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 10 Miklos Vajna 2023-08-18 13:57:47 UTC
This just fixes the related top border problem in the second table, the bottom border needs more work in the first table.
Comment 11 Commit Notification 2023-08-21 07:36:41 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/08aea5526c75ff4c5385e960bd940f10ffa19cd5

tdf#156351 sw floattable: fix missing bottom border in master table

It will be available in 24.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 12 Miklos Vajna 2023-08-21 07:54:14 UTC
The border looks OK now, I think (the first commit has a test file, you can also manually compare how Word and Writer renders it).
Comment 13 Commit Notification 2023-08-22 08:35:35 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/99a817c3f41a115e53a95ada33f0611b2572725b

Related: tdf#156351 sw floattable: fix missing top border in follow table

It will be available in 7.6.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 14 Commit Notification 2023-08-22 19:00:38 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

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

tdf#156351 sw floattable: fix missing bottom border in master table

It will be available in 7.6.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.