Bug 117134 - FILEOPEN Adjacent tables in DOCX mostly overlap
Summary: FILEOPEN Adjacent tables in DOCX mostly overlap
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.0.0
Keywords:
Depends on:
Blocks: DOCX-Tables DOCX-Anchor-and-Text-Wrap
  Show dependency treegraph
 
Reported: 2018-04-21 01:54 UTC by Aron Budea
Modified: 2021-09-12 01:42 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample DOCX (created in Word) (16.00 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-04-21 01:54 UTC, Aron Budea
Details
PDF exported in Word (83.29 KB, application/pdf)
2018-04-21 01:55 UTC, Aron Budea
Details
Screenshot in Writer (92.84 KB, image/png)
2018-04-21 01:57 UTC, Aron Budea
Details
Sample DOCX (frame+table) (16.02 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-09-16 23:23 UTC, Aron Budea
Details
Frame+table in Word and LO 7.0 (155.00 KB, image/png)
2020-09-11 11:44 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2018-04-21 01:54:43 UTC
Created attachment 141508 [details]
Sample DOCX (created in Word)

The attached DOCX contains two tables, right below one another. The first one is a floating table (text wrapping set to: Around), there's an empty line between the tables, but it slides up next to the first table because of that.

In Writer the two tables (the first is imported inside a frame) mostly overlap. This is a case where having a setting mentioned in bug 117132 could be useful.

Observed using LO 6.0.3.2 & 4.0.0.3 / Windows 7.
Comment 1 Aron Budea 2018-04-21 01:55:17 UTC
Created attachment 141509 [details]
PDF exported in Word
Comment 2 Aron Budea 2018-04-21 01:57:04 UTC
Created attachment 141510 [details]
Screenshot in Writer
Comment 3 Jacques Guilleron 2018-04-21 13:42:03 UTC
Hi Aron,

I reproduce with
LO  6.0.4.1 Build ID: a63363f6506b8bdc5222481ce79ef33b2d13c741
Threads CPU : 2; OS : Windows 6.1; UI Render : par défaut; 
Locale : fr-FR (fr_FR); Calc: CL
and
LO 6.1.0.0.alpha0+ Build ID: f80029445e2b558f0d0e0a25c2c1bbcbe5254120
CPU threads: 2; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-04-13_23:07:11
Locale: fr-FR (fr_FR); Calc: CL
Comment 4 V Stuart Foote 2018-04-21 15:16:47 UTC
How should we filter import this OOXML "feature"?

Notice that export / save-as of the sample document (attachment 141508 [details]) from  OOXML -> ODF using Word 2016 eliminates the tblOverlap. So, Microsoft does not handle it with their ODF filters, we don't either--is it even possible? Don't think ODF can.
Comment 5 Chavdar 2018-04-27 08:21:34 UTC
Confirmed!

Tested on:

Version: 6.0.3.2
Build ID: 8f48d515416608e3a835360314dac7e47fd0b821
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk2; 
Locale: en-US (en_US.UTF-8); Calc: group

Version: 6.1.0.0.alpha0+
Build ID: fcba22ef7959d3bf0c7f3fc02434a120e3d8c075
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2018-04-24_23:08:46
Locale: en-US (en_US.UTF-8); Calc: group
Comment 6 Aron Budea 2018-09-16 23:14:10 UTC
(In reply to V Stuart Foote from comment #4)
> How should we filter import this OOXML "feature"?
> 
> Notice that export / save-as of the sample document (attachment 141508 [details]
> [details]) from  OOXML -> ODF using Word 2016 eliminates the tblOverlap. So,
> Microsoft does not handle it with their ODF filters, we don't either--is it
> even possible? Don't think ODF can.
I noted that this feature could be implemented in ODF, see bug 117132. Until then, perhaps the current behavior of letting tables/frames overlap should be disabled, at least when it comes to Office cimpatibility. To me letting these overlap seems to be the less frequently used option, normally you want to be able to see what is in your document.
Comment 7 Aron Budea 2018-09-16 23:23:23 UTC
Created attachment 144923 [details]
Sample DOCX (frame+table)

In this sample there's a frame + table in the document from the start. This similarly overlaps in Writer. Interestingly this starts to overlap in different versions compared to the table + table.

Overlaps in 5.4.0.3.
Doesn't overlap in 5.3.0.3.

In Word frames don't have the options to allow or not allow overlap.
Nevertheless, I'd guess there are things in common between the two cases.
Comment 8 Aron Budea 2018-09-16 23:27:04 UTC
(In reply to Aron Budea from comment #7)
> In this sample there's a frame + table in the document from the start. This
> similarly overlaps in Writer. Interestingly this starts to overlap in
> different versions compared to the table + table.
And DOC is unaffected.
Comment 9 Aron Budea 2018-09-18 21:05:07 UTC
(In reply to Aron Budea from comment #7)
> In this sample there's a frame + table in the document from the start. This
> similarly overlaps in Writer. Interestingly this starts to overlap in
> different versions compared to the table + table.
> 
> Overlaps in 5.4.0.3.
> Doesn't overlap in 5.3.0.3.

Starts to overlap because of this, height is updated (was incorrect before), but positioning isn't. The conneciton to this issue is that in Word the frame pushes the table down, while in Writer the table doesn't move, and the two overlap.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=94c533bc59a8fe50b3d44c3200646f99269faab5
author		Vasily Melenchuk <Vasily.Melenchuk@cib.de>	2017-06-20 14:20:31 +0300
committer	Thorsten Behrens <Thorsten.Behrens@CIB.de>	2017-06-29 14:16:29 +0200

tdf#100075 DOCX frame height rule updated
Comment 10 QA Administrators 2019-10-11 02:35:57 UTC Comment hidden (obsolete)
Comment 11 Aron Budea 2019-10-14 01:31:53 UTC
Still buggy in 6.4.0.0.alpha0+ (bb6bcabda53dbd64dda43f09fab9f4ad6f34eba6).
Comment 12 Aron Budea 2020-04-27 01:03:52 UTC
The first sample (attachment 141508 [details]) now shows reasonably in Writer, since the following commit:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=fd7749fddc5a767461dfced55369af48e5a6d561
author		Miklos Vajna <vmiklos@collabora.com>	2020-02-14 16:29:44 +0100
committer	Miklos Vajna <vmiklos@collabora.com>	2020-02-14 18:37:34 +0100

"sw: fix handling of table vs fly overlaps in the AddVerticalFlyOffsets case"

The objects second sample with frame and table (attachment 144923 [details]) still overlap.
Comment 13 Justin L 2020-06-03 12:46:41 UTC
(In reply to Aron Budea from comment #12)
> The objects second sample with frame and table (attachment 144923 [details])
> still overlap.
Layout must not treat a table as something that ought to wrap. Since the table is full width, it can't wrap, and thus should come underneath the fram.
Comment 14 NISZ LibreOffice Team 2020-09-11 11:44:19 UTC
Created attachment 165391 [details]
Frame+table in Word and LO 7.0

Example file from comment #7 now looks good in 7.0 since:

https://git.libreoffice.org/core/+/358f654af36fa12102685237f6eadebae4610fb5

author
Tibor Nagy <nagy.tibor2@nisz.hu> Wed May 20 13:31:51 2020 +0200 
committer
László Németh <nemeth@numbertext.org> Mon May 25 10:12:44 2020 +0200 

tdf#107119 DOCX import: fix parallel text wrap around frames
Comment 15 NISZ LibreOffice Team 2020-09-11 11:50:27 UTC
I guess we can consider this one fixed per comment #12 ?

There are similar problems still (bug #76022 and bug #115625 is for shape + table ), but those are tracked as separate.
Comment 16 NISZ LibreOffice Team 2020-09-23 14:08:11 UTC
Let's close this per comment #14
Comment 17 Aron Budea 2021-09-12 01:42:30 UTC
Verified in LO Version: 7.3.0.0.alpha0+ (8151f3a1d99ab740d2affdccc7115faa156bf3ad).