Bug 152839

Summary: FILEOPEN RTF Border lines appear incorrectly in table
Product: LibreOffice Reporter: Gabor Kelemen (allotropia) <kelemeng>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: raal, vasily.melenchuk
Priority: medium    
Version: Inherited From OOo   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=148560
https://bugs.documentfoundation.org/show_bug.cgi?id=44986
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 112765    
Attachments: Example file from Word 2016
The example file in Word 2016 and Writer
Same file as docx, for reference
Minimized RTF sample
Updated example file

Description Gabor Kelemen (allotropia) 2023-01-02 14:11:50 UTC
Created attachment 184443 [details]
Example file from Word 2016

Attached example file contains a table with different number of columns in rows.
In Word the second rows second and third cells have their top border turned off, but in Writer this is visible.

1. Open attached file
2. Notice the cell starting with 2 and the empty one right of it has top border, unlike in Word.

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 44355a90b3450111ad87ad4b6607a564e41d7b54
CPU threads: 14; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (hu_HU); UI: en-US
Calc: threaded

and all the way back to 3.6. In 3.5 there was no border imported at all.

If the same example is saved to docx, it had the same import issue fixed in 5.3 times with:

https://git.libreoffice.org/core/+/1d1748d143ab4270a2ca1b5117852b1b1bb4c

author	Miklos Vajna <vmiklos@collabora.co.uk>	Tue Aug 30 09:14:47 2016 +0200
committer	Miklos Vajna <vmiklos@collabora.co.uk>	Tue Aug 30 08:40:30 2016 +0000

Related: tdf#44986 DOCX import: handle w:gridAfter by faking cells
Comment 1 Gabor Kelemen (allotropia) 2023-01-02 14:12:22 UTC
Created attachment 184444 [details]
The example file in Word 2016 and Writer
Comment 2 Gabor Kelemen (allotropia) 2023-01-02 14:22:33 UTC
Created attachment 184449 [details]
Same file as docx, for reference
Comment 3 raal 2023-01-03 16:43:29 UTC
Confirm with Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d993327eab0a2c9c8820c6528075b01de68b0ec6
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded
Comment 4 Vasily Melenchuk (CIB) 2023-01-13 08:43:26 UTC
Created attachment 184627 [details]
Minimized RTF sample

I've stripped down testcase to minimal for problem to became clear.

As far I see, there is problem with non-rectangular tables:
* first row contains only one cell and border below
* second row contains 2 cells
* in Writer first row is extended to fit entire table width unlike in Word.

I see that for DOCX Writer does creates extra cells in first row to make rectangular table. But it is not done for RTF.
Comment 5 Gabor Kelemen (allotropia) 2023-11-28 13:47:29 UTC
Created attachment 191084 [details]
Updated example file
Comment 6 Xisco FaulĂ­ 2023-11-29 13:19:55 UTC
The content of attachment 184443 [details] has been deleted for the following reason:

User's request