Bug 116358 - Writer doesn't keep a table row with the next in RTF documents
Summary: Writer doesn't keep a table row with the next in RTF documents
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Vasily Melenchuk (CIB)
URL:
Whiteboard: target:7.4.0 target:7.3.3
Keywords: filter:rtf
Depends on:
Blocks: RTF-Tables
  Show dependency treegraph
 
Reported: 2018-03-12 09:43 UTC by dferrari79
Modified: 2022-04-19 18:01 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dferrari79 2018-03-12 09:43:32 UTC
Description:
When opening an RTF file with a table row that has the \keepn control word in the related paragraph, the row is not kept with the following row nor paragraph.

Steps to Reproduce:
1) Create a new Writer document
2) type "a" and then return
3) add a 1x2 table
4) below the table, type "b"
5) right click on the first row of the table, select "Table properties"-"Text flow" and click "Keep with next paragraph"
6) save as RTF
7) set the cursor right after the "a" and start entering returns, till a page break occurs. The two rows and the "b" are kept togheter
8) close the document without saving and reopen it
9) repeat step 7) and you'll notice that the two rows and the b are not kept togheter
10) open the saved RTF with MS Word and repeat step 7) and you'll notice that the two rows and the "b" are kept togheter

Actual Results:  
the table row is not kept with the following row nor paragraph.

Expected Results:
the table row should be kept with the following row or paragraph.


Reproducible: Always


User Profile Reset: No



Additional Info:
Writer adds the \keepn control word to a paragraph if you do one of the following actions: 
check "Keep with next paragraph" in "Paragraph - Text flow" Tab.
uncheck "Allow table to split across pages and columns" in "Table properties - Text flow".
check "Keep with next paragraph" in "Table properties - Text flow".
MS Word 2016 allows you to control the text flow only in the paragraph properties, not in the table properties, but if the paragraph is in a table, then \keepn keeps the row with the followig item, either if it's a row or a paragraph. 
To be noticed that, based on RTF specifications, there's the control word \trkeepfollow specific for tables that in my opinion is better than using \keepn for a paragraph in a table row, but MS Word itself seems to ignore the existence of this control word (and so does Writer).


User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36
Comment 1 Jacques Guilleron 2018-03-12 15:56:26 UTC
Hi dferrari79,

I reproduce with
LO 6.0.2.1 Build ID: f7f06a8f319e4b62f9bc5095aa112a65d2f3ac89
Threads CPU : 2; OS : Windows 6.1; UI Render : par défaut; 
Locale : fr-FR (fr_FR); Calc: CL
Thank you to have reported it.
Comment 2 Martin Srdoš 2020-12-29 09:19:46 UTC
More easy way how to reproduce this is:
1) set the text as "Keep with next paragraph" as is described in step 5 in the Decription
2) save as rtf
3) reopen the document. The checkbox of "Keep with next paragraph" setting is not selected.

In odt format it is still selected.

Reproducible in:
Version: 7.0.4.2 (x64)
Build ID: dcf040e67528d9187c66b2379df5ea4407429775
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: cs-CZ (cs_CZ); UI: en-US
Calc: threaded

Also in
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 3 Commit Notification 2022-03-31 06:36:26 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "master":

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

tdf#116358: rtf import: "keep with next" also affects table rows

It will be available in 7.4.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 Vasily Melenchuk (CIB) 2022-03-31 07:22:09 UTC
(In reply to Martin Srdoš from comment #2)
> More easy way how to reproduce this is:
> 1) set the text as "Keep with next paragraph" as is described in step 5 in
> the Decription
> 2) save as rtf
> 3) reopen the document. The checkbox of "Keep with next paragraph" setting
> is not selected.

This is still the problem for RTF and DOCX: "keep with next paragraph" attribute is not set for tables. As far as I see, there is no such property in these formats.
Comment 5 Commit Notification 2022-04-01 06:39:25 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/4ef50c9ac03960c694c50e5a7488693422503357

tdf#116358: rtf import: "keep with next" also affects table rows

It will be available in 7.3.3.

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 Martin Srdoš 2022-04-19 18:01:54 UTC
I can commit that it is fixed. It works on daily build available today:
Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: efb39149be1744def96ef015d1d184b5af3f43b7
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Vulkan; VCL: win
Locale: cs-CZ (cs_CZ); UI: cs-CZ
Calc: CL

I'am changing status to VERIFIED FIXED